Ticket #5437: switch_to_scaled_trunk_mythtv.diff
File switch_to_scaled_trunk_mythtv.diff, 14.5 KB (added by , 16 years ago) |
---|
-
libs/libmythtv/NuppelVideoPlayer.cpp
6763 6763 rect->h = (int)(rect->h * vmult); 6764 6764 6765 6765 if (hmult < 0.98 || hmult > 1.02 || vmult < 0.98 || hmult > 1.02) 6766 qImage = qImage.smoothScale(rect->w, rect->h); 6766 qImage = qImage.scaled(rect->w, rect->h, 6767 Qt::IgnoreAspectRatio, Qt::SmoothTransformation); 6767 6768 6768 6769 OSDTypeImage* image = new OSDTypeImage(); 6769 6770 image->SetPosition(QPoint(rect->x, rect->y), hmult, vmult); … … 7079 7080 w = (int)ceil(w * hmult); 7080 7081 h = (int)ceil(h * vmult); 7081 7082 7082 hl_image = hl_image.s moothScale(w, h);7083 hl_image = hl_image.scaled(w, h); // use FastTransformation 7083 7084 } 7084 7085 else 7085 7086 hmult = vmult = 1.0; -
libs/libmythtv/osdtypes.cpp
1534 1534 else 1535 1535 imheight = ((int)(tmpimage.height() * hmult) / 2) * 2; 1536 1536 1537 QImage tmp2 = tmpimage.smoothScale(imwidth, imheight); 1537 QImage tmp2 = tmpimage.scaled(imwidth, imheight, 1538 Qt::IgnoreAspectRatio, Qt::SmoothTransformation); 1538 1539 1539 1540 m_isvalid = true; 1540 1541 m_filename = filename; -
libs/libmythtv/previewgenerator.cpp
456 456 ppw = max(1.0f, ppw); 457 457 pph = max(1.0f, pph);; 458 458 459 QImage small_img = img.smoothScale((int) ppw, (int) pph); 459 QImage small_img = img.scaled((int) ppw, (int) pph, 460 Qt::IgnoreAspectRatio, Qt::SmoothTransformation); 460 461 461 462 if (small_img.save(filename, "PNG")) 462 463 { -
libs/libmythtv/channelutil.cpp
137 137 (tempimage.height() != (int) size)) 138 138 { 139 139 QImage tmp2; 140 tmp2 = tempimage.smoothScale(size, size); 140 tmp2 = tempimage.scaled(size, size, 141 Qt::IgnoreAspectRatio, Qt::SmoothTransformation); 141 142 iconPixmap.convertFromImage(tmp2); 142 143 } 143 144 else -
libs/libmythtv/infostructs.cpp
40 40 if ((height == 0) && (tempimage.width() != width 41 41 || tempimage.height() != width)) 42 42 { 43 tmp2 = tempimage.smoothScale(width, width); 43 tmp2 = tempimage.scaled(width, width, 44 Qt::IgnoreAspectRatio, Qt::SmoothTransformation); 44 45 icon.convertFromImage(tmp2); 45 46 } 46 47 else if ((height > 0) && (tempimage.width() != width 47 48 || tempimage.height() != height)) 48 49 { 49 tmp2 = tempimage.smoothScale(width, height); 50 tmp2 = tempimage.scaled(width, height, 51 Qt::IgnoreAspectRatio, Qt::SmoothTransformation); 50 52 icon.convertFromImage(tmp2); 51 53 } 52 54 else -
libs/libmythtv/mhi.cpp
765 765 { 766 766 // LoadFromQImage seems to have a problem with non-32 bit images. 767 767 // We need to work around that and force 32 bits. 768 QImage scaled =769 qImage.s moothScale(768 QImage q_scaled = 769 qImage.scaled( 770 770 displayRect.width() * GetWidth() / MHIContext::StdDisplayWidth, 771 771 displayRect.height() * 772 GetHeight() / MHIContext::StdDisplayHeight); 773 AddToDisplay(scaled.convertDepth(32), 772 GetHeight() / MHIContext::StdDisplayHeight, 773 Qt::IgnoreAspectRatio, 774 Qt::SmoothTransformation); 775 AddToDisplay(q_scaled.convertDepth(32), 774 776 x * GetWidth() / MHIContext::StdDisplayWidth, 775 777 y * GetHeight() / MHIContext::StdDisplayHeight); 776 778 } … … 779 781 QImage clipped = qImage.convertDepth(32) 780 782 .copy(displayRect.x() - x, displayRect.y() - y, 781 783 displayRect.width(), displayRect.height()); 782 QImage scaled =783 clipped.s moothScale(784 QImage q_scaled = 785 clipped.scaled( 784 786 displayRect.width() * GetWidth() / MHIContext::StdDisplayWidth, 785 787 displayRect.height() * 786 GetHeight() / MHIContext::StdDisplayHeight); 787 AddToDisplay(scaled, 788 GetHeight() / MHIContext::StdDisplayHeight, 789 Qt::IgnoreAspectRatio, 790 Qt::SmoothTransformation); 791 AddToDisplay(q_scaled, 788 792 displayRect.x() * 789 793 GetWidth() / MHIContext::StdDisplayWidth, 790 794 displayRect.y() * … … 1545 1549 return; 1546 1550 } 1547 1551 1548 m_image = m_image.smoothScale(newWidth, newHeight); 1552 m_image = m_image.scaled(newWidth, newHeight, 1553 Qt::IgnoreAspectRatio, Qt::SmoothTransformation); 1549 1554 } -
libs/libmyth/settings.cpp
1045 1045 return; 1046 1046 1047 1047 QImage temp = *(images[current]); 1048 temp = temp.s moothScale((int)(184 * m_hmult), (int)(138 * m_hmult),1049 Qt::ScaleMin);1048 temp = temp.scaled((int)(184 * m_hmult), (int)(138 * m_hmult), 1049 Qt::KeepAspectRatio); 1050 1050 1051 1051 QPixmap tmppix(temp); 1052 1052 imagelabel->setPixmap(tmppix); … … 1105 1105 if (images.size() != 0 && current < images.size() && images[current]) 1106 1106 { 1107 1107 QImage temp = *(images[current]); 1108 temp = temp.s moothScale((int)(184 * m_hmult), (int)(138 * m_hmult),1109 Qt::ScaleMin);1108 temp = temp.scaled((int)(184 * m_hmult), (int)(138 * m_hmult), 1109 Qt::KeepAspectRatio); 1110 1110 1111 1111 QPixmap tmppix(temp); 1112 1112 imagelabel->setPixmap(tmppix); -
libs/libmyth/uitypes.cpp
389 389 { 390 390 QImage scalerImg; 391 391 392 scalerImg = sourceImg.smoothScale((int)(m_iconsize.x()), 393 (int)(m_iconsize.y())); 392 scalerImg = sourceImg.scaled((int)(m_iconsize.x()), 393 (int)(m_iconsize.y()), 394 Qt::IgnoreAspectRatio, 395 Qt::SmoothTransformation); 394 396 iconData[num].convertFromImage(scalerImg); 395 397 } 396 398 else … … 436 438 doY = m_iconsize.y(); 437 439 } 438 440 439 scalerImg = sourceImg.smoothScale(doX, doY); 441 scalerImg = sourceImg.scaled(doX, doY, Qt::IgnoreAspectRatio, 442 Qt::SmoothTransformation); 440 443 if (loc == -1) 441 444 m_image.convertFromImage(scalerImg); 442 445 else … … 1433 1436 VERBOSE(VB_GENERAL, " +Force Y: " << doY); 1434 1437 } 1435 1438 1436 scalerImg = sourceImg->smoothScale((int)(doX * m_wmult), 1437 (int)(doY * m_hmult)); 1439 scalerImg = sourceImg->scaled((int)(doX * m_wmult), 1440 (int)(doY * m_hmult), 1441 Qt::IgnoreAspectRatio, 1442 Qt::SmoothTransformation); 1438 1443 m_show = true; 1439 1444 img.convertFromImage(scalerImg); 1440 1445 if (m_debug == true) … … 1653 1658 doY = m_force_y; 1654 1659 } 1655 1660 1656 QImage scalerImg = sourceImg.smoothScale((int)(doX * m_wmult), 1657 (int)(doY * m_hmult)); 1661 QImage scalerImg = sourceImg.scaled((int)(doX * m_wmult), 1662 (int)(doY * m_hmult), 1663 Qt::IgnoreAspectRatio, 1664 Qt::SmoothTransformation); 1658 1665 1659 1666 QPixmap *img = new QPixmap(); 1660 1667 img->convertFromImage(scalerImg); … … 2433 2440 } 2434 2441 else 2435 2442 { 2436 pixmap = new QPixmap(img->smoothScale(width, height, mode)); 2443 pixmap = new QPixmap(img->scaled(width, height, mode, 2444 Qt::SmoothTransformation)); 2437 2445 delete img; 2438 2446 } 2439 2447 } … … 2460 2468 int sh = (int) (7 * m_hmult); 2461 2469 2462 2470 normalPixmap = createScaledPixmap(normalImage, imgWidth, imgHeight, 2463 Qt:: ScaleFree);2471 Qt::IgnoreAspectRatio); 2464 2472 highlightedPixmap = createScaledPixmap(highlightedImage, imgWidth, imgHeight, 2465 Qt:: ScaleFree);2473 Qt::IgnoreAspectRatio); 2466 2474 selectedPixmap = createScaledPixmap(selectedImage, imgWidth, imgHeight, 2467 Qt:: ScaleFree);2475 Qt::IgnoreAspectRatio); 2468 2476 defaultPixmap = createScaledPixmap(defaultImage, imgWidth - 2 * sw, 2469 2477 imgHeight - 2 * sh, 2470 Qt:: ScaleMin);2478 Qt::KeepAspectRatio); 2471 2479 } 2472 2480 2473 2481 void UIImageGridType::calculateScreenArea(void) … … 4073 4081 fontProp *tmpfont = NULL; 4074 4082 QString a_string = QString("bin%1-active").arg(i); 4075 4083 tmpfont = &m_fontfcns[m_fonts[a_string]]; 4076 temp_pixmap->convertFromImage(temp_image.smoothScale(bin_corners[i].width(), QFontMetrics(tmpfont->face).height() + selectPadding)); 4084 temp_pixmap->convertFromImage( 4085 temp_image.scaled(bin_corners[i].width(), 4086 QFontMetrics(tmpfont->face).height() + selectPadding, 4087 Qt::IgnoreAspectRatio, 4088 Qt::SmoothTransformation)); 4077 4089 resized_highlight_images.append(temp_pixmap); 4078 4090 highlight_map[i] = temp_pixmap; 4079 4091 } … … 4094 4106 fontProp *tmpfont = NULL; 4095 4107 QString a_string = QString("bin%1-active").arg(bins); 4096 4108 tmpfont = &m_fontfcns[m_fonts[a_string]]; 4097 temp_pixmap->convertFromImage(temp_image.smoothScale(area.width(), QFontMetrics(tmpfont->face).height() + selectPadding )); 4109 temp_pixmap->convertFromImage( 4110 temp_image.scaled( 4111 area.width(), 4112 QFontMetrics(tmpfont->face).height() + selectPadding, 4113 Qt::IgnoreAspectRatio, 4114 Qt::SmoothTransformation)); 4098 4115 resized_highlight_images.append(temp_pixmap); 4099 4116 highlight_map[0] = temp_pixmap; 4100 4117 } -
libs/libmyth/mythcontext.cpp
3087 3087 3088 3088 return NULL; 3089 3089 } 3090 QImage tmp2 = tmpimage.smoothScale((int)(tmpimage.width() * wmult), 3091 (int)(tmpimage.height() * hmult)); 3090 QImage tmp2 = tmpimage.scaled((int)(tmpimage.width() * wmult), 3091 (int)(tmpimage.height() * hmult), 3092 Qt::IgnoreAspectRatio, 3093 Qt::SmoothTransformation); 3092 3094 ret = new QImage(tmp2); 3093 3095 } 3094 3096 else … … 3186 3188 delete ret; 3187 3189 return NULL; 3188 3190 } 3189 QImage tmp2 = tmpimage.smoothScale((int)(tmpimage.width() * wmult), 3190 (int)(tmpimage.height() * hmult)); 3191 QImage tmp2 = tmpimage.scaled((int)(tmpimage.width() * wmult), 3192 (int)(tmpimage.height() * hmult), 3193 Qt::IgnoreAspectRatio, 3194 Qt::SmoothTransformation); 3191 3195 ret->convertFromImage(tmp2); 3192 3196 } 3193 3197 else -
programs/mythfrontend/playbackbox.cpp
4818 4818 previewPixmap->convertFromImage(*image); 4819 4819 else 4820 4820 { 4821 QImage tmp2 = image->smoothScale(previewSize); 4821 QImage tmp2 = image->scaled(previewSize, 4822 Qt::IgnoreAspectRatio, 4823 Qt::SmoothTransformation); 4822 4824 previewPixmap->convertFromImage(tmp2); 4823 4825 } 4824 4826 } -
programs/mythbackend/mythxml.cpp
792 792 if ( nHeight == 0 ) 793 793 nHeight = (int)rint(nWidth / fAspect); 794 794 795 QImage img = pImage->smoothScale( nWidth, nHeight); 795 QImage img = pImage->scaled( nWidth, nHeight, Qt::IgnoreAspectRatio, 796 Qt::SmoothTransformation); 796 797 797 798 img.save( sFileName.ascii(), "PNG" ); 798 799 … … 977 978 if ( nHeight == 0 ) 978 979 nHeight = (int)rint(nWidth / fAspect); 979 980 980 QImage img = pImage->smoothScale( nWidth, nHeight); 981 QImage img = pImage->scaled( nWidth, nHeight, Qt::IgnoreAspectRatio, 982 Qt::SmoothTransformation); 981 983 982 984 img.save( sFileName.ascii(), "PNG" ); 983 985 … … 1233 1235 return; 1234 1236 } 1235 1237 1236 QImage img = pImage->smoothScale( nWidth, nHeight); 1238 QImage img = pImage->scaled( nWidth, nHeight, Qt::IgnoreAspectRatio, 1239 Qt::SmoothTransformation); 1237 1240 1238 1241 img.save( pRequest->m_sFileName.ascii(), "PNG" ); 1239 1242