Scribus
Open source desktop publishing at your fingertips
rawimage.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 #ifndef RAWIMAGE_H
8 #define RAWIMAGE_H
9 
10 #include "scconfig.h"
11 #include "scribusapi.h"
12 #include "QByteArray"
13 #include <QImage>
14 
15 class SCRIBUS_API RawImage : public QByteArray
16 {
17 public:
18  RawImage();
19  RawImage( int width, int height, int channels);
20  ~RawImage();
21  bool create( int width, int height, int channels);
22  int width() const { return m_width; };
23  int height() const { return m_height; };
24  int channels() const { return m_channels; };
25  uchar *bits() const { return (uchar*)data(); };
26  uchar *scanLine(int row);
27  void setAlpha(int x, int y, int alpha);
28  QImage convertToQImage(bool cmyk, bool raw = false);
29 private:
30  int m_width;
31  int m_height;
32  int m_channels;
33 };
34 
35 #endif
Definition: rawimage.h:15