org.kde.koala
Class KImageIO

java.lang.Object
  extended by org.kde.koala.KImageIO
All Implemented Interfaces:
org.kde.qt.QtSupport

public class KImageIO
extends java.lang.Object
implements org.kde.qt.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, QPixmap, QImage, QImageIO

    Field Summary
    static int Reading
              Possible image file access modes.
    static int Writing
               
     
    Constructor Summary
      KImageIO()
               
    protected KImageIO(java.lang.Class dummy)
               
     
    Method Summary
    static boolean canRead(java.lang.String type)
              Checks if a special type is supported for reading.
    static boolean canWrite(java.lang.String type)
              Checks if a special type is supported for writing.
     void dispose()
              Delete the wrapped C++ instance ahead of finalize()
    protected  void finalize()
              Deletes the wrapped C++ instance
     boolean isDisposed()
              Has the wrapped C++ instance been deleted?
    static boolean isSupported(java.lang.String _mimeType)
               
    static boolean isSupported(java.lang.String _mimeType, int _mode)
              Test to see whether a MIME type is supported to reading/writing.
    static java.lang.String mimeType(java.lang.String _filename)
              Returns the MIME type of _filename.
    static java.util.ArrayList mimeTypes()
               
    static java.util.ArrayList mimeTypes(int mode)
              Returns a list of MIME types for all KImageIO supported formats.
    static java.lang.String pattern()
               
    static java.lang.String pattern(int mode)
              Returns a list of patterns of all KImageIO supported formats.
    static void registerFormats()
              Registers all KImageIO supported formats.
    static java.lang.String suffix(java.lang.String type)
              Returns the suffix of an image type.
    static java.lang.String type(java.lang.String filename)
              Returns the type of given filename.
    static java.lang.String typeForMime(java.lang.String mimeType)
              Returns the type of a MIME type.
    static java.util.ArrayList types()
               
    static java.util.ArrayList types(int mode)
              Returns a list of all KImageIO supported formats.
     
    Methods inherited from class java.lang.Object
    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    Reading

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

    See Also:
    Constant Field Values

    Writing

    public static final int Writing
    See Also:
    Constant Field Values
    Constructor Detail

    KImageIO

    protected KImageIO(java.lang.Class dummy)

    KImageIO

    public KImageIO()
    Method Detail

    registerFormats

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


    canWrite

    public static boolean canWrite(java.lang.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

    canRead

    public static boolean canRead(java.lang.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

    types

    public static java.util.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

    types

    public static java.util.ArrayList types()

    pattern

    public static java.lang.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

    pattern

    public static java.lang.String pattern()

    suffix

    public static java.lang.String suffix(java.lang.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

    typeForMime

    public static java.lang.String typeForMime(java.lang.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

    type

    public static java.lang.String type(java.lang.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

    mimeTypes

    public static java.util.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

    mimeTypes

    public static java.util.ArrayList mimeTypes()

    isSupported

    public static boolean isSupported(java.lang.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

    isSupported

    public static boolean isSupported(java.lang.String _mimeType)

    mimeType

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

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

    finalize

    protected void finalize()
                     throws java.lang.InternalError
    Deletes the wrapped C++ instance

    Overrides:
    finalize in class java.lang.Object
    Throws:
    java.lang.InternalError

    dispose

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


    isDisposed

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