43 #include <QtCore/qbuffer.h> 44 #include <QtGui/qbitmap.h> 45 #include <QtGui/qimagereader.h> 46 #include <private/qgraphicssystem_p.h> 47 #include <private/qapplication_p.h> 48 #include <private/qimagepixmapcleanuphooks_p.h> 53 0x10, 0x20, 0x40, 0x80 };
116 if (img.
color(0) == c0 && img.
color(1) == c1) {
128 Qt::ImageConversionFlags flags)
135 Qt::ImageConversionFlags flags)
175 const int w = image.
width();
178 switch (image.
depth()) {
181 for (
int y = 0; y <
h; ++y) {
185 for (
int i = 0; i < bytesPerLine; ++i)
186 tscan[i] &= mscan[i];
193 for (
int y = 0; y <
h; ++y) {
196 for (
int x = 0; x <
w; ++x) {
215 const int w = image.
width();
228 for (
int y = 0; y <
h; ++y) {
231 memset(dest, 0, bpl);
232 for (
int x = 0; x <
w; ++x) {
278 #if defined(Q_OS_SYMBIAN) 284 void* QPixmapData::toNativeType(NativeType )
289 void QPixmapData::fromNativeType(
void* , NativeType )
virtual QPixmapData * createCompatiblePixmapData() const
The QColor class provides colors based on RGB, HSV or CMYK values.
virtual bool fromFile(const QString &filename, const char *format, Qt::ImageConversionFlags flags)
QImage toImage() const
Converts the pixmap to a QImage.
static QPixmap fromImage(const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
Converts the given image to a pixmap using the specified flags to control the conversion.
virtual QPixmap transformed(const QTransform &matrix, Qt::TransformationMode mode) const
QImage copy(const QRect &rect=QRect()) const
Returns a sub-area of the image as a new image.
void setColor(int i, QRgb c)
Sets the color at the given index in the color table, to the given to colorValue. ...
#define QT_END_NAMESPACE
This macro expands to.
QSize size() const
Returns the size of the pixmap.
Q_GUI_EXPORT_INLINE int qAlpha(QRgb rgb)
bool open(OpenMode openMode)
Reimplemented Function
bool isNull() const
Returns true if it is a null image, otherwise returns false.
The QByteArray class provides an array of bytes.
virtual void resize(int width, int height)=0
int bytesPerLine() const
Returns the number of bytes per image scanline.
long ASN1_INTEGER_get ASN1_INTEGER * a
The QBuffer class provides a QIODevice interface for a QByteArray.
The QString class provides a Unicode character string.
virtual QBitmap mask() const
virtual bool fromData(const uchar *buffer, uint len, const char *format, Qt::ImageConversionFlags flags)
static void executePixmapDataDestructionHooks(QPixmapData *)
Format format() const
Returns the format of the image.
PixelType pixelType() const
virtual QPixmap alphaChannel() const
The QBitmap class provides monochrome (1-bit depth) pixmaps.
virtual QImage toImage() const =0
void setColorCount(int)
Resizes the color table to contain colorCount entries.
#define QT_BEGIN_NAMESPACE
This macro expands to.
virtual void fromImage(const QImage &image, Qt::ImageConversionFlags flags)=0
static QByteArray fromRawData(const char *, int size)
Constructs a QByteArray that uses the first size bytes of the data array.
The QImage class provides a hardware-independent image representation that allows direct access to th...
static const char * data(const QByteArray &arr)
int depth() const
Returns the depth of the image.
QPixmapData(PixelType pixelType, int classId)
bool contains(const QPoint &p, bool proper=false) const
Returns true if the given point is inside or on the edge of the rectangle, otherwise returns false...
The QImageReader class provides a format independent interface for reading images from files or other...
virtual bool hasAlphaChannel() const =0
int width() const
Returns the width of the image.
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const Q_REQUIRED_RESULT
Returns a copy of the image in the given format.
const uchar qt_pixmap_bit_mask[]
virtual void copy(const QPixmapData *data, const QRect &rect)
The QRect class defines a rectangle in the plane using integer precision.
static QPixmapData * create(int w, int h, PixelType type)
virtual void setMask(const QBitmap &mask)
int height() const
Returns the height of the image.
The QPixmap class is an off-screen image representation that can be used as a paint device...
static QImage makeBitmapCompliantIfNeeded(QPixmapData *d, const QImage &image, Qt::ImageConversionFlags flags)
virtual QImage * buffer()
static QBitmap fromImage(const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
Returns a copy of the given image converted to a bitmap using the specified image conversion flags...
virtual void setAlphaChannel(const QPixmap &alphaChannel)
void invertPixels(InvertMode=InvertRgb)
Inverts all pixel values in the image.
virtual QPixmapData * createPixmapData(QPixmapData::PixelType type) const =0
void setAlphaChannel(const QImage &alphaChannel)
Sets the alpha channel of this image to the given alphaChannel.
bool isEmpty() const
Returns true if either of the width and height is less than or equal to 0; otherwise returns false...
static QGraphicsSystem * graphicsSystem()
void setSerialNumber(int serNo)
static QPixmapData * createDefaultPixmapData(QPixmapData::PixelType type)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
static QString fileName(const QString &fileUrl)
QImage read()
Reads an image from the device.
QRgb color(int i) const
Returns the color in the color table at index i.
QRgb rgb() const
Returns the RGB value of the color.
virtual bool scroll(int dx, int dy, const QRect &rect)
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
virtual void fromImageReader(QImageReader *imageReader, Qt::ImageConversionFlags flags)