Added IrixCLJpegCompressor class which will support JPEG compression via the Irix Compression Library. This version of IrixCLJpegCompressor is just a stub.


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2375 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/rfb/IrixCLJpegCompressor.h b/common/rfb/IrixCLJpegCompressor.h
new file mode 100644
index 0000000..e32659a
--- /dev/null
+++ b/common/rfb/IrixCLJpegCompressor.h
@@ -0,0 +1,49 @@
+#ifndef __IRIXCLJPEGCOMPRESSOR_H__
+#define __IRIXCLJPEGCOMPRESSOR_H__
+
+#include <sys/types.h>
+
+#include <rdr/types.h>
+#include <rfb/PixelFormat.h>
+
+#include <rfb/JpegCompressor.h>
+
+namespace rfb {
+
+  //
+  // A C++ class for performing JPEG compression.
+  // This implementation uses IRIX Compression Library (CL).
+  //
+
+  class IrixCLJpegCompressor : public JpegCompressor
+  {
+  public:
+    IrixCLJpegCompressor();
+    virtual ~IrixCLJpegCompressor();
+
+    // Check if the object has been created successfully.
+    bool isValid() const { return false; }
+
+    // Set JPEG quality level (0..100).
+    virtual void setQuality(int level);
+
+    // Actually compress the image.
+    virtual void compress(const rdr::U32 *buf, const PixelFormat *fmt,
+			  int w, int h, int stride);
+
+    // Access results of the compression.
+    virtual size_t getDataLength() { return m_compressedLength; }
+    virtual const char *getDataPtr() { return m_compressedData; }
+
+  protected:
+    static const int DEFAULT_QUALITY;
+    int m_quality;
+
+    char *m_compressedData;
+    size_t m_compressedLength;
+  };
+
+}
+
+#endif // __IRIXCLJPEGCOMPRESSOR_H__
+