Scribus
Open source desktop publishing at your fingertips
scstreamfilter_jpeg.h
1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 
8 #ifndef SCSTREAMFILTER_JPEG_H
9 #define SCSTREAMFILTER_JPEG_H
10 
11 #include <QGlobalStatic>
12 #include "scstreamfilter.h"
13 
15 
17 {
18  friend struct ScJpegDestinationMgr;
19 
20 public:
21 
22  typedef enum {
23  RGB,
24  CMYK,
25  GRAY
26  } Color;
27 
28  ScJpegEncodeFilter(QDataStream* stream, unsigned int imgWidth, unsigned int imgHeight, ScJpegEncodeFilter::Color color);
29  ScJpegEncodeFilter(ScStreamFilter* filter, unsigned int imgWidth, unsigned int imgHeight, ScJpegEncodeFilter::Color color);
31 
32  virtual bool openFilter (void);
33  virtual bool closeFilter(void);
34 
35  virtual bool writeData(const char* data, int dataLen);
36 
37  void setQuality(int quality) { m_quality = qMin(qMax(0, quality), 100); }
38 
39 protected:
40 
41  ScJpegEncodeFilterData* m_filterData;
42 
43  void freeData(void);
44  bool m_openedFilter;
45 
46  unsigned int m_width;
47  unsigned int m_height;
48  int m_quality;
49  Color m_color;
50 };
51 
52 #endif
Definition: scstreamfilter_jpeg.cpp:47
Definition: scstreamfilter_jpeg.h:16
Definition: scstreamfilter.h:14
Definition: scstreamfilter_jpeg.cpp:98