• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kio

KImageIO Class Reference

Interface to the KDE Image IO plugin architecture. More...

#include <kimageio.h>

List of all members.


Public Types

enum  Mode { Reading, Writing }

Static Public Member Functions

static bool canRead (const QString &type)
static bool canWrite (const QString &type)
static bool isSupported (const QString &_mimeType, Mode _mode=Writing)
static QString mimeType (const QString &_filename)
static QStringList mimeTypes (Mode mode=Writing)
static QString pattern (Mode mode=Reading)
static void registerFormats ()
static QString suffix (const QString &type)
static QString type (const QString &filename)
static QString typeForMime (const QString &mimeType)
static QStringList types (Mode mode=Writing)

Detailed Description

Interface to the KDE Image IO plugin architecture.

This library allows KDE applications to read and write images in a variety of formats, transparently via the QImage and QPixmap load and save methods.

The image processing backends are written as image handlers compatible with the QImageIO handler format. The backends are loaded on demand when a particular format is requested. Each format can be identified by a unique type id string.

Formats:

Currently supported formats include:

  • BMP <read> <write>
  • EPS <read> <write>
  • EXR <read>
  • G3 <read>
  • GIF <read>
  • ICO <read>
  • JP2 <read> <write>
  • JPEG <read> <write>
  • NETPBM <read> <write>
  • PCX <read> <write>
  • PNG <read> <write, only with newer libraries>
  • TGA <read> <write>
  • TIFF <read>
  • XBM <read> <write>
  • XPM <read> <write>
  • XV <read> <write>
Usage:

Simply call the KImageIO::registerFormats() static method declared in kimageio.h.

Example:

 #include<qpixmap.h>
 #include<kimageio.h>

 int main( int argc, char **argv )
  {
   ....
   KImageIO::registerFormats();
   ...   // start main program
 }

See also:
KImageIO, QPixmap, QImage, QImageIO
Author:
Sirtaj Singh Kang

Definition at line 69 of file kimageio.h.


Member Enumeration Documentation

enum KImageIO::Mode

Possible image file access modes.

Used in various KImageIO static function.

Enumerator:
Reading 
Writing 

Definition at line 77 of file kimageio.h.


Member Function Documentation

bool KImageIO::canRead ( const QString &  type  )  [static]

Checks if a special type is supported for reading.

Parameters:
type the type id of the image type
Returns:
true if the image format can be read

Definition at line 411 of file kimageio.cpp.

bool KImageIO::canWrite ( const QString &  type  )  [static]

Checks if a special type is supported for writing.

Parameters:
type the type id of the image type
Returns:
true if the image format can be written

Definition at line 392 of file kimageio.cpp.

bool KImageIO::isSupported ( const QString &  _mimeType,
Mode  _mode = Writing 
) [static]

Test to see whether a MIME type is supported to reading/writing.

Parameters:
_mimeType the MIME type to check
_mode Tells whether to check for reading or writing capabilities
Returns:
true if the type is supported

Definition at line 533 of file kimageio.cpp.

QString KImageIO::mimeType ( const QString &  _filename  )  [static]

Returns the MIME type of _filename.

Parameters:
_filename the filename to check
Returns:
the MIME type of the file, or QString::null

Definition at line 556 of file kimageio.cpp.

QStringList KImageIO::mimeTypes ( Mode  mode = Writing  )  [static]

Returns a list of MIME types for all KImageIO supported formats.

Parameters:
mode Tells whether to retrieve modes that can be read or written.
Returns:
a list if MIME types of the supported formats

Definition at line 511 of file kimageio.cpp.

QString KImageIO::pattern ( Mode  mode = Reading  )  [static]

Returns a list of patterns of all KImageIO supported formats.

These patterns can be passed to KFileDialog::getOpenFileName() or KFileDialog::getSaveFileName(), for example.

Parameters:
mode Tells whether to retrieve modes that can be read or written.
Returns:
a space-separated list of file globs that describe the supported formats

Definition at line 384 of file kimageio.cpp.

void KImageIO::registerFormats (  )  [static]

Registers all KImageIO supported formats.

Definition at line 378 of file kimageio.cpp.

QString KImageIO::suffix ( const QString &  type  )  [static]

Returns the suffix of an image type.

Parameters:
type the type id of the file format
Returns:
the suffix of the file format or QString::null if it does not exist

Definition at line 450 of file kimageio.cpp.

QString KImageIO::type ( const QString &  filename  )  [static]

Returns the type of given filename.

Parameters:
filename the filename to check
Returns:
if the file name's suffix is known the type id of the file type, otherwise QString::null

Definition at line 488 of file kimageio.cpp.

QString KImageIO::typeForMime ( const QString &  mimeType  )  [static]

Returns the type of a MIME type.

Parameters:
mimeType the MIME type to search
Returns:
type id of the MIME type or QString::null if the MIME type is not supported
Since:
3.1

Definition at line 469 of file kimageio.cpp.

QStringList KImageIO::types ( Mode  mode = Writing  )  [static]

Returns a list of all KImageIO supported formats.

Parameters:
mode Tells whether to retrieve modes that can be read or written.
Returns:
a list of the type ids

Definition at line 430 of file kimageio.cpp.


The documentation for this class was generated from the following files:
  • kimageio.h
  • kimageio.cpp

kio

Skip menu "kio"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal