class KImageIO

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

Definition#include <kimageio.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Static Methods


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:

Usage

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

Example


	#include
 	#include

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

See also: KImageIO, QPixmap, QImage, QImageIO

enum Mode { Reading, Writing }

Mode

Possible image file access modes.

Used in various KImageIO static function.

void  registerFormats ()

registerFormats

[static]

Registers all KImageIO supported formats.

bool  canWrite (const QString& type)

canWrite

[static]

Checks if a special type is supported for writing.

Parameters:
thetype id of the image type

Returns: true if the image format can be written

bool  canRead (const QString& type)

canRead

[static]

Checks if a special type is supported for reading.

Parameters:
thetype id of the image type

Returns: true if the image format can be read

QStringList  types (Mode mode = Writing)

types

[static]

Returns a list of all KImageIO supported formats.

Parameters:
modeTells whether to retrieve modes that can be read or written.

Returns: a list of the type ids

QString  pattern (Mode mode = Reading)

pattern

[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:
modeTells whether to retrieve modes that can be read or written.

QString  suffix (const QString& type)

suffix

[static]

Returns the suffix of an image type.

Parameters:
typethe type id of the file format

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

QString  typeForMime (const QString& mimeType)

typeForMime

[static]

Returns the type of a MIME type.

Parameters:
mimeTypethe MIME type to search

Returns: type id of the MIME type or QString::null if the MIME type is not supported

QString  type (const QString& filename)

type

[static]

Returns the type of given filename.

Parameters:
filenamethe filename to check

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

QStringList  mimeTypes ( Mode _mode = Writing )

mimeTypes

[static]

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

Parameters:
modeTells whether to retrieve modes that can be read or written.

Returns: a list if MIME types of the supported formats

bool  isSupported ( const QString& _mimeType, Mode _mode = Writing )

isSupported

[static]

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

Parameters:
_mimeTypethe MIME type to check
_modeTells whether to check for reading or writing capabilities

Returns: true if the type is supported

QString  mimeType ( const QString& _filename )

mimeType

[static]

Returns the MIME type of _filename.

Parameters:
_filenamethe filename to check

Returns: the MIME type of the file, or QString::null