47 #include <private/qgraphicssystem_p.h> 48 #include <private/qapplication_p.h> 212 }
else if (pixmap.
depth() == 1) {
292 if (img.
color(0) == c0 && img.
color(1) == c1) {
322 QImage image(size, monoFormat);
328 int bytesPerLine = (size.
width() + 7) / 8;
329 for (
int y = 0; y < size.
height(); ++y)
330 memcpy(image.
scanLine(y), bits + bytesPerLine * y, bytesPerLine);
The QVariant class acts like a union for the most common Qt data types.
The QColor class provides colors based on RGB, HSV or CMYK values.
QImage toImage() const
Converts the pixmap to a QImage.
Format
The following image formats are available in Qt.
QPixmap & operator=(const QPixmap &)
Assigns the given pixmap to this pixmap and returns a reference to this pixmap.
void setColor(int i, QRgb c)
Sets the color at the given index in the color table, to the given to colorValue. ...
QPixmap()
Constructs a null pixmap.
#define QT_END_NAMESPACE
This macro expands to.
~QBitmap()
Destroys the bitmap.
QSize size() const
Returns the size of the pixmap.
QBitmap & operator=(const QPixmap &)
Assigns the given pixmap to this bitmap and returns a reference to this bitmap.
The QMatrix class specifies 2D transformations of a coordinate system.
QExplicitlySharedDataPointer< QPixmapData > data
bool isNull() const
Returns true if it is a null image, otherwise returns false.
static QBitmap fromData(const QSize &size, const uchar *bits, QImage::Format monoFormat=QImage::Format_MonoLSB)
Constructs a bitmap with the given size, and sets the contents to the bits supplied.
QPixmap transformed(const QMatrix &, Qt::TransformationMode mode=Qt::FastTransformation) const
This convenience function loads the matrix into a QTransform and calls the overloaded function...
int depth() const
Returns the depth of the pixmap.
bool load(const QString &fileName, const char *format=0, Qt::ImageConversionFlags flags=Qt::AutoColor)
Loads a pixmap from the file with the given fileName.
The QString class provides a Unicode character string.
QBitmap transformed(const QMatrix &) const
This convenience function converts the matrix to a QTransform and calls the overloaded function...
The QScopedPointer class stores a pointer to a dynamically allocated object, and deletes it upon dest...
The QBitmap class provides monochrome (1-bit depth) pixmaps.
int width() const
Returns the width.
#define QT_BEGIN_NAMESPACE
This macro expands to.
virtual void fromImage(const QImage &image, Qt::ImageConversionFlags flags)=0
QBitmap()
Constructs a null bitmap.
The QImage class provides a hardware-independent image representation that allows direct access to th...
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const Q_REQUIRED_RESULT
Returns a copy of the image in the given format.
int height() const
Returns the height.
The QPixmap class is an off-screen image representation that can be used as a paint device...
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...
The QSize class defines the size of a two-dimensional object using integer point precision.
void invertPixels(InvertMode=InvertRgb)
Inverts all pixel values in the image.
virtual QPixmapData * createPixmapData(QPixmapData::PixelType type) const =0
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
static QGraphicsSystem * graphicsSystem()
static QPixmapData * createDefaultPixmapData(QPixmapData::PixelType type)
static QString fileName(const QString &fileUrl)
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.
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.