Home

QtJP2ImageFormat Class Reference

The QtJP2ImageFormat class provides support for reading and writing JPEG 2000 image files. More...

#include <qtjp2imageformat.h>

List of all member functions.

Public Members

Static Public Members


Detailed Description

The QtJP2ImageFormat class provides support for reading and writing JPEG 2000 image files.

It also provides a static function to install the JPEG 2000 format as a QImageIO format handler, making it possible to load and save JPEG 2000 files using standard QImage functions.

JPEG files comes in two flavors: the JPEG 2000 file format (.jp2) and the JPEG 2000 code stream format (.j2k, .jpc, or .j2c). QtJP2ImageFormat can read and write both types.

The JPEG 2000 image format can be installed as a QImageIO handler in the following way:

        QtJP2ImageFormat::installIOHandler();
    

This enables you to use normal QImage and QPixmap functions to read and write images. For example:

        myLabel->setPixmap(QPixmap("myimage.jp2"));

        QPixmap myPixmap;
        myPixmap.save("myimage.jp2", "JP2");
    

See also


Member Type Documentation

QtJP2ImageFormat::SubFormat

This enum specifies the different flavor of the JPEG 2000 format.

See also write().


Member Function Documentation

void QtJP2ImageFormat::installIOHandler () [static]

Registers the JEPG 2000 image format with Qt. This allows JPEG 2000 files to be recognized by Qt's standard image handling functions.

To register this plugin, simply call this function in your application's initialization code.

QImage QtJP2ImageFormat::read ( QIODevice * ioDevice ) [static]

Reads a image from the QIODevice specified by ioDevice.

See also write().

QImage QtJP2ImageFormat::read ( const QString & fileName ) [static]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Reads a image from the file specified by fileName.

bool QtJP2ImageFormat::write ( QIODevice * ioDevice, QImage image, SubFormat format = Jp2Format ) [static]

Writes image to the device specified by ioDevice, using the given format.

Returns true if the operation was successful; otherwise returns false.

See also read().

bool QtJP2ImageFormat::write ( const QString & fileName, QImage image, SubFormat format = Jp2Format ) [static]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Writes image to the file specified by fileName, using the given format.

Returns true if the operation was successful; otherwise returns false.


This file is part of the Qt Solutions. Copyright © 2003-2004 Trolltech. All Rights Reserved.

Copyright © 2003-2004 TrolltechTrademarks
Qt Solutions