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

📄 qimage.3qt

📁 tmark1.11:用于生成QT/EMBEDDED应用工程的Markfile文件
💻 3QT
📖 第 1 页 / 共 2 页
字号:
.TH QImage 3qt "6 July 1999" "Troll Tech AS" \" -*- nroff -*-.\" Copyright 1992-1999 Troll Tech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQImage \- Hardware-independent pixmap representation with direct access to the pixel data.SH SYNOPSIS.br.PP\fC#include <qimage.h>\fR.PP.SS "Public Members".in +1c.ti -1c.BI "enum \fBEndian\fR { IgnoreEndian, BigEndian, LittleEndian }".br.ti -1c.BI "\fBQImage\fR ()".br.ti -1c.BI "\fBQImage\fR ( int " "width" ", int " "height" ", int " "depth" ", int " "numColors" "=0, Endian " "bitOrder" "=IgnoreEndian )".br.ti -1c.BI "\fBQImage\fR ( const QSize &, int " "depth" ", int " "numColors" "=0, Endian " "bitOrder" "=IgnoreEndian )".br.ti -1c.BI "\fBQImage\fR ( const QString & " "fileName" ", const char * " "format" "=0 )".br.ti -1c.BI "\fBQImage\fR ( const char * xpm[] )".br.ti -1c.BI "\fBQImage\fR ( const QByteArray & data )".br.ti -1c.BI "\fBQImage\fR ( const QImage & )".br.ti -1c.BI "\fB~QImage\fR ()".br.ti -1c.BI "QImage& \fBoperator=\fR ( const QImage & )".br.ti -1c.BI "QImage& \fBoperator=\fR ( const QPixmap & )".br.ti -1c.BI "bool \fBoperator==\fR ( const QImage & ) const".br.ti -1c.BI "bool \fBoperator!=\fR ( const QImage & ) const".br.ti -1c.BI "void \fBdetach\fR ()".br.ti -1c.BI "QImage \fBcopy\fR () const".br.ti -1c.BI "QImage \fBcopy\fR ( int " "x" ", int " "y" ", int " "w" ", int " "h" ", int " "conversion_flags" "=0 ) const".br.ti -1c.BI "QImage \fBcopy\fR ( QRect & ) const".br.ti -1c.BI "bool \fBisNull\fR () const".br.ti -1c.BI "int \fBwidth\fR () const".br.ti -1c.BI "int \fBheight\fR () const".br.ti -1c.BI "QSize \fBsize\fR () const".br.ti -1c.BI "QRect \fBrect\fR () const".br.ti -1c.BI "int \fBdepth\fR () const".br.ti -1c.BI "int \fBnumColors\fR () const".br.ti -1c.BI "Endian \fBbitOrder\fR () const".br.ti -1c.BI "QRgb \fBcolor\fR ( int i ) const".br.ti -1c.BI "void \fBsetColor\fR ( int " "i" ", QRgb c )".br.ti -1c.BI "void \fBsetNumColors\fR ( int )".br.ti -1c.BI "bool \fBhasAlphaBuffer\fR () const".br.ti -1c.BI "void \fBsetAlphaBuffer\fR ( bool )".br.ti -1c.BI "bool \fBallGray\fR () const".br.ti -1c.BI "bool \fBisGrayscale\fR () const".br.ti -1c.BI "uchar* \fBbits\fR () const".br.ti -1c.BI "uchar* \fBscanLine\fR ( int ) const".br.ti -1c.BI "uchar** \fBjumpTable\fR () const".br.ti -1c.BI "QRgb* \fBcolorTable\fR () const".br.ti -1c.BI "int \fBnumBytes\fR () const".br.ti -1c.BI "int \fBbytesPerLine\fR () const".br.ti -1c.BI "bool \fBcreate\fR ( int " "width" ", int " "height" ", int " "depth" ", int " "numColors" "=0, Endian " "bitOrder" "=IgnoreEndian )".br.ti -1c.BI "bool \fBcreate\fR ( const QSize &, int " "depth" ", int " "numColors" "=0, Endian " "bitOrder" "=IgnoreEndian )".br.ti -1c.BI "void \fBreset\fR ()".br.ti -1c.BI "void \fBfill\fR ( uint pixel )".br.ti -1c.BI "void \fBinvertPixels\fR ( bool " "invertAlpha" " = TRUE )".br.ti -1c.BI "QImage \fBconvertDepth\fR ( int ) const".br.ti -1c.BI "QImage \fBconvertDepthWithPalette\fR ( int, QRgb * " "p" ", int " "pc" ", int " "cf" "=0 ) const".br.ti -1c.BI "QImage \fBconvertDepth\fR ( int, int conversion_flags ) const".br.ti -1c.BI "QImage \fBconvertBitOrder\fR ( Endian ) const".br.ti -1c.BI "QImage \fBsmoothScale\fR ( int " "width" ", int height ) const".br.ti -1c.BI "QImage \fBcreateAlphaMask\fR ( int " "conversion_flags" "=0 ) const".br.ti -1c.BI "QImage \fBcreateHeuristicMask\fR ( bool " "clipTight" "=TRUE ) const".br.ti -1c.BI "QImage \fBmirror\fR () const".br.ti -1c.BI "QImage \fBswapRGB\fR () const".br.ti -1c.BI "bool \fBload\fR ( const QString & " "fileName" ", const char * " "format" "=0 )".br.ti -1c.BI "bool \fBloadFromData\fR ( const uchar * " "buf" ", uint " "len" ", const char * " "format" "=0 )".br.ti -1c.BI "bool \fBloadFromData\fR ( QByteArray " "data" ", const char * " "format" "=0 )".br.ti -1c.BI "bool \fBsave\fR ( const QString & " "fileName" ", const char * format ) const".br.ti -1c.BI "bool \fBvalid\fR ( int " "x" ", int y ) const".br.ti -1c.BI "int \fBpixelIndex\fR ( int " "x" ", int y ) const".br.ti -1c.BI "QRgb \fBpixel\fR ( int " "x" ", int y ) const".br.ti -1c.BI "void \fBsetPixel\fR ( int " "x" ", int " "y" ", uint index_or_rgb )".br.in -1c.SS "Static Public Members".in +1c.ti -1c.BI "Endian \fBsystemBitOrder\fR ()".br.ti -1c.BI "Endian \fBsystemByteOrder\fR ()".br.ti -1c.BI "const char* \fBimageFormat\fR ( const QString & fileName )".br.ti -1c.BI "QStrList \fBinputFormats\fR ()".br.ti -1c.BI "QStrList \fBoutputFormats\fR ()".br.in -1c.SH RELATED FUNCTION DOCUMENTATION(Note that these are not member functions.).in +1c.ti -1c.BI "QDataStream & \fBoperator<<\fR (QDataStream & " "s" ", const QImage & " "image" ")".br.ti -1c.BI "QDataStream & \fBoperator>>\fR (QDataStream & " "s" ", QImage & " "image" ")".br.in -1c.SH DESCRIPTIONThe QImage class provides a hardware-independent pixmap representation with direct access to the pixel data..PPIt is one of the two classes Qt provides for dealing with images, the other being QPixmap. QImage is designed and optimized for I/O and for direct pixel access/manipulation, QPixmap is designed and optimized for drawing. There are (slow) functions to convert between QImage and QPixmp; QPixmap::convertToImage() and QPixmap::convertFromImage()..PPAn image has the parameters width, height and depth (bits per pixel, bpp), a color table and the actual pixels. QImage supports 1-bpp, 8-bpp and 32-bpp image data. 1-bpp and 8-bpp images use a color lookup table; the pixel value is a color table index..PP32-bpp images encode an RGB value in 24 bits and ignore the color table. The most significant byte is used for the alpha buffer..PPAn entry in the color table is an RGB triplet encoded as \fCuint.\fR Use the qRed, qGreen and qBlue functions (qcolor.h) to access the components, and qRgb to make an RGB triplet (see the QColor class documentation)..PP1-bpp (monochrome) images have a color table with maximum 2 colors. There are two different formats; big endian (MSB first) or little endian (LSB first) bit order. To access a single bit, you will have to do some bitshifts:.PP.nf.br    QImage image;.br      // sets bit at (x,y) to 1.br    if ( image.bitOrder() == QImage::LittleEndian ).br        *(image.scanLine(y) + (x >> 3)) |= 1 << (x & 7);.br    else.br        *(image.scanLine(y) + (x >> 3)) |= 1 << (7 -(x & 7));.fi.PPIf this looks complicated, it might be a good idea to convert the 1-bpp image to an 8-bpp image using convertDepth()..PP8-bpp images are much easier to work with than 1-bpp images because they have a single byte per pixel:.PP.nf.br    QImage image;.br      // set entry 19 in the color table to yellow.br    image.setColor( 19, qRgb(255,255,0) );.br      // set 8 bit pixel at (x,y) to value yellow (in color table).br    *(image.scanLine(y) + x) = 19;.fi.PP32-bpp images ignore the color table, instead each pixel contains the RGB triplet. 24 bits contain the RGB value and the most significant byte is reserved for the alpha buffer..PP.nf.br    QImage image;.br      // sets 32 bit pixel at (x,y) to yellow..br    uint *p = (uint *)image.scanLine(y) + x;.br    *p = qRgb(255,255,0);.fi.PPThe scanlines are 32-bit aligned for all depths..PPThe QImage class uses explicit sharing, similar to that of QArray and QString..PPSee also: QImageIO, QPixmap and Shared Classes.PPExamples:.(lqtimage/qtimage.cpp qmag/qmag.cpp desktop/desktop.cpp.)l.SS "Member Type Documentation".SH "QImage::Endian"This enum type is used to describe the endianness of the CPU and graphics hardware..PPThe current values are: .IP.TP\fCIgnoreEndian\fR - does not matter. Useful for some operations that are independent of endianness.IP.TP\fCBigEndian\fR - network byte order, like on SPARC and Motorola CPUs..IP.TP\fCLittleEndian\fR - PC/Alpha byte order..IP.SH MEMBER FUNCTION DOCUMENTATION.SH "<a name="76f2f1">QImage::QImage ()"Constructs a null image..PPSee also: isNull()..SH "QImage::QImage ( const QString & fileName, const char * format=0 )"Constructs an image from loading \fIfileName\fR and an optional \fIformat.\fR.PPSee also: load()..SH "QImage::QImage ( const QByteArray & array )"Constructs an image from \fIarray,\fR which must be in a supported image format image..PP

⌨️ 快捷键说明

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