/usr/share/qt3/doc/html/qimageio.html is in qt3-doc 3:3.3.8-b-8ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qimage.cpp:3715 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>QImageIO Class</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
<a href="index.html">
<font color="#004faf">Home</font></a>
| <a href="classes.html">
<font color="#004faf">All Classes</font></a>
| <a href="mainclasses.html">
<font color="#004faf">Main Classes</font></a>
| <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
| <a href="groups.html">
<font color="#004faf">Grouped Classes</font></a>
| <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QImageIO Class Reference</h1>
<p>The QImageIO class contains parameters for loading and
saving images.
<a href="#details">More...</a>
<p><tt>#include <<a href="qimage-h.html">qimage.h</a>></tt>
<p><a href="qimageio-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn><a href="#QImageIO"><b>QImageIO</b></a> ()</li>
<li class=fn><a href="#QImageIO-2"><b>QImageIO</b></a> ( QIODevice * ioDevice, const char * format )</li>
<li class=fn><a href="#QImageIO-3"><b>QImageIO</b></a> ( const QString & fileName, const char * format )</li>
<li class=fn><a href="#~QImageIO"><b>~QImageIO</b></a> ()</li>
<li class=fn>const QImage & <a href="#image"><b>image</b></a> () const</li>
<li class=fn>int <a href="#status"><b>status</b></a> () const</li>
<li class=fn>const char * <a href="#format"><b>format</b></a> () const</li>
<li class=fn>QIODevice * <a href="#ioDevice"><b>ioDevice</b></a> () const</li>
<li class=fn>QString <a href="#fileName"><b>fileName</b></a> () const</li>
<li class=fn>int <a href="#quality"><b>quality</b></a> () const</li>
<li class=fn>QString <a href="#description"><b>description</b></a> () const</li>
<li class=fn>const char * <a href="#parameters"><b>parameters</b></a> () const</li>
<li class=fn>float <a href="#gamma"><b>gamma</b></a> () const</li>
<li class=fn>void <a href="#setImage"><b>setImage</b></a> ( const QImage & image )</li>
<li class=fn>void <a href="#setStatus"><b>setStatus</b></a> ( int status )</li>
<li class=fn>void <a href="#setFormat"><b>setFormat</b></a> ( const char * format )</li>
<li class=fn>void <a href="#setIODevice"><b>setIODevice</b></a> ( QIODevice * ioDevice )</li>
<li class=fn>void <a href="#setFileName"><b>setFileName</b></a> ( const QString & fileName )</li>
<li class=fn>void <a href="#setQuality"><b>setQuality</b></a> ( int q )</li>
<li class=fn>void <a href="#setDescription"><b>setDescription</b></a> ( const QString & description )</li>
<li class=fn>void <a href="#setParameters"><b>setParameters</b></a> ( const char * parameters )</li>
<li class=fn>void <a href="#setGamma"><b>setGamma</b></a> ( float gamma )</li>
<li class=fn>bool <a href="#read"><b>read</b></a> ()</li>
<li class=fn>bool <a href="#write"><b>write</b></a> ()</li>
</ul>
<h2>Static Public Members</h2>
<ul>
<li class=fn>const char * <a href="#imageFormat"><b>imageFormat</b></a> ( const QString & fileName )</li>
<li class=fn>const char * <a href="#imageFormat-2"><b>imageFormat</b></a> ( QIODevice * d )</li>
<li class=fn>QStrList <a href="#inputFormats"><b>inputFormats</b></a> ()</li>
<li class=fn>QStrList <a href="#outputFormats"><b>outputFormats</b></a> ()</li>
<li class=fn>void <a href="#defineIOHandler"><b>defineIOHandler</b></a> ( const char * format, const char * header, const char * flags, image_io_handler readImage, image_io_handler writeImage )</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>
<p> The QImageIO class contains parameters for loading and
saving images.
<p>
<p> QImageIO contains a <a href="qiodevice.html">QIODevice</a> object that is used for image data
I/O. The programmer can install new image file formats in addition
to those that Qt provides.
<p> Qt 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).
<p> You don't normally need to use this class; <a href="qpixmap.html#load">QPixmap::load</a>(),
<a href="qpixmap.html#save">QPixmap::save</a>(), and <a href="qimage.html">QImage</a> contain sufficient functionality.
<p> For image files that contain sequences of images, only the first
is read. See <a href="qmovie.html">QMovie</a> for loading multiple images.
<p> PBM, PGM, and PPM format <em>output</em> is always in the more condensed
raw format. PPM and PGM files with more than 256 levels of
intensity are scaled down when reading.
<p> <b>Warning:</b> 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.
<p> GIF support may be removed completely in a future version of Qt.
We recommend using the PNG format.
<p> <p>See also <a href="qimage.html">QImage</a>, <a href="qpixmap.html">QPixmap</a>, <a href="qfile.html">QFile</a>, <a href="qmovie.html">QMovie</a>, <a href="graphics.html">Graphics Classes</a>, <a href="images.html">Image Processing Classes</a>, and <a href="io.html">Input/Output and Networking</a>.
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="QImageIO"></a>QImageIO::QImageIO ()
</h3>
Constructs a QImageIO object with all parameters set to zero.
<h3 class=fn><a name="QImageIO-2"></a>QImageIO::QImageIO ( <a href="qiodevice.html">QIODevice</a> * ioDevice, const char * format )
</h3>
Constructs a QImageIO object with the I/O device <em>ioDevice</em> and a
<em>format</em> tag.
<h3 class=fn><a name="QImageIO-3"></a>QImageIO::QImageIO ( const <a href="qstring.html">QString</a> & fileName, const char * format )
</h3>
Constructs a QImageIO object with the file name <em>fileName</em> and a
<em>format</em> tag.
<h3 class=fn><a name="~QImageIO"></a>QImageIO::~QImageIO ()
</h3>
Destroys the object and all related data.
<h3 class=fn>void <a name="defineIOHandler"></a>QImageIO::defineIOHandler ( const char * format, const char * header, const char * flags, image_io_handler readImage, image_io_handler writeImage )<tt> [static]</tt>
</h3>
Defines an image I/O handler for the image format called <em>format</em>, which is recognized using the <a href="qregexp.html#details">regular expression</a> <em>header</em>, read using <em>readImage</em> and
written using <em>writeImage</em>.
<p> <em>flags</em> 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 <em>flags</em> 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.)
<p> <em>format</em> is used to select a handler to write a <a href="qimage.html">QImage</a>; <em>header</em>
is used to select a handler to read an image file.
<p> If <em>readImage</em> is a null pointer, the QImageIO will not be able
to read images in <em>format</em>. If <em>writeImage</em> is a null pointer,
the QImageIO will not be able to write images in <em>format</em>. If
both are null, the QImageIO object is valid but useless.
<p> Example:
<pre>
void readGIF( QImageIO *image )
{
// read the image using the image-><a href="#ioDevice">ioDevice</a>()
}
void writeGIF( QImageIO *image )
{
// write the image using the image-><a href="#ioDevice">ioDevice</a>()
}
// add the GIF image handler
QImageIO::<a href="#defineIOHandler">defineIOHandler</a>( "GIF",
"^GIF[0-9][0-9][a-z]",
0,
readGIF,
writeGIF );
</pre>
<p> Before 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, <a href="qregexp.html">QRegExp</a> could not handle 0 bytes in strings.
<p> The regexp is only applied on the first 14 bytes of the file.
<p> Note that Qt assumes that there is only one handler per format; if
two handlers support the same format, Qt will choose one
arbitrarily. It is not possible to have one handler support
reading, and another support writing.
<h3 class=fn><a href="qstring.html">QString</a> <a name="description"></a>QImageIO::description () const
</h3>
<p> Returns the image description string.
<p> <p>See also <a href="#setDescription">setDescription</a>().
<h3 class=fn><a href="qstring.html">QString</a> <a name="fileName"></a>QImageIO::fileName () const
</h3>
<p> Returns the file name currently set.
<p> <p>See also <a href="#setFileName">setFileName</a>().
<h3 class=fn>const char * <a name="format"></a>QImageIO::format () const
</h3>
<p> Returns the image format string or 0 if no format has been
explicitly set.
<h3 class=fn>float <a name="gamma"></a>QImageIO::gamma () const
</h3>
Returns the gamma value at which the image will be viewed.
<p> <p>See also <a href="#setGamma">setGamma</a>().
<h3 class=fn>const <a href="qimage.html">QImage</a> & <a name="image"></a>QImageIO::image () const
</h3>
<p> Returns the image currently set.
<p> <p>See also <a href="#setImage">setImage</a>().
<h3 class=fn>const char * <a name="imageFormat"></a>QImageIO::imageFormat ( const <a href="qstring.html">QString</a> & fileName )<tt> [static]</tt>
</h3>
Returns a string that specifies the image format of the file <em>fileName</em>, or null if the file cannot be read or if the format is
not recognized.
<h3 class=fn>const char * <a name="imageFormat-2"></a>QImageIO::imageFormat ( <a href="qiodevice.html">QIODevice</a> * d )<tt> [static]</tt>
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Returns a string that specifies the image format of the image read
from IO device <em>d</em>, or 0 if the device cannot be read or if the
format is not recognized.
<p> Make sure that <em>d</em> is at the right position in the device (for
example, at the beginning of the file).
<p> <p>See also <a href="qiodevice.html#at">QIODevice::at</a>().
<h3 class=fn><a href="qstrlist.html">QStrList</a> <a name="inputFormats"></a>QImageIO::inputFormats ()<tt> [static]</tt>
</h3>
Returns a sorted list of image formats that are supported for
image input.
<h3 class=fn><a href="qiodevice.html">QIODevice</a> * <a name="ioDevice"></a>QImageIO::ioDevice () const
</h3>
<p> Returns the IO device currently set.
<p> <p>See also <a href="#setIODevice">setIODevice</a>().
<h3 class=fn><a href="qstrlist.html">QStrList</a> <a name="outputFormats"></a>QImageIO::outputFormats ()<tt> [static]</tt>
</h3>
Returns a sorted list of image formats that are supported for
image output.
<p>Example: <a href="scribble-example.html#x911">scribble/scribble.cpp</a>.
<h3 class=fn>const char * <a name="parameters"></a>QImageIO::parameters () const
</h3>
Returns the image's parameters string.
<p> <p>See also <a href="#setParameters">setParameters</a>().
<h3 class=fn>int <a name="quality"></a>QImageIO::quality () const
</h3>
Returns the quality of the written image, related to the
compression ratio.
<p> <p>See also <a href="#setQuality">setQuality</a>() and <a href="qimage.html#save">QImage::save</a>().
<h3 class=fn>bool <a name="read"></a>QImageIO::read ()
</h3>
Reads an image into memory and returns TRUE if the image was
successfully read; otherwise returns FALSE.
<p> Before 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.
<p> Setting the image file format string is optional.
<p> Note that this function does <em>not</em> set the <a href="#format">format</a> used to read the image. If you need that
information, use the <a href="#imageFormat">imageFormat</a>() static functions.
<p> Example:
<p> <pre>
QImageIO iio;
<a href="qpixmap.html">QPixmap</a> pixmap;
iio.<a href="#setFileName">setFileName</a>( "vegeburger.bmp" );
if ( image.read() ) // ok
pixmap = iio.<a href="#image">image</a>(); // convert to pixmap
</pre>
<p> <p>See also <a href="#setIODevice">setIODevice</a>(), <a href="#setFileName">setFileName</a>(), <a href="#setFormat">setFormat</a>(), <a href="#write">write</a>(), and <a href="qpixmap.html#load">QPixmap::load</a>().
<h3 class=fn>void <a name="setDescription"></a>QImageIO::setDescription ( const <a href="qstring.html">QString</a> & description )
</h3>
Sets the image description string for image handlers that support
image descriptions to <em>description</em>.
<p> Currently, no image format supported by Qt uses the description
string.
<h3 class=fn>void <a name="setFileName"></a>QImageIO::setFileName ( const <a href="qstring.html">QString</a> & fileName )
</h3>
Sets the name of the file to read or write an image from to <em>fileName</em>.
<p> <p>See also <a href="#setIODevice">setIODevice</a>().
<h3 class=fn>void <a name="setFormat"></a>QImageIO::setFormat ( const char * format )
</h3>
Sets the image format to <em>format</em> for the image to be read or
written.
<p> It is necessary to specify a format before writing an image, but
it is not necessary to specify a format before reading an image.
<p> If 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.
<p> <p>See also <a href="#read">read</a>(), <a href="#write">write</a>(), and <a href="#format">format</a>().
<h3 class=fn>void <a name="setGamma"></a>QImageIO::setGamma ( float gamma )
</h3>
Sets the gamma value at which the image will be viewed to <em>gamma</em>. 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).
<p> The default value is 0.0.
<p> <p>See also <a href="#gamma">gamma</a>().
<h3 class=fn>void <a name="setIODevice"></a>QImageIO::setIODevice ( <a href="qiodevice.html">QIODevice</a> * ioDevice )
</h3>
Sets the IO device to be used for reading or writing an image.
<p> Setting the IO device allows images to be read/written to any
block-oriented <a href="qiodevice.html">QIODevice</a>.
<p> If <em>ioDevice</em> is not null, this IO device will override file name
settings.
<p> <p>See also <a href="#setFileName">setFileName</a>().
<h3 class=fn>void <a name="setImage"></a>QImageIO::setImage ( const <a href="qimage.html">QImage</a> & image )
</h3>
Sets the image to <em>image</em>.
<p> <p>See also <a href="#image">image</a>().
<h3 class=fn>void <a name="setParameters"></a>QImageIO::setParameters ( const char * parameters )
</h3>
Sets the image's parameter string to <em>parameters</em>. This is for
image handlers that require special parameters.
<p> Although the current image formats supported by Qt ignore the
parameters string, it may be used in future extensions or by
contributions (for example, JPEG).
<p> <p>See also <a href="#parameters">parameters</a>().
<h3 class=fn>void <a name="setQuality"></a>QImageIO::setQuality ( int q )
</h3>
Sets the quality of the written image to <em>q</em>, related to the
compression ratio.
<p> <em>q</em> must be in the range -1..100. Specify 0 to obtain small
compressed files, 100 for large uncompressed files. (-1 signifies
the default compression.)
<p> <p>See also <a href="#quality">quality</a>() and <a href="qimage.html#save">QImage::save</a>().
<h3 class=fn>void <a name="setStatus"></a>QImageIO::setStatus ( int status )
</h3>
Sets the image IO status to <em>status</em>. A non-zero value indicates
an error, whereas 0 means that the IO operation was successful.
<p> <p>See also <a href="#status">status</a>().
<h3 class=fn>int <a name="status"></a>QImageIO::status () const
</h3>
<p> Returns the image's IO status. A non-zero value indicates an
error, whereas 0 means that the IO operation was successful.
<p> <p>See also <a href="#setStatus">setStatus</a>().
<h3 class=fn>bool <a name="write"></a>QImageIO::write ()
</h3>
Writes an image to an IO device and returns TRUE if the image was
successfully written; otherwise returns FALSE.
<p> Before 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.
<p> The image will be written using the specified image format.
<p> Example:
<pre>
QImageIO iio;
<a href="qimage.html">QImage</a> im;
im = pixmap; // convert to image
iio.<a href="#setImage">setImage</a>( im );
iio.<a href="#setFileName">setFileName</a>( "vegeburger.bmp" );
iio.<a href="#setFormat">setFormat</a>( "BMP" );
if ( iio.<a href="#write">write</a>() )
// returned TRUE if written successfully
</pre>
<p> <p>See also <a href="#setIODevice">setIODevice</a>(), <a href="#setFileName">setFileName</a>(), <a href="#setFormat">setFormat</a>(), <a href="#read">read</a>(), and <a href="qpixmap.html#save">QPixmap::save</a>().
<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>.
Copyright © 1995-2007
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright © 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>Qt 3.3.8</div>
</table></div></address></body>
</html>
|