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

📄 qimageio.3qt

📁 Linux下的基于X11的图形开发环境。
💻 3QT
字号:
'\" t.TH QImageIO 3qt "9 December 2002" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQImageIO \- Parameters for loading and saving images.SH SYNOPSIS\fC#include <qimage.h>\fR.PP.SS "Public Members".in +1c.ti -1c.BI "\fBQImageIO\fR ()".br.ti -1c.BI "\fBQImageIO\fR ( QIODevice * ioDevice, const char * format )".br.ti -1c.BI "\fBQImageIO\fR ( const QString & fileName, const char * format )".br.ti -1c.BI "\fB~QImageIO\fR ()".br.ti -1c.BI "const QImage & \fBimage\fR () const".br.ti -1c.BI "int \fBstatus\fR () const".br.ti -1c.BI "const char * \fBformat\fR () const".br.ti -1c.BI "QIODevice * \fBioDevice\fR () const".br.ti -1c.BI "QString \fBfileName\fR () const".br.ti -1c.BI "int \fBquality\fR () const".br.ti -1c.BI "QString \fBdescription\fR () const".br.ti -1c.BI "const char * \fBparameters\fR () const".br.ti -1c.BI "float \fBgamma\fR () const".br.ti -1c.BI "void \fBsetImage\fR ( const QImage & image )".br.ti -1c.BI "void \fBsetStatus\fR ( int status )".br.ti -1c.BI "void \fBsetFormat\fR ( const char * format )".br.ti -1c.BI "void \fBsetIODevice\fR ( QIODevice * ioDevice )".br.ti -1c.BI "void \fBsetFileName\fR ( const QString & fileName )".br.ti -1c.BI "void \fBsetQuality\fR ( int q )".br.ti -1c.BI "void \fBsetDescription\fR ( const QString & description )".br.ti -1c.BI "void \fBsetParameters\fR ( const char * parameters )".br.ti -1c.BI "void \fBsetGamma\fR ( float gamma )".br.ti -1c.BI "bool \fBread\fR ()".br.ti -1c.BI "bool \fBwrite\fR ()".br.in -1c.SS "Static Public Members".in +1c.ti -1c.BI "const char * \fBimageFormat\fR ( const QString & fileName )".br.ti -1c.BI "const char * \fBimageFormat\fR ( QIODevice * d )".br.ti -1c.BI "QStrList \fBinputFormats\fR ()".br.ti -1c.BI "QStrList \fBoutputFormats\fR ()".br.ti -1c.BI "void \fBdefineIOHandler\fR ( const char * format, const char * header, const char * flags, image_io_handler readImage, image_io_handler writeImage )".br.in -1c.SH DESCRIPTIONThe QImageIO class contains parameters for loading and saving images..PPQImageIO contains a QIODevice object that is used for image data I/O. The programmer can install new image file formats in addition to those that Qt provides..PPQt currently supports the following image file formats: PNG, BMP, XBM, XPM and PNM. It may also support JPEG, MNG and GIF, if specially configured during compilation. The different PNM formats are: PBM (P1 or P4), PGM (P2 or P5), and PPM (P3 or P6)..PPYou don't normally need to use this class; QPixmap::load(), QPixmap::save(), and QImage contain sufficient functionality..PPFor image files that contain sequences of images, only the first is read. See QMovie for loading multiple images..PPPBM, PGM, and PPM format \fIoutput\fR is always in the more condensed raw format. PPM and PGM files with more than 256 levels of intensity are scaled down when reading..PP\fBWarning:\fR If you are in a country which recognizes software patents and in which Unisys holds a patent on LZW compression and/or decompression and you want to use GIF, Unisys may require you to license the technology. Such countries include Canada, Japan, the USA, France, Germany, Italy and the UK..PPGIF support may be removed completely in a future version of Qt. We recommend using the PNG format..PPSee also QImage, QPixmap, QFile, QMovie, Graphics Classes, Image Processing Classes, and Input/Output and Networking..SH MEMBER FUNCTION DOCUMENTATION.SH "QImageIO::QImageIO ()"Constructs a QImageIO object with all parameters set to zero..SH "QImageIO::QImageIO ( QIODevice * ioDevice, const char * format )"Constructs a QImageIO object with the I/O device \fIioDevice\fR and a \fIformat\fR tag..SH "QImageIO::QImageIO ( const QString & fileName, const char * format )"Constructs a QImageIO object with the file name \fIfileName\fR and a \fIformat\fR tag..SH "QImageIO::~QImageIO ()"Destroys the object and all related data..SH "void QImageIO::defineIOHandler ( const char * format, const char * header, const char * flags, image_io_handler readImage, image_io_handler writeImage )\fC [static]\fR"Defines an image I/O handler for the image format called \fIformat\fR, which is recognized using the regular expression \fIheader\fR, read using \fIreadImage\fR and written using \fIwriteImage\fR..PP\fIflags\fR is a string of single-character flags for this format. The only flag defined currently is T (upper case), so the only legal value for \fIflags\fR are "T" and the empty string. The "T" flag means that the image file is a text file, and Qt should treat all newline conventions as equivalent. (XPM files and some PPM files are text files for example.).PP\fIformat\fR is used to select a handler to write a QImage; \fIheader\fR is used to select a handler to read an image file..PPIf \fIreadImage\fR is a null pointer, the QImageIO will not be able to read images in \fIformat\fR. If \fIwriteImage\fR is a null pointer, the QImageIO will not be able to write images in \fIformat\fR. If both are null, the QImageIO object is valid but useless..PPExample:.PP.nf.br        void readGIF( QImageIO *image ).br        {.br        // read the image using the image->ioDevice().br        }.br.br        void writeGIF( QImageIO *image ).br        {.br        // write the image using the image->ioDevice().br        }.br.br        // add the GIF image handler.br.br        QImageIO::defineIOHandler( "GIF",.br                                   "^GIF[0-9][0-9][a-z]",.br                                   0,.br                                   readGIF,.br                                   writeGIF );.br.fi.PPBefore the regex test, all the 0 bytes in the file header are converted to 1 bytes. This is done because when Qt was ASCII-based, QRegExp could not handle 0 bytes in strings..PP(Note that if one handlerIO supports writing a format and another supports reading it, Qt supports both reading and writing. If two handlers support the same operation, Qt chooses one arbitrarily.).SH "QString QImageIO::description () const"Returns the image description string..PPSee also setDescription()..SH "QString QImageIO::fileName () const"Returns the file name currently set..PPSee also setFileName()..SH "const char * QImageIO::format () const"Returns the image format string or 0 if no format has been explicitly set..SH "float QImageIO::gamma () const"Returns the gamma value at which the image will be viewed..PPSee also setGamma()..SH "const QImage & QImageIO::image () const"Returns the image currently set..PPSee also setImage()..SH "const char * QImageIO::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 is not recognized..SH "const char * QImageIO::imageFormat ( QIODevice * d )\fC [static]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPReturns a string that specifies the image format of the image read from IO device \fId\fR, or 0 if the device cannot be read or if the format is not recognized..PPMake sure that \fId\fR is at the right position in the device (for example, at the beginning of the file)..PPSee also QIODevice::at()..SH "QStrList QImageIO::inputFormats ()\fC [static]\fR"Returns a sorted list of image formats that are supported for image input..SH "QIODevice * QImageIO::ioDevice () const"Returns the IO device currently set..PPSee also setIODevice()..SH "QStrList QImageIO::outputFormats ()\fC [static]\fR"Returns a sorted list of image formats that are supported for image output..PPExample: scribble/scribble.cpp..SH "const char * QImageIO::parameters () const"Returns the image's parameters string..PPSee also setParameters()..SH "int QImageIO::quality () const"Returns the quality of the written image, related to the compression ratio..PPSee also setQuality() and QImage::save()..SH "bool QImageIO::read ()"Reads an image into memory and returns TRUE if the image was successfully read; otherwise returns FALSE..PPBefore reading an image you must set an IO device or a file name. If both an IO device and a file name have been set, the IO device will be used..PPSetting the image file format string is optional..PPNote that this function does \fInot\fR set the format used to read the image. If you need that information, use the imageFormat() static functions..PPExample:.PP.nf.br        QImageIO iio;.br        QPixmap  pixmap;.br        iio.setFileName( "vegeburger.bmp" );.br        if ( image.read() )        // ok.br            pixmap = iio.image();  // convert to pixmap.br.fi.PPSee also setIODevice(), setFileName(), setFormat(), write(), and QPixmap::load()..SH "void QImageIO::setDescription ( const QString & description )"Sets the image description string for image handlers that support image descriptions to \fIdescription\fR..PPCurrently, no image format supported by Qt uses the description string..SH "void QImageIO::setFileName ( const QString & fileName )"Sets the name of the file to read or write an image from to \fIfileName\fR..PPSee also setIODevice()..SH "void QImageIO::setFormat ( const char * format )"Sets the image format to \fIformat\fR for the image to be read or written..PPIt is necessary to specify a format before writing an image, but it is not necessary to specify a format before reading an image..PPIf no format has been set, Qt guesses the image format before reading it. If a format is set the image will only be read if it has that format..PPSee also read(), write(), and format()..SH "void QImageIO::setGamma ( float gamma )"Sets the gamma value at which the image will be viewed to \fIgamma\fR. If the image format stores a gamma value for which the image is intended to be used, then this setting will be used to modify the image. Setting to 0.0 will disable gamma correction (i.e. any specification in the file will be ignored)..PPThe default value is 0.0..PPSee also gamma()..SH "void QImageIO::setIODevice ( QIODevice * ioDevice )"Sets the IO device to be used for reading or writing an image..PPSetting the IO device allows images to be read/written to any block-oriented QIODevice..PPIf \fIioDevice\fR is not null, this IO device will override file name settings..PPSee also setFileName()..SH "void QImageIO::setImage ( const QImage & image )"Sets the image to \fIimage\fR..PPSee also image()..SH "void QImageIO::setParameters ( const char * parameters )"Sets the image's parameter string to \fIparameters\fR. This is for image handlers that require special parameters..PPAlthough the current image formats supported by Qt ignore the parameters string, it may be used in future extensions or by contributions (for example, JPEG)..PPSee also parameters()..SH "void QImageIO::setQuality ( int q )"Sets the quality of the written image to \fIq\fR, related to the compression ratio..PP\fIq\fR must be in the range -1..100. Specify 0 to obtain small compressed files, 100 for large uncompressed files. (-1 signifies the default compression.).PPSee also quality() and QImage::save()..SH "void QImageIO::setStatus ( int status )"Sets the image IO status to \fIstatus\fR. A non-zero value indicates an error, whereas 0 means that the IO operation was successful..PPSee also status()..SH "int QImageIO::status () const"Returns the image's IO status. A non-zero value indicates an error, whereas 0 means that the IO operation was successful..PPSee also setStatus()..SH "bool QImageIO::write ()"Writes an image to an IO device and returns TRUE if the image was successfully written; otherwise returns FALSE..PPBefore writing an image you must set an IO device or a file name. If both an IO device and a file name have been set, the IO device will be used..PPThe image will be written using the specified image format..PPExample:.PP.nf.br        QImageIO iio;.br        QImage   im;.br        im = pixmap; // convert to image.br        iio.setImage( im );.br        iio.setFileName( "vegeburger.bmp" );.br        iio.setFormat( "BMP" );.br        if ( iio.write() ).br            // returned TRUE if written successfully.br.fi.PPSee also setIODevice(), setFileName(), setFormat(), read(), and QPixmap::save()..SH "SEE ALSO".BR http://doc.trolltech.com/qimageio.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports help us to help you. Thank you..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qimageio.3qt) and the Qtversion (3.1.1).

⌨️ 快捷键说明

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