~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/qimageioplugin.html

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="iso-8859-1"?>
 
2
<!DOCTYPE html
 
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
 
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/src/gui/image/qimageiohandler.cpp -->
 
6
<head>
 
7
    <title>Qt 4.0: QImageIOPlugin Class Reference</title>
 
8
    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
 
9
a:link { color: #004faf; text-decoration: none }
 
10
a:visited { color: #672967; text-decoration: none }
 
11
td.postheader { font-family: sans-serif }
 
12
tr.address { font-family: sans-serif }
 
13
body { background: #ffffff; color: black; }</style>
 
14
</head>
 
15
<body>
 
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
17
<tr>
 
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
 
19
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="annotated.html"><font color="#004faf">Annotated</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
 
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">QImageIOPlugin Class Reference</h1>
 
21
<p>The QImageIOPlugin class defines an interface for writing an image format plugin. <a href="#details">More...</a></p>
 
22
<pre>#include &lt;QImageIOPlugin&gt;</pre><p>Part of the <a href="qtgui.html">QtGui</a> module.</p>
 
23
<p>Inherits <a href="qobject.html">QObject</a>.</p>
 
24
<ul>
 
25
<li><a href="qimageioplugin-members.html">List of all members, including inherited members</a></li>
 
26
</ul>
 
27
<a name="public-types"></a>
 
28
<h3>Public Types</h3>
 
29
<ul>
 
30
<li><div class="fn"/>flags <b><a href="qimageioplugin.html#Capability-enum">Capabilities</a></b></li>
 
31
<li><div class="fn"/>enum <b><a href="qimageioplugin.html#Capability-enum">Capability</a></b> { CanRead, CanWrite, CanReadIncremental }</li>
 
32
</ul>
 
33
<a name="public-functions"></a>
 
34
<h3>Public Functions</h3>
 
35
<ul>
 
36
<li><div class="fn"/><b><a href="qimageioplugin.html#QImageIOPlugin">QImageIOPlugin</a></b> ( QObject * <i>parent</i> = 0 )</li>
 
37
<li><div class="fn"/>virtual <b><a href="qimageioplugin.html#dtor.QImageIOPlugin">~QImageIOPlugin</a></b> ()</li>
 
38
<li><div class="fn"/>virtual Capabilities <b><a href="qimageioplugin.html#capabilities">capabilities</a></b> ( QIODevice * <i>device</i>, const QByteArray &amp; <i>format</i> ) const = 0</li>
 
39
<li><div class="fn"/>virtual QImageIOHandler * <b><a href="qimageioplugin.html#create">create</a></b> ( QIODevice * <i>device</i>, const QByteArray &amp; <i>format</i> = QByteArray() ) const = 0</li>
 
40
<li><div class="fn"/>virtual QStringList <b><a href="qimageioplugin.html#keys">keys</a></b> () const = 0</li>
 
41
</ul>
 
42
<ul>
 
43
<li><div class="fn"/>28 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
 
44
</ul>
 
45
<h3>Additional Inherited Members</h3>
 
46
<ul>
 
47
<li><div class="fn"/>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
 
48
<li><div class="fn"/>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
 
49
<li><div class="fn"/>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
 
50
<li><div class="fn"/>4 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
 
51
<li><div class="fn"/>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
 
52
</ul>
 
53
<a name="details"></a>
 
54
<hr />
 
55
<h2>Detailed Description</h2>
 
56
<p>The QImageIOPlugin class defines an interface for writing an image format plugin.</p>
 
57
<p>QImageIOPlugin is a factory for creating <a href="qimageiohandler.html">QImageIOHandler</a> objects, which are used internally by <a href="qimagereader.html">QImageReader</a> and <a href="qimagewriter.html">QImageWriter</a> to add support for different image formats to Qt.</p>
 
58
<p>Writing an picture format plugin is achieved by subclassing this base class, reimplementing the pure virtual functions <a href="qimageioplugin.html#keys">keys</a>(), loadPicture(), savePicture(), and installIOHandler(), and exporting the class with the <a href="qpluginloader.html#Q_EXPORT_PLUGIN">Q_EXPORT_PLUGIN</a>() macro. See <a href="plugins-howto.html">How to Create Qt Plugins</a> for details.</p>
 
59
<p>An image format plugin can support three capabilities: reading (<a href="qimageioplugin.html#Capability-enum">CanRead</a>), writing (<a href="qimageioplugin.html#Capability-enum">CanWrite</a>) and <i>incremental</i> reading (<a href="qimageioplugin.html#Capability-enum">CanReadIncremental</a>). Reimplement <a href="qimageioplugin.html#capabilities">capabilities</a>() in you subclass to expose the capabilities of your image format.</p>
 
60
<p><a href="qimageioplugin.html#create">create</a>() should create an instance of your <a href="qimageiohandler.html">QImageIOHandler</a> subclass, with the provided device and format properly set, and return this handler. You must also reimplement <a href="qimageioplugin.html#keys">keys</a>() so that Qt knows which image formats your plugin supports.</p>
 
61
<p>Different plugins can support different capabilities. For example, you may have one plugin that supports reading the GIF format, and another that supports writing. Qt will select the correct plugin for the job, depending on the return value of <a href="qimageioplugin.html#capabilities">capabilities</a>(). If several plugins support the same capability, Qt will select one arbitrarily.</p>
 
62
<p>See also <a href="qimageiohandler.html">QImageIOHandler</a> and <a href="plugins-howto.html">How to Create Qt Plugins</a>.</p>
 
63
<hr />
 
64
<h2>Member Type Documentation</h2>
 
65
<h3 class="flags"><a name="Capability-enum"></a>enum QImageIOPlugin::Capability<br />flags QImageIOPlugin::Capabilities</h3>
 
66
<p>This enum describes the capabilities of a <a href="qimageioplugin.html">QImageIOPlugin</a>.</p>
 
67
<table border="1" cellpadding="2" cellspacing="1" width="100%">
 
68
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
 
69
<tr><td valign="top"><tt>QImageIOPlugin::CanRead</tt></td><td align="center" valign="top"><tt>0x1</tt></td><td valign="top">The plugin can read images.</td></tr>
 
70
<tr><td valign="top"><tt>QImageIOPlugin::CanWrite</tt></td><td align="center" valign="top"><tt>0x2</tt></td><td valign="top">The plugin can write images.</td></tr>
 
71
<tr><td valign="top"><tt>QImageIOPlugin::CanReadIncremental</tt></td><td align="center" valign="top"><tt>0x4</tt></td><td valign="top">The plugin can read images incrementally.</td></tr>
 
72
</table>
 
73
<p>The Capabilities type is a typedef for <a href="qflags.html">QFlags</a>&lt;Capability&gt;. It stores an OR combination of Capability values.</p>
 
74
<hr />
 
75
<h2>Member Function Documentation</h2>
 
76
<h3 class="fn"><a name="QImageIOPlugin"></a>QImageIOPlugin::QImageIOPlugin ( <a href="qobject.html">QObject</a> * <i>parent</i> = 0 )</h3>
 
77
<p>Constructs an image plugin with the given <i>parent</i>. This is invoked automatically by the <a href="qpluginloader.html#Q_EXPORT_PLUGIN">Q_EXPORT_PLUGIN</a>() macro.</p>
 
78
<h3 class="fn"><a name="dtor.QImageIOPlugin"></a>QImageIOPlugin::~QImageIOPlugin ()&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
79
<p>Destroys the picture format plugin.</p>
 
80
<p>You never have to call this explicitly. Qt destroys a plugin automatically when it is no longer used.</p>
 
81
<h3 class="fn"><a name="capabilities"></a><a href="qimageioplugin.html#Capability-enum">Capabilities</a> QImageIOPlugin::capabilities ( <a href="qiodevice.html">QIODevice</a> * <i>device</i>, const <a href="qbytearray.html">QByteArray</a> &amp; <i>format</i> ) const&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
 
82
<p>Returns the capabilities on the plugin, based on the data in <i>device</i> and the format <i>format</i>. For example, if the <a href="qimageiohandler.html">QImageIOHandler</a> supports the BMP format, and the data in the device starts with the characters &quot;BM&quot;, this function should return <a href="qimageioplugin.html#Capability-enum">CanRead</a>. If <i>format</i> is &quot;bmp&quot; and the handler supports both reading and writing, this function should return <a href="qimageioplugin.html#Capability-enum">CanRead</a> | <a href="qimageioplugin.html#Capability-enum">CanWrite</a>.</p>
 
83
<h3 class="fn"><a name="create"></a><a href="qimageiohandler.html">QImageIOHandler</a> * QImageIOPlugin::create ( <a href="qiodevice.html">QIODevice</a> * <i>device</i>, const <a href="qbytearray.html">QByteArray</a> &amp; <i>format</i> = QByteArray() ) const&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
 
84
<p>Creates and returns a <a href="qimageiohandler.html">QImageIOHandler</a> subclass, with <i>device</i> and <i>format</i> set.</p>
 
85
<p>Reimplemented from <a href="qimageiohandlerfactoryinterface.html#create">QImageIOHandlerFactoryInterface</a>.</p>
 
86
<p>See also <a href="qimageioplugin.html#keys">keys</a>().</p>
 
87
<h3 class="fn"><a name="keys"></a><a href="qstringlist.html">QStringList</a> QImageIOPlugin::keys () const&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
 
88
<p>Returns the list of image keys this plugin supports.</p>
 
89
<p>These keys are usually the names of the image formats that are implemented in the plugin (e.g., &quot;jpg&quot; or &quot;gif&quot;).</p>
 
90
<p>Reimplemented from <a href="qfactoryinterface.html#keys">QFactoryInterface</a>.</p>
 
91
<p>See also <a href="qimageioplugin.html#capabilities">capabilities</a>().</p>
 
92
<p /><address><hr /><div align="center">
 
93
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
94
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
 
95
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
96
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
 
97
</tr></table></div></address></body>
 
98
</html>