blob: e32659a2204bd77d8093ed99fb57a8d14a597ec7 [file] [log] [blame]
Constantin Kaplinsky39e31a12007-12-13 19:16:33 +00001#ifndef __IRIXCLJPEGCOMPRESSOR_H__
2#define __IRIXCLJPEGCOMPRESSOR_H__
3
4#include <sys/types.h>
5
6#include <rdr/types.h>
7#include <rfb/PixelFormat.h>
8
9#include <rfb/JpegCompressor.h>
10
11namespace rfb {
12
13 //
14 // A C++ class for performing JPEG compression.
15 // This implementation uses IRIX Compression Library (CL).
16 //
17
18 class IrixCLJpegCompressor : public JpegCompressor
19 {
20 public:
21 IrixCLJpegCompressor();
22 virtual ~IrixCLJpegCompressor();
23
24 // Check if the object has been created successfully.
25 bool isValid() const { return false; }
26
27 // Set JPEG quality level (0..100).
28 virtual void setQuality(int level);
29
30 // Actually compress the image.
31 virtual void compress(const rdr::U32 *buf, const PixelFormat *fmt,
32 int w, int h, int stride);
33
34 // Access results of the compression.
35 virtual size_t getDataLength() { return m_compressedLength; }
36 virtual const char *getDataPtr() { return m_compressedData; }
37
38 protected:
39 static const int DEFAULT_QUALITY;
40 int m_quality;
41
42 char *m_compressedData;
43 size_t m_compressedLength;
44 };
45
46}
47
48#endif // __IRIXCLJPEGCOMPRESSOR_H__
49