diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-26 21:04:57 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-26 21:04:57 +0000 |
commit | bf7f88413be3831a9372d323d02fc0335b9f9188 (patch) | |
tree | 516fdef9206245b40a14f99b4e3d9ef9289196e0 /src/gvcore/jpegformattype.cpp | |
parent | e238aa77b1fb3c2f55aef2ef2c91ce52166d2cc8 (diff) | |
download | gwenview-bf7f88413be3831a9372d323d02fc0335b9f9188.tar.gz gwenview-bf7f88413be3831a9372d323d02fc0335b9f9188.zip |
TQt4 port Gwenview
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/gwenview@1233720 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/gvcore/jpegformattype.cpp')
-rw-r--r-- | src/gvcore/jpegformattype.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/gvcore/jpegformattype.cpp b/src/gvcore/jpegformattype.cpp index ccb020e..26dee4e 100644 --- a/src/gvcore/jpegformattype.cpp +++ b/src/gvcore/jpegformattype.cpp @@ -35,8 +35,8 @@ extern "C" { #undef const } -// Qt -#include <qdatetime.h> +// TQt +#include <tqdatetime.h> // KDE #include <kdebug.h> @@ -72,9 +72,9 @@ struct JPEGSourceManager : public jpeg_source_mgr { int valid_buffer_length; size_t skip_input_bytes; bool at_eof; - QRect change_rect; - QRect old_change_rect; - QTime decoder_timestamp; + TQRect change_rect; + TQRect old_change_rect; + TQTime decoder_timestamp; bool final_pass; bool decoding_done; bool do_progressive; @@ -169,13 +169,13 @@ struct JPEGSourceManager : public jpeg_source_mgr { // JPEGFormat // //----------------------------------------------------------------------------- -class JPEGFormat : public QImageFormat { +class JPEGFormat : public TQImageFormat { public: JPEGFormat(); virtual ~JPEGFormat(); - virtual int decode(QImage& img, QImageConsumer* consumer, + virtual int decode(TQImage& img, TQImageConsumer* consumer, const uchar* buffer, int length); private: @@ -216,7 +216,7 @@ JPEGFormat::~JPEGFormat() { * return < 0 means "fatal error in image decoding, don't call me ever again" */ -int JPEGFormat::decode(QImage& image, QImageConsumer* consumer, const uchar* buffer, int length) { +int JPEGFormat::decode(TQImage& image, TQImageConsumer* consumer, const uchar* buffer, int length) { #ifdef JPEG_DEBUG qDebug("JPEGFormat::decode(%p, %p, %p, %d)", &image, consumer, buffer, length); @@ -278,7 +278,7 @@ int JPEGFormat::decode(QImage& image, QImageConsumer* consumer, const uchar* buf mDecompress.src->bytes_in_buffer = (size_t) mSourceManager.valid_buffer_length; #ifdef BUFFER_DEBUG - qDebug("buffer contains %d bytes", mSourceManager.valid_buffer_length); + qDebug("buffer tqcontains %d bytes", mSourceManager.valid_buffer_length); #endif if(mState == INIT) { @@ -319,7 +319,7 @@ int JPEGFormat::decode(QImage& image, QImageConsumer* consumer, const uchar* buf } else if ( mDecompress.output_components == 1 ) { image.create( mDecompress.output_width, mDecompress.output_height, 8, 256 ); for (int i=0; i<256; i++) { - image.setColor(i, qRgb(i,i,i)); + image.setColor(i, tqRgb(i,i,i)); } } @@ -388,17 +388,17 @@ again: // Expand 24->32 bpp. for (int j=oldoutput_scanline; j<oldoutput_scanline+completed_scanlines; j++) { uchar *in = image.scanLine(j) + mDecompress.output_width * 3; - QRgb *out = (QRgb*)image.scanLine(j); + TQRgb *out = (TQRgb*)image.scanLine(j); for (uint i=mDecompress.output_width; i--; ) { in-=3; - out[i] = qRgb(in[0], in[1], in[2]); + out[i] = tqRgb(in[0], in[1], in[2]); } } } if(consumer && completed_scanlines) { - QRect r(0, oldoutput_scanline, mDecompress.output_width, completed_scanlines); + TQRect r(0, oldoutput_scanline, mDecompress.output_width, completed_scanlines); #ifdef JPEG_DEBUG qDebug("changing %d/%d %d/%d", r.x(), r.y(), r.width(), r.height()); #endif @@ -407,10 +407,10 @@ again: if ( mSourceManager.decoder_timestamp.elapsed() >= MAX_CONSUMING_TIME ) { if( !mSourceManager.old_change_rect.isEmpty()) { consumer->changed(mSourceManager.old_change_rect); - mSourceManager.old_change_rect = QRect(); + mSourceManager.old_change_rect = TQRect(); } consumer->changed(mSourceManager.change_rect); - mSourceManager.change_rect = QRect(); + mSourceManager.change_rect = TQRect(); mSourceManager.decoder_timestamp.restart(); } } @@ -422,7 +422,7 @@ again: mSourceManager.decoding_done = mSourceManager.final_pass && mDecompress.input_scan_number == mDecompress.output_scan_number; if ( !mSourceManager.decoding_done ) { mSourceManager.old_change_rect |= mSourceManager.change_rect; - mSourceManager.change_rect = QRect(); + mSourceManager.change_rect = TQRect(); } } else { mSourceManager.decoding_done = true; @@ -508,7 +508,7 @@ again: // JPEGFormatType // //----------------------------------------------------------------------------- -QImageFormat* JPEGFormatType::decoderFor(const uchar* buffer, int length) { +TQImageFormat* JPEGFormatType::decoderFor(const uchar* buffer, int length) { if(length < 3) return 0; if(buffer[0] == 0377 && |