author | alwin <alwin> | 2004-04-15 07:44:42 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-04-15 07:44:42 (UTC) |
commit | 41203805fb5e70df84cc2894dbd6e030c6355041 (patch) (side-by-side diff) | |
tree | 3bffe09aeff1a69d9912193c481a2effe990d5db | |
parent | 20175bc18b278426c80ff890853cbf54839f88be (diff) | |
download | opie-41203805fb5e70df84cc2894dbd6e030c6355041.zip opie-41203805fb5e70df84cc2894dbd6e030c6355041.tar.gz opie-41203805fb5e70df84cc2894dbd6e030c6355041.tar.bz2 |
using other values when scaled loading of jpegs
-rw-r--r-- | libopie2/opiemm/oimagescrollview.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie2/opiemm/oimagescrollview.cpp b/libopie2/opiemm/oimagescrollview.cpp index 0e86bd0..68b06af 100644 --- a/libopie2/opiemm/oimagescrollview.cpp +++ b/libopie2/opiemm/oimagescrollview.cpp @@ -35,129 +35,129 @@ OImageScrollView::OImageScrollView( QWidget* parent, const char* name, WFlags f init(); } OImageScrollView::OImageScrollView (const QImage&img, QWidget * parent, const char * name, WFlags f,bool always_scale,bool rfit) :QScrollView(parent,name,f|Qt::WRepaintNoErase),_image_data(),_original_data(img), m_states(SCROLLVIEW_BITSET_SIZE),m_lastName("") { _zoomer = 0; m_states[AUTO_SCALE]=always_scale; m_states[AUTO_ROTATE]=rfit; m_states[FIRST_RESIZE_DONE]=false; m_states[IMAGE_IS_JPEG]=false; m_states[IMAGE_SCALED_LOADED]=false; m_states[SHOW_ZOOMER]=true; _original_data.convertDepth(QPixmap::defaultDepth()); _original_data.setAlphaBuffer(false); init(); } OImageScrollView::OImageScrollView (const QString&img, QWidget * parent, const char * name, WFlags f,bool always_scale,bool rfit) :QScrollView(parent,name,f|Qt::WRepaintNoErase),_image_data(),_original_data(),m_states(SCROLLVIEW_BITSET_SIZE),m_lastName("") { _zoomer = 0; m_states.resize(SCROLLVIEW_BITSET_SIZE); m_states[AUTO_SCALE]=always_scale; m_states[AUTO_ROTATE]=rfit; m_states[FIRST_RESIZE_DONE]=false; m_states[IMAGE_IS_JPEG]=false; m_states[IMAGE_SCALED_LOADED]=false; m_states[SHOW_ZOOMER]=true; init(); setImage(img); } void OImageScrollView::setImage(const QImage&img) { _image_data = QImage(); _original_data=img; _original_data.convertDepth(QPixmap::defaultDepth()); _original_data.setAlphaBuffer(false); m_lastName = ""; setImageIsJpeg(false); setImageScaledLoaded(false); if (FirstResizeDone()) { generateImage(); } } void OImageScrollView::loadJpeg(bool interncall) { if (m_lastName.isEmpty()) return; QImageIO iio( m_lastName, 0l ); QString param; bool real_load = false; if (AutoScale()) { if (!interncall) { int wid, hei; wid = QApplication::desktop()->width(); hei = QApplication::desktop()->height(); if (hei>wid) { wid = hei; } else { hei = wid; } - param = QString( "Fast Shrink( 7 ) Scale( %1, %2, ScaleFree)" ).arg( wid ).arg( hei ); + param = QString( "Fast Shrink( 3 ) Scale( %1, %2, ScaleFree)" ).arg( wid ).arg( hei ); odebug << "Load jpeg scaled \"" << param << "\"" << oendl; iio.setParameters(param.latin1()); setImageScaledLoaded(true); real_load = true; } } else { if (ImageScaledLoaded()||!interncall) { odebug << "Load jpeg unscaled" << oendl; real_load = true; } setImageScaledLoaded(false); } if (real_load) { { QCopEnvelope( "QPE/System", "busy()" ); } _original_data = iio.read() ? iio.image() : QImage(); { QCopEnvelope env( "QPE/System", "notBusy(QString)" ); env << "Image loaded"; } } } void OImageScrollView::setImage( const QString& path ) { odebug << "load new image " << oendl; if (m_lastName == path) return; m_lastName = path; QString itype = QImage::imageFormat(m_lastName); odebug << "Image type = " << itype << oendl; if (itype == "JPEG") { setImageIsJpeg(true); loadJpeg(); } else { { QCopEnvelope( "QPE/System", "busy()" ); } setImageIsJpeg(false); _original_data.load(path); _original_data.convertDepth(QPixmap::defaultDepth()); _original_data.setAlphaBuffer(false); { QCopEnvelope env( "QPE/System", "notBusy(QString)" ); env << "Image loaded"; } } _image_data = QImage(); if (FirstResizeDone()) { generateImage(); } } /* should be called every time the QImage changed it content */ void OImageScrollView::init() { odebug << "init " << oendl; /* * create the zoomer * and connect ther various signals */ _zoomer = new Opie::MM::OImageZoomer( this, "The Zoomer" ); connect(_zoomer, SIGNAL( zoomAreaRel(int,int)), this, SLOT(scrollBy(int,int)) ); |