00001 //------------------------------------------------------------------------------------------------- 00002 // 00003 // Header Name: ZDirectPixmap.h 00004 // 00005 // General Description: Used to access the protected fields in QPixmap. 00006 // 00007 //------------------------------------------------------------------------------------------------- 00008 // 00009 // Motorola Confidential Proprietary 00010 // Template ID and version: TMP_LFC_50068 Version 1.2 00011 // (c) Copyright Motorola 2004, All Rights Reserved 00012 // 00013 //------------------------------------------------------------------------------------------------- 00014 00015 #ifndef ZDIRECTPIXMAP_H 00016 #define ZDIRECTPIXMAP_H 00017 00018 #ifndef __cplusplus 00019 #error "This is a C++ header file; it requires C++ to compile." 00020 #endif 00021 00022 #include <qpixmap.h> 00023 00024 /** 00025 * Provides a wrapper so that applications can directly access the fields of 00026 * a QPixmap 00027 * 00028 * Qt does not allow applications to access the individual bytes of a 00029 * QPixmap because, traditionally, the QPixmap might live on another computer 00030 * (an X-Windows server, for example). However, qt-embedded applications 00031 * don't have this restriction. So ZDirectPixmap was created to allow 00032 * a QPixmap to be directly accessible. 00033 */ 00034 00035 class ZDirectPixmap : public QPixmap 00036 { 00037 public: 00038 00039 /** 00040 * Constructor for a DirectPixmap. 00041 * 00042 * @param width width in pixels 00043 * @param height height in pixels 00044 * @param depth depth in bits per pixel (default is -1) 00045 */ 00046 ZDirectPixmap(int width, int height, int depth=-1); 00047 00048 /** 00049 * returns a pointer to the actual data contained in the pixmap 00050 */ 00051 unsigned char* bits(); 00052 00053 /** 00054 * returns a const pointer to the actual data contained in the pixmap 00055 */ 00056 const unsigned char* bits() const; 00057 00058 /** 00059 * returns the number of bytes per line for the pixmap. 00060 */ 00061 int bytesPerLine() const; 00062 00063 }; 00064 00065 #endif // #ifndef ZDIRECTPIXMAP_H 00066