Back to index

scribus-ng  1.3.4.dfsg+svn20071115
rawimage.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 #ifndef RAWIMAGE_H
00008 #define RAWIMAGE_H
00009 
00010 #include "scconfig.h"
00011 #include "scribusapi.h"
00012 #include "qcstring.h"
00013 #include "qimage.h"
00014 
00015 class SCRIBUS_API RawImage : public QByteArray
00016 {
00017 public:
00018        RawImage();
00019        RawImage( int width, int height, int channels);
00020        ~RawImage();
00021        bool create( int width, int height, int channels);
00022        int width()  const { return m_width; };
00023        int height()  const { return m_height; };
00024        int channels()  const { return m_channels; };
00025        uchar *bits() const { return (uchar*)data(); };
00026        uchar *scanLine(int row);
00027        void setAlpha(int x, int y, int alpha);
00028        QImage convertToQImage(bool cmyk, bool raw = false);
00029 private:
00030        int m_width;
00031        int m_height;
00032        int m_channels;
00033 };
00034 
00035 #endif