diff options
author | Constantin Kaplinsky <const@tightvnc.com> | 2007-12-07 08:23:04 +0000 |
---|---|---|
committer | Constantin Kaplinsky <const@tightvnc.com> | 2007-12-07 08:23:04 +0000 |
commit | cf1d7f11b444452c3692d2ca0cb320d54460c7b7 (patch) | |
tree | d9002d16ae5de8ecbb5deeff88dc6e3307bdfb09 /common/rfb | |
parent | 3e43ed5fb36aeb33483dded9a335038607544afe (diff) | |
download | tigervnc-cf1d7f11b444452c3692d2ca0cb320d54460c7b7.tar.gz tigervnc-cf1d7f11b444452c3692d2ca0cb320d54460c7b7.zip |
Various improvements in the IrixDMJpegCompressor class. Member functions have been declared virtual. The setQuality() function allows compression levels in the range [1..99] now, and calls IrixDMIC_RawToJpeg::setImageQuality() when necessary.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2372 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common/rfb')
-rw-r--r-- | common/rfb/IrixDMJpegCompressor.cxx | 14 | ||||
-rw-r--r-- | common/rfb/IrixDMJpegCompressor.h | 10 |
2 files changed, 12 insertions, 12 deletions
diff --git a/common/rfb/IrixDMJpegCompressor.cxx b/common/rfb/IrixDMJpegCompressor.cxx index 6e155ec1..33397f63 100644 --- a/common/rfb/IrixDMJpegCompressor.cxx +++ b/common/rfb/IrixDMJpegCompressor.cxx @@ -35,9 +35,7 @@ IrixDMJpegCompressor::~IrixDMJpegCompressor() } // -// Set JPEG quality level (1..100) -// -// FIXME: Call m_ic.setImageQuality() when necessary. +// Set JPEG quality level (1..99) // void @@ -45,11 +43,13 @@ IrixDMJpegCompressor::setQuality(int level) { if (level < 1) { level = 1; - } else if (level > 100) { - level = 100; + } else if (level > 99) { + level = 99; + } + if (level != m_quality) { + m_quality = level; + m_ic.setImageQuality(level); } - - m_quality = level; } // diff --git a/common/rfb/IrixDMJpegCompressor.h b/common/rfb/IrixDMJpegCompressor.h index 500884af..db242003 100644 --- a/common/rfb/IrixDMJpegCompressor.h +++ b/common/rfb/IrixDMJpegCompressor.h @@ -26,15 +26,15 @@ namespace rfb { bool isValid() const { return m_ic.isValid(); } // Set JPEG quality level (0..100). - void setQuality(int level); + virtual void setQuality(int level); // Actually compress the image. - void compress(const rdr::U32 *buf, const PixelFormat *fmt, - int w, int h, int stride); + virtual void compress(const rdr::U32 *buf, const PixelFormat *fmt, + int w, int h, int stride); // Access results of the compression. - size_t getDataLength() { return m_compressedLength; } - const char *getDataPtr() { return m_compressedData; } + virtual size_t getDataLength() { return m_compressedLength; } + virtual const char *getDataPtr() { return m_compressedData; } protected: // Update image size and make sure that our buffer pools will |