⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qimage.3qt

📁 tmark1.11:用于生成QT/EMBEDDED应用工程的Markfile文件
💻 3QT
📖 第 1 页 / 共 2 页
字号:
See also: loadFromData()..SH "QImage::QImage ( const QImage & image )"Constructs a shallow copy of \fIimage.\fR.SH "QImage::QImage ( const char * xpm[] )"Constructs an image from \fIxpm,\fR which must be a valid XPM image..PPErrors are silently ignored..SH "QImage::QImage ( int w, int h, int depth, int numColors=0, Endian bitOrder=IgnoreEndian )"Constructs an image with \fIw\fR width, \fIh\fR height, \fIdepth\fR bits per pixel, \fInumColors\fR colors and bit order \fIbitOrder.\fR.PPUsing this constructor is the same as first constructing a null image and then calling the create() function..PPSee also: create()..SH "QImage::QImage ( const QSize &, int depth, int numColors=0, Endian bitOrder=IgnoreEndian )"This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts..SH "QImage::~QImage ()"Destroys the image and cleans up..SH "bool QImage::allGray () const"Returns TRUE if all the colors in the image are shades of gray, that is their R, G, and B components are equal. This function is slow for large 32-bit images..SH "QImage::Endian QImage::bitOrder() const"Returns the bit order for the image..PPIf it is a 1-bpp image, this function returns either QImage::BigEndian or QImage::LittleEndian..PPIf it is not a 1-bpp image, this function returns QImage::IgnoreEndian..PPSee also: depth()..SH "uchar * QImage::bits () const"Returns a pointer to the first pixel data. Equivalent to scanLine(0)..PPSee also: scanLine()..SH "int QImage::bytesPerLine () const"Returns the number of bytes per image scanline. This is equivalent to numBytes()/height()..SH "QRgb QImage::color ( int i ) const"Returns the color in the color table at index \fIi.\fR.PPA color value is an RGB triplet. Use the QRED, QGREEN and QBLUE functions (defined in qcolor.h) to get the color value components..PPSee also: setColor() and QColor..SH "QRgb * QImage::colorTable () const"Returns a pointer to the color table..SH "QImage QImage::convertBitOrder ( Endian bitOrder ) const"Converts the bit order of the image to \fIbitOrder\fR and returns the converted image..PPReturns \fC*this\fR if the \fIbitOrder\fR is equal to the image bit order, or a null image if this image cannot be converted..PPSee also: bitOrder() and setBitOrder()..SH "QImage QImage::convertDepth ( int depth, int conversion_flags ) const"Converts the depth (bpp) of the image to \fIdepth\fR and returns the converted image. The original image is left undisturbed..PPThe \fIdepth\fR argument must be 1, 8 or 32..PPSee QPixmap::convertFromImage for a description of the \fIconversion_flags\fR argument..PPReturns \fC*this\fR if \fIdepth\fR is equal to the image depth, or a null image if this image cannot be converted..PPSee also: depth() and isNull()..SH "QImage QImage::convertDepth ( int depth ) const"This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts..SH "QImage QImage::convertDepthWithPalette ( int d, QRgb * palette, int palette_count, int conversion_flags=0 ) const"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, as it may change in future implementations..PPCurrently inefficient for non 32-bit images..SH "QImage QImage::copy () const"Returns a deep copy of the image..SH "QImage QImage::copy ( int x, int y, int w, int h, int conversion_flags=0 ) const"Returns a deep copy of a sub-area of the image..PPSee also: bitBlt()..SH "QImage QImage::copy ( QRect & r ) const"This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts..SH "bool QImage::create ( int width, int height, int depth, int numColors=0, Endian bitOrder=IgnoreEndian )"Sets the image width, height, depth, number of colors and bit order. Returns TRUE if successful, or FALSE if the parameters are incorrect or if memory cannot be allocated..PPThe \fIwidth\fR and \fIheight\fR is limited to 32767. \fIdepth\fR must be 1, 8 or 32. If \fIdepth\fR is 1, then \fIbitOrder\fR must be set to either QImage::LittleEndian or QImage::BigEndian. For other depths, \fIbitOrder\fR must be QImage::IgnoreEndian..PPThis function allocates a color table and a buffer for the image data. The image data is not initialized..PPThe image buffer is allocated as a single block that consists of a table of scanline pointers (jumpTable()) and the image data (bits())..PPSee also: width(), height(), depth(), numColors(), bitOrder(), jumpTable(), scanLine(), bits(), bytesPerLine() and numBytes()..SH "bool QImage::create ( const QSize &, int depth, int numColors=0, Endian bitOrder=IgnoreEndian )"This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts..SH "QImage QImage::createAlphaMask ( int conversion_flags=0 ) const"Builds and returns a 1-bpp mask from the alpha buffer in this image. Returns a null image if alpha buffer mode is disabled..PPSee QPixmap::convertFromImage for a description of the \fIconversion_flags\fR argument..PPThe returned image has little-endian bit order, which you can convert to big-endianness using convertBitOrder()..SH "QImage QImage::createHeuristicMask ( bool clipTight=TRUE ) const"Creates and returns a 1-bpp heuristic mask for this image. It works by selecting a color from one of the corners, then chipping away pixels of that color, starting at all the edges..PPThe four corners vote over which color is to be masked away. In case of a draw (this generally means that this function is not applicable to the image) the voting results are undocumented..PPThe returned image has little-endian bit order, which you can convert to big-endianness using convertBitOrder()..PPThis function disregards the alpha buffer..SH "int QImage::depth () const"Returns the depth of the image..PPThe image depth is the number of bits used to encode a single pixel, also called bits per pixel (bpp) or bit planes of an image..PPThe supported depths are 1, 8 and 32..SH "void QImage::detach ()"Detaches from shared image data and makes sure that this image is the only one referring the data..PPIf multiple images share common data, this image makes a copy of the data and detaches itself from the sharing mechanism. Nothing is done if there is just a single reference..SH "void QImage::fill ( uint pixel )"Fills the entire image with the pixel value \fIpixel.\fR.PPIf the depth of this image is 1, only the lowest bit is used. If you say fill(0), fill(2) etc., the image is filled with 0s. If you say fill(1), fill(3) etc., the image is filled with 1s. If the depth is 8, the lowest 8 bits are used..PPIf the depth is 32 and the image has no alpha buffer, the \fIpixel\fR value is written to each pixel in the image. If the image has an alpha buffer, only the 24 RGB bits are set and the upper 8 bits (alpha value) are left unchanged..SH "bool QImage::hasAlphaBuffer () const"Returns TRUE if alpha buffer mode is enabled, otherwise FALSE..PPSee also: setAlphaBuffer()..SH "int QImage::height () const"Returns the height of the image..PPSee also: width(), size() and rect()..SH "const char* QImage::imageFormat ( const QString & fileName ) \fC[static]\fR"Returns a string that specifies the image format of the file \fIfileName,\fR or null if the file cannot be read or if the format cannot be recognized..PPThe QImageIO documentation lists the guaranteed supported image formats, or use the QImage::inputFormats() QImage::outputFormats() to get lists that include installed formats..PPSee also: load() and save()..SH "QStrList QImage::inputFormats () \fC[static]\fR"Returns a list of image formats which are supported for image input..SH "void QImage::invertPixels ( bool invertAlpha = TRUE )"Inverts all pixel values in the image..PPFor 32 bit (24 RGB + alpha buffer) images, set \fIinvertAlpha\fR to FALSE if you want the alpha bits to be unchanged, otherwise they are inverted too..SH "bool QImage::isGrayscale () const"Returns TRUE if the image is allGray(), \fIand\fR if the image is 32-bpp or a 256-color 8-bpp image for which color(i) is QRgb(i,i,i)..SH "bool QImage::isNull () const"Returns TRUE if it is a null image..PPA null image has all parameters set to zero and no allocated data..PPExamples:.(lqtimage/qtimage.cpp.)l.SH "uchar ** QImage::jumpTable () const"Returns a pointer to the scanline pointer table..PPThis is the beginning of the data block for the image..SH "bool QImage::load ( const QString & fileName, const char * format=0 )"Loads an image from the file \fIfileName.\fR Returns TRUE if successful, or FALSE if the image could not be loaded..PPIf \fIformat\fR is specified, the loader attempts to read the image using the specified format. If \fIformat\fR is not specified (default), the loader reads a few bytes from the header to guess the file format..PPThe QImageIO documentation lists the supported image formats and explains how to add extra formats..PPSee also: loadFromData(), save(), imageFormat(), QPixmap::load() and QImageIO..SH "bool QImage::loadFromData ( const uchar * buf, uint len, const char * format=0 )"Loads an image from the binary data in \fIbuf\fR (\fIlen\fR bytes). Returns TRUE if successful, or FALSE if the image could not be loaded..PPIf \fIformat\fR is specified, the loader attempts to read the image using the specified format. If \fIformat\fR is not specified (default), the loader reads a few bytes from the header to guess the file format..PPThe QImageIO documentation lists the supported image formats and explains how to add extra formats..PPSee also: load(), save(), imageFormat(), QPixmap::loadFromData() and QImageIO..SH "bool QImage::loadFromData ( QByteArray buf, const char * format=0 )"This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts..PPLoads from a QByteArray..SH "QImage QImage::mirror () const"Returns a QImage which is a vertically mirrored copy of this image. The original QImage is left unchanged..SH "int QImage::numBytes () const"Returns the number of bytes occupied by the image data..PPSee also: bytesPerLine()..SH "int QImage::numColors () const"Returns the size of the color table for the image..PPNotice that numColors() returns 0 for 32-bpp images, since these images do not use color tables, but instead encode pixel values as RGB triplets..SH "bool QImage::operator!= ( const QImage & i ) const"Returns TRUE if this image and \fIi\fR have different contents, and FALSE if they they have the same. This can be slow. Of course, this function returns quickly if e.g. the two images' widths are different..PPSee also: operator=()..SH "QImage & QImage::operator= ( const QPixmap & pixmap )"Sets the image bits to the \fIpixmap\fR contents and returns a reference to the image..PPIf the image shares data with other images, it will first dereference the shared data..PPMakes a call to QPixmap::convertToImage()..SH "QImage & QImage::operator= ( const QImage & image )"Assigns a shallow copy of \fIimage\fR to this image and returns a reference to this image..PPSee also: copy()..SH "bool QImage::operator== ( const QImage & i ) const"Returns TRUE if this image and \fIi\fR have the same contents, and FALSE if they differ. This can be slow. Of course, this function returns quickly if e.g. the two images' widths are different..PPSee also: operator=()..SH "QStrList QImage::outputFormats () \fC[static]\fR"Returns a list of image formats which are supported for image output..SH "QRgb QImage::pixel ( int x, int y ) const"Returns the actual color of the pixel at the given coordinates..PPIf (x,y) is not on the image, the results are undefined..PPExamples:.(lqmag/qmag.cpp.)l.SH "int QImage::pixelIndex ( int x, int y ) const"Returns the pixel index at the given coordinates..PPIf (x,y) is not valid, or if the image is not a paletted image (depth() > 8), the results are undefined..SH "QRect QImage::rect () const"Returns the enclosing rectangle (0,0,width(),height()) of the image..PPSee also: width(), height() and size()..SH "void QImage::reset ()"Resets all image parameters and deallocates the image data..PPExamples:.(lqtimage/qtimage.cpp.)l.SH "bool QImage::save ( const QString & fileName, const char * format ) const"Saves the image to the file \fIfileName,\fR using the image file format \fIformat.\fR Returns TRUE if successful, or FALSE if the image could not be saved..PPSee also: load(), loadFromData(), imageFormat(), QPixmap::save() and QImageIO..SH "uchar * QImage::scanLine ( int i ) const"Returns a pointer to the pixel data at the \fIi'th\fR scanline..PPThe scanline data is aligned on a 32-bit boundary..PP\fBWarning:\fR If you are accessing 32-bpp image data, cast the returned pointer to \fCQRgb*\fR (QRgb has a 32 bit size) and use it to read/write the pixel value. You cannot use the \fCuchar*\fR pointer directly, because the pixel format depends on the byte order on the underlying platform. Hint: use qRed() and friends (qcolor.h) to access the pixels..PPSee also: bits()..PPExamples:.(ldesktop/desktop.cpp.)l.SH "void QImage::setAlphaBuffer ( bool enable )"Enables alpha buffer mode if \fIenable\fR is TRUE, otherwise disables it. The default setting is disabled..PPAn 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..PPThis 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..PPThe 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..PPThe alpha buffer is used to set a mask when a QImage is translated to a QPixmap..PPSee also: hasAlphaBuffer() and createAlphaMask()..SH "void QImage::setColor ( int i, QRgb c )"Sets a color in the color table at index \fIi\fR to \fIc.\fR.PPA color value is an RGB triplet. Use the qRgb function (defined in qcolor.h) to make RGB triplets..PPSee also: color()..PPExamples:.(ldesktop/desktop.cpp.)l.SH "void QImage::setNumColors ( int numColors )"Resizes the color table to \fInumColors\fR colors..PPIf the color table is expanded, then all new colors will be set to black (RGB 0,0,0)..PPSee also: color() and setColor()..SH "void QImage::setPixel ( int x, int y, uint index_or_rgb )"Sets the pixel index or color at the given coordinates..PPIf (x,y) is not valid, or if the image is a paletted image (depth() <= 8) and \fIindex_or_rgb\fR >= numColors(), the results are undefined..SH "QSize QImage::size () const"Returns the size of the image..PPSee also: width(), height() and rect()..SH "QImage QImage::smoothScale ( int width, int height ) const"Returns a copy of the image smoothly scaled to \fIwidth\fR by \fIheight\fR pixels. For 32-bpp images, and 1-bpp/8-bpp color images, the result will be 32-bpp, while all-gray images (including black-and-white 1-bpp) will produce 8-bit grayscale images with the palette spanning 256 grays from black to white..PPThis function uses code based on:.PPpnmscale.c - read a portable anymap and scale it.PPCopyright (C) 1989, 1991 by Jef Poskanzer..PPPermission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. This software is provided "as is" without express or implied warranty..SH "QImage QImage::swapRGB () const"Returns a QImage where the values of the red and blue components of all pixels have been swapped, effectively converting a RGB image to a BGR image. The original QImage is left unchanged..SH "QImage::Endian QImage::systemBitOrder() \fC[static]\fR"Determines the bit order of the display hardware. Returns QImage::LittleEndian (LSB first) or QImage::BigEndian (MSB first)..SH "QImage::Endian QImage::systemByteOrder() \fC[static]\fR"Determines the host computer byte order. Returns QImage::LittleEndian (LSB first) or QImage::BigEndian (MSB first)..SH "bool QImage::valid ( int x, int y ) const"Tests if the ( \fIx, y\fR ) is a valid coordinate in the image..PPExamples:.(lqmag/qmag.cpp.)l.SH "int QImage::width () const"Returns the width of the image..PPSee also: height(), size() and rect()..SH RELATED FUNCTION DOCUMENTATION.SH "QDataStream & operator<< (QDataStream & s, const QImage & image)"Writes an image to the stream as a PNG image..PPSee also: QImage::save()..SH "QDataStream & operator>> (QDataStream & s, QImage & image)"Reads an image from the stream..PPSee also:  QImage::load()..SH "SEE ALSO".BR http://www.troll.no/qt/qimage.html.SH COPYRIGHTCopyright 1992-1999 Troll Tech AS.  See the license file included inthe distribution for a complete license statement..SH AUTHORGenerated automatically from the source code.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -