org.kde.koala

Class KImageIO

public class KImageIO extends Object implements QtSupport

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. ormats: Currently supported formats include:
  • BMP \ \
  • EPS \ \
  • EXR \
  • G3 \
  • GIF \
  • ICO \
  • JP2 \ \
  • JPEG \ \
  • NETPBM \ \
  • PCX \ \
  • PNG \ \
  • TGA \ \
  • TIFF \
  • XBM \ \
  • XPM \ \
  • XV \ \
  • sage: Simply call the KImageIO.registerFormats() static method declared in kimageio.h. xample:
     #include
     #include
     int main( String[] args )
      {
       ....
       KImageIO.registerFormats();
       ...   // start main program
     }
     

    Author: Sirtaj Singh Kang

    See Also: KImageIO org.kde.qt.QPixmap org.kde.qt.QImage org.kde.qt.QImageIO

    UNKNOWN: Interface to the KDE Image IO plugin architecture.

    Field Summary
    static intReading
    Possible image file access modes.
    static intWriting
    Constructor Summary
    protected KImageIO(Class dummy)
    KImageIO()
    Method Summary
    static booleancanRead(String type)
    Checks if a special type is supported for reading.
    static booleancanWrite(String type)
    Checks if a special type is supported for writing.
    voiddispose()
    Delete the wrapped C++ instance ahead of finalize()
    protected voidfinalize()
    Deletes the wrapped C++ instance
    booleanisDisposed()
    Has the wrapped C++ instance been deleted?
    static booleanisSupported(String _mimeType, int _mode)
    Test to see whether a MIME type is supported to reading/writing.
    static booleanisSupported(String _mimeType)
    static StringmimeType(String _filename)
    Returns the MIME type of _filename.
    static ArrayListmimeTypes(int mode)
    Returns a list of MIME types for all KImageIO supported formats.
    static ArrayListmimeTypes()
    static Stringpattern(int mode)
    Returns a list of patterns of all KImageIO supported formats.
    static Stringpattern()
    static voidregisterFormats()
    Registers all KImageIO supported formats.
    static Stringsuffix(String type)
    Returns the suffix of an image type.
    static Stringtype(String filename)
    Returns the type of given filename.
    static StringtypeForMime(String mimeType)
    Returns the type of a MIME type.
    static ArrayListtypes(int mode)
    Returns a list of all KImageIO supported formats.
    static ArrayListtypes()

    Field Detail

    Reading

    public static final int Reading
    Possible image file access modes. Used in various KImageIO static function.

    UNKNOWN: Possible image file access modes.

    Writing

    public static final int Writing

    Constructor Detail

    KImageIO

    protected KImageIO(Class dummy)

    KImageIO

    public KImageIO()

    Method Detail

    canRead

    public static boolean canRead(String type)
    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

    UNKNOWN: Checks if a special type is supported for reading.

    canWrite

    public static boolean canWrite(String type)
    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

    UNKNOWN: Checks if a special type is supported for writing.

    dispose

    public void dispose()
    Delete the wrapped C++ instance ahead of finalize()

    finalize

    protected void finalize()
    Deletes the wrapped C++ instance

    isDisposed

    public boolean isDisposed()
    Has the wrapped C++ instance been deleted?

    isSupported

    public static boolean isSupported(String _mimeType, int _mode)
    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

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

    isSupported

    public static boolean isSupported(String _mimeType)

    mimeType

    public static String mimeType(String _filename)
    Returns the MIME type of _filename.

    Parameters: _filename the filename to check

    Returns: the MIME type of the file, or null

    UNKNOWN: Returns the MIME type of _filename.

    mimeTypes

    public static ArrayList mimeTypes(int mode)
    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

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

    mimeTypes

    public static ArrayList mimeTypes()

    pattern

    public static String pattern(int mode)
    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

    UNKNOWN: Returns a list of patterns of all KImageIO supported formats.

    pattern

    public static String pattern()

    registerFormats

    public static void registerFormats()
    Registers all KImageIO supported formats.

    UNKNOWN: Registers all KImageIO supported formats.

    suffix

    public static String suffix(String type)
    Returns the suffix of an image type.

    Parameters: type the type id of the file format

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

    UNKNOWN: Returns the suffix of an image type.

    type

    public static String type(String filename)
    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 null

    UNKNOWN: Returns the type of given filename.

    typeForMime

    public static String typeForMime(String mimeType)
    Returns the type of a MIME type.

    Parameters: mimeType the MIME type to search

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

    UNKNOWN: Returns the type of a MIME type.

    types

    public static ArrayList types(int mode)
    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

    UNKNOWN: Returns a list of all KImageIO supported formats.

    types

    public static ArrayList types()