Home · All Classes · Main Classes · Grouped Classes · Modules · Functions |
The following class members are part of the Qt 3 support layer. They are provided to help you port old code to Qt 4. We advise against using them in new code.
Constructs an image with w width, h height, depth bits per pixel, numColors colors and bit order bitOrder.
Using this constructor is the same as first constructing a null image and then calling the create() function.
See also create().
Constructs an image with size size pixels, depth depth bits, numColors and bitOrder endianness.
Using this constructor is the same as first constructing a null image and then calling the create() function.
See also create().
Constructs an image w pixels wide, h pixels high with a color depth of depth, that uses an existing memory buffer, data. The buffer must remain valid throughout the life of the QImage. The image does not delete the buffer at destruction.
If colortable is 0, a color table sufficient for numColors will be allocated (and destructed later).
Note that data must be 32-bit aligned.
The endianness is given in bitOrder.
Constructs an image that uses an existing memory buffer. The buffer must remain valid for the life of the QImage. The image does not delete the buffer at destruction. The buffer is passed as data. The image's width is w and its height is h. The color depth is depth. bpl specifies the number of bytes per line.
If colortable is 0, a color table sufficient for numColors will be allocated (and destructed later).
The endianness is specified by bitOrder.
Warning: This constructor is only available in Qtopia Core.
Use QImage::fromData(data) instead.
For example, if you have code like
QByteArray data; ... QImage image(data);
you can rewrite it as
QByteArray data; ... QImage image = QImage::fromData(data);
Returns the bit order for the image.
If it is a 1-bpp image, this function returns either QImage::BigEndian or QImage::LittleEndian.
If it is not a 1-bpp image, this function returns QImage::IgnoreEndian.
See also depth().
Converts the bit order of the image to bitOrder and returns the converted image. The original image is not changed.
Returns *this if the bitOrder is equal to the image bit order, or a null image if this image cannot be converted.
See also bitOrder(), systemBitOrder(), and isNull().
Converts the depth (bpp) of the image to depth and returns the converted image. The original image is not changed.
The depth argument must be 1, 8 or 32.
Returns *this if depth is equal to the image depth, or a null image if this image cannot be converted.
If the image needs to be modified to fit in a lower-resolution result (e.g. converting from 32-bit to 8-bit), use the flags to specify how you'd prefer this to happen.
See also depth() and isNull().
Returns an image with depth d, using the palette_count colors pointed to by palette. If d is 1 or 8, the returned image will have its color table ordered the same as palette.
If the image needs to be modified to fit in a lower-resolution result (e.g. converting from 32-bit to 8-bit), use the flags to specify how you'd prefer this to happen.
Note: currently no closest-color search is made. If colors are found that are not in the palette, the palette may not be used at all. This result should not be considered valid because it may change in future implementations.
Currently inefficient for non-32-bit images.
Use copy() and convertToFormat() instead.
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Use copy() and convertToFormat() instead.
Sets the image width, height, depth, its number of colors (in numColors), and bit order. Returns true if successful, or false if the parameters are incorrect or if memory cannot be allocated.
The width and height is limited to 32767. depth must be 1, 8, or 32. If depth is 1, bitOrder must be set to either QImage::LittleEndian or QImage::BigEndian. For other depths bitOrder must be QImage::IgnoreEndian.
This function allocates a color table and a buffer for the image data. The image data is not initialized.
The image buffer is allocated as a single block that consists of a table of scanline pointers (jumpTable()) and the image data (bits()).
jumpTable() scanLine() bits() bytesPerLine() numBytes()
See also fill(), width(), height(), depth(), numColors(), and bitOrder().
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
The width and height are specified in the size argument.
Returns true if alpha buffer mode is enabled; otherwise returns false.
See also setAlphaBuffer().
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Use the invertPixels() function that takes a QImage::InvertMode parameter instead.
Returns a pointer to the scanline pointer table.
This is the beginning of the data block for the image.
See also bits() and scanLine().
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Returns a mirror of the image, mirrored in the horizontal and/or the vertical direction depending on whether horizontal and vertical are set to true or false. The original image is not changed.
See also scaled().
Resets all image parameters and deallocates the image data.
Use scaledToHeight() instead.
Use scaledToWidth() instead.
Enables alpha buffer mode if enable is true, otherwise disables it. The default setting is disabled.
An 8-bpp image has 8-bit pixels. A pixel is an index into the color table, which contains 32-bit color values. In a 32-bpp image, the 32-bit pixels are the color values.
This 32-bit value is encoded as follows: The lower 24 bits are used for the red, green, and blue components. The upper 8 bits contain the alpha component.
The alpha component specifies the transparency of a pixel. 0 means completely transparent and 255 means opaque. The alpha component is ignored if you do not enable alpha buffer mode.
The alpha buffer is used to set a mask when a QImage is translated to a QPixmap.
See also hasAlphaBuffer() and createAlphaMask().
Use scaled(width, height, mode, Qt::SmoothTransformation) instead.
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
Use scaled(size, mode, Qt::SmoothTransformation) instead.
Returns a QImage in which the values of the red and blue components of all pixels have been swapped, effectively converting an RGB image to a BGR image. The original QImage is not changed.
Determines the bit order of the display hardware. Returns QImage::LittleEndian (LSB first) or QImage::BigEndian (MSB first).
See also systemByteOrder().
Determines the host computer byte order. Returns QImage::LittleEndian (LSB first) or QImage::BigEndian (MSB first).
See also systemBitOrder().
Use transform(matrix) instead.
Copies a block of pixels from src to dst. The pixels copied from source (src) are converted according to flags if it is incompatible with the destination (dst).
sx, sy is the top-left pixel in src, dx, dy is the top-left position in dst and sw, sh is the size of the copied block.
The copying is clipped if areas outside src or dst are specified.
If sw is -1, it is adjusted to src->width(). Similarly, if sh is -1, it is adjusted to src->height().
Currently inefficient for non 32-bit images.
Copyright © 2005 Trolltech | Trademarks | Qt 4.1.0 |