Ticket #5437: switch_to_scaled_trunk_mythtv.diff

File switch_to_scaled_trunk_mythtv.diff, 14.5 KB (added by skamithi, 16 years ago)
  • libs/libmythtv/NuppelVideoPlayer.cpp

     
    67636763                rect->h = (int)(rect->h * vmult);
    67646764               
    67656765                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);
    67676768
    67686769                OSDTypeImage* image = new OSDTypeImage();
    67696770                image->SetPosition(QPoint(rect->x, rect->y), hmult, vmult);
     
    70797080            w    = (int)ceil(w    * hmult);
    70807081            h    = (int)ceil(h    * vmult);
    70817082
    7082             hl_image = hl_image.smoothScale(w, h);
     7083            hl_image = hl_image.scaled(w, h); // use FastTransformation
    70837084        }
    70847085        else
    70857086            hmult = vmult = 1.0;
  • libs/libmythtv/osdtypes.cpp

     
    15341534    else
    15351535        imheight = ((int)(tmpimage.height() * hmult) / 2) * 2;
    15361536
    1537     QImage tmp2 = tmpimage.smoothScale(imwidth, imheight);
     1537    QImage tmp2 = tmpimage.scaled(imwidth, imheight,
     1538        Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
    15381539
    15391540    m_isvalid = true;
    15401541    m_filename = filename;
  • libs/libmythtv/previewgenerator.cpp

     
    456456    ppw = max(1.0f, ppw);
    457457    pph = max(1.0f, pph);;
    458458
    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);
    460461
    461462    if (small_img.save(filename, "PNG"))
    462463    {
  • libs/libmythtv/channelutil.cpp

     
    137137            (tempimage.height() != (int) size))
    138138        {
    139139            QImage tmp2;
    140             tmp2 = tempimage.smoothScale(size, size);
     140            tmp2 = tempimage.scaled(size, size,
     141                    Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
    141142            iconPixmap.convertFromImage(tmp2);
    142143        }
    143144        else
  • libs/libmythtv/infostructs.cpp

     
    4040        if ((height == 0) && (tempimage.width() != width
    4141                                || tempimage.height() != width))
    4242        {
    43             tmp2 = tempimage.smoothScale(width, width);
     43            tmp2 = tempimage.scaled(width, width,
     44                Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
    4445            icon.convertFromImage(tmp2);
    4546        }
    4647        else if ((height > 0) && (tempimage.width() != width
    4748                                || tempimage.height() != height))
    4849        {
    49             tmp2 = tempimage.smoothScale(width, height);
     50            tmp2 = tempimage.scaled(width, height,
     51                Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
    5052            icon.convertFromImage(tmp2);
    5153        }
    5254        else
  • libs/libmythtv/mhi.cpp

     
    765765    {
    766766        // LoadFromQImage seems to have a problem with non-32 bit images.
    767767        // We need to work around that and force 32 bits.
    768         QImage scaled =
    769             qImage.smoothScale(
     768        QImage q_scaled =
     769            qImage.scaled(
    770770                displayRect.width() * GetWidth() / MHIContext::StdDisplayWidth,
    771771                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),
    774776                     x * GetWidth() / MHIContext::StdDisplayWidth,
    775777                     y * GetHeight() / MHIContext::StdDisplayHeight);
    776778    }
     
    779781        QImage clipped = qImage.convertDepth(32)
    780782            .copy(displayRect.x() - x, displayRect.y() - y,
    781783                  displayRect.width(), displayRect.height());
    782         QImage scaled =
    783             clipped.smoothScale(
     784        QImage q_scaled =
     785            clipped.scaled(
    784786                displayRect.width() * GetWidth() / MHIContext::StdDisplayWidth,
    785787                displayRect.height() *
    786                 GetHeight() / MHIContext::StdDisplayHeight);
    787         AddToDisplay(scaled,
     788                GetHeight() / MHIContext::StdDisplayHeight,
     789                Qt::IgnoreAspectRatio,
     790                Qt::SmoothTransformation);
     791        AddToDisplay(q_scaled,
    788792                     displayRect.x() *
    789793                     GetWidth() / MHIContext::StdDisplayWidth,
    790794                     displayRect.y() *
     
    15451549        return;
    15461550    }
    15471551
    1548     m_image = m_image.smoothScale(newWidth, newHeight);
     1552    m_image = m_image.scaled(newWidth, newHeight,
     1553            Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
    15491554}
  • libs/libmyth/settings.cpp

     
    10451045        return;
    10461046
    10471047    QImage temp = *(images[current]);
    1048     temp = temp.smoothScale((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);
    10501050
    10511051    QPixmap tmppix(temp);
    10521052    imagelabel->setPixmap(tmppix);
     
    11051105    if (images.size() != 0 && current < images.size() && images[current])
    11061106    {
    11071107        QImage temp = *(images[current]);
    1108         temp = temp.smoothScale((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);
    11101110 
    11111111        QPixmap tmppix(temp);
    11121112        imagelabel->setPixmap(tmppix);
  • libs/libmyth/uitypes.cpp

     
    389389    {
    390390        QImage scalerImg;
    391391
    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);
    394396        iconData[num].convertFromImage(scalerImg);
    395397    }
    396398    else
     
    436438        doY = m_iconsize.y();
    437439    }
    438440
    439     scalerImg = sourceImg.smoothScale(doX, doY);
     441    scalerImg = sourceImg.scaled(doX, doY, Qt::IgnoreAspectRatio,
     442                                Qt::SmoothTransformation);
    440443    if (loc == -1)
    441444        m_image.convertFromImage(scalerImg);
    442445    else
     
    14331436                    VERBOSE(VB_GENERAL, "         +Force Y: " << doY);
    14341437            }
    14351438
    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);
    14381443            m_show = true;
    14391444            img.convertFromImage(scalerImg);
    14401445            if (m_debug == true)
     
    16531658                doY = m_force_y;
    16541659            }
    16551660
    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);
    16581665
    16591666            QPixmap *img = new QPixmap();
    16601667            img->convertFromImage(scalerImg);
     
    24332440        }
    24342441        else
    24352442        {
    2436             pixmap = new QPixmap(img->smoothScale(width, height, mode));
     2443            pixmap = new QPixmap(img->scaled(width, height, mode,
     2444                                            Qt::SmoothTransformation));
    24372445            delete img;
    24382446        }
    24392447    }
     
    24602468    int sh = (int) (7 * m_hmult);
    24612469
    24622470    normalPixmap = createScaledPixmap(normalImage, imgWidth, imgHeight,
    2463                                       Qt::ScaleFree);
     2471                                      Qt::IgnoreAspectRatio);
    24642472    highlightedPixmap = createScaledPixmap(highlightedImage, imgWidth, imgHeight,
    2465                                            Qt::ScaleFree);
     2473                                           Qt::IgnoreAspectRatio);
    24662474    selectedPixmap = createScaledPixmap(selectedImage, imgWidth, imgHeight,
    2467                                         Qt::ScaleFree);
     2475                                        Qt::IgnoreAspectRatio);
    24682476    defaultPixmap = createScaledPixmap(defaultImage, imgWidth - 2 * sw,
    24692477                                       imgHeight - 2 * sh,
    2470                                        Qt::ScaleMin);
     2478                                       Qt::KeepAspectRatio);
    24712479}
    24722480
    24732481void UIImageGridType::calculateScreenArea(void)
     
    40734081            fontProp *tmpfont = NULL;
    40744082            QString a_string = QString("bin%1-active").arg(i);
    40754083            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));
    40774089            resized_highlight_images.append(temp_pixmap);
    40784090            highlight_map[i] = temp_pixmap;
    40794091        }
     
    40944106        fontProp *tmpfont = NULL;
    40954107        QString a_string = QString("bin%1-active").arg(bins);
    40964108        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));
    40984115        resized_highlight_images.append(temp_pixmap);
    40994116        highlight_map[0] = temp_pixmap;
    41004117    }
  • libs/libmyth/mythcontext.cpp

     
    30873087
    30883088            return NULL;
    30893089        }
    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);
    30923094        ret = new QImage(tmp2);
    30933095    }
    30943096    else
     
    31863188            delete ret;
    31873189            return NULL;
    31883190        }
    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);
    31913195        ret->convertFromImage(tmp2);
    31923196    }       
    31933197    else
  • programs/mythfrontend/playbackbox.cpp

     
    48184818            previewPixmap->convertFromImage(*image);
    48194819        else
    48204820        {
    4821             QImage tmp2 = image->smoothScale(previewSize);
     4821            QImage tmp2 = image->scaled(previewSize,
     4822                            Qt::IgnoreAspectRatio,
     4823                            Qt::SmoothTransformation);
    48224824            previewPixmap->convertFromImage(tmp2);
    48234825        }
    48244826    }
  • programs/mythbackend/mythxml.cpp

     
    792792    if ( nHeight == 0 )
    793793        nHeight = (int)rint(nWidth / fAspect);
    794794
    795     QImage img = pImage->smoothScale( nWidth, nHeight);
     795    QImage img = pImage->scaled( nWidth, nHeight, Qt::IgnoreAspectRatio,
     796                                Qt::SmoothTransformation);
    796797
    797798    img.save( sFileName.ascii(), "PNG" );
    798799
     
    977978    if ( nHeight == 0 )
    978979        nHeight = (int)rint(nWidth / fAspect);
    979980
    980     QImage img = pImage->smoothScale( nWidth, nHeight);
     981    QImage img = pImage->scaled( nWidth, nHeight, Qt::IgnoreAspectRatio,
     982                                Qt::SmoothTransformation);
    981983
    982984    img.save( sFileName.ascii(), "PNG" );
    983985
     
    12331235        return;
    12341236    }
    12351237
    1236     QImage img = pImage->smoothScale( nWidth, nHeight);
     1238    QImage img = pImage->scaled( nWidth, nHeight, Qt::IgnoreAspectRatio,
     1239                                Qt::SmoothTransformation);
    12371240
    12381241    img.save( pRequest->m_sFileName.ascii(), "PNG" );
    12391242