This document gives you more information about the Image Decoding functionality.
The image decoding class
Required Background
Image decoding features are provided through Imaging Frameworks and Imaging plugins. The standard formats supported by the decode plugins are shown in the table in
Introduction
The decoding process comprises the following sections:
Creation - The creation of the
Conversion - Covers the basic form of image decoding. More advanced features such as progressive and buffered decoding are described separately.
Enquiry features - Additional features that enable you to retrieve information stored in certain types of images, for example frame information and comments.
Streamed and progressive decoding - Reading partial image files and displaying image data before the entire image is read.
Buffered decoding - The decoding of an image using a buffered input rather than a file or descriptor.
Setup and Configuration Requirements
The
In addition to the use of active objects in the interfacing, many of the Imaging Frameworks internal functions make extensive use of them to provide asynchronous behaviour. As with any use of an active object it is necessary to have an active scheduler in the same thread as the application making use of the object. The Decoders can also be created so the plugin and framework runs in a separate thread. This is achieved by setting the
The Following tasks are covered in this tutorial:
Basic Procedure For Creation
The high level steps to create the object during decoding are as follows:
When you create a
MIME type The plugin is determined by looking up a specified MIME type against a list of known MIME type/plugin implementations. Use the following "File" factory function (or its "Data" equivalent).
Image type and sub-type The plugin is determined by looking up the specified image type and sub-types against a list of known type/sub-type plugin implementations. Use the following "File" factory function (or its "Data" equivalent).
Note: For images types that do not have sub-types use
Implementation UID The plugin is determined by looking up its specific UID and the image type and sub-type. Use the same
Note: Implementation UID is supported because it is possible to have more than one plugin for a particular image type. This method is recommended if the application or calling DLL needs to exploit features of a particular plugin.
Automatic detection - no MIME type, format type/sub-type or UIDs are specified. The plugin analyses the header information of the specified image. Use the same
If a suitable plugin cannot be found, the factory function leaves with
Note: Some image formats cannot be automatically detected because they do not contain sufficient header information, for example, WBMP and OTA images. Under such circumstances, use one of the other three alternative for opening the image.
It is possible for more than one valid plugin decoder to be available for a specific image format. If a plugin determined by MIME type or type/sub-type fails to open an image due to
Basic Procedure For Conversion
The high level steps to convert encoded data to decoded data are as follow:
As part of the
You can decode any subset of individual frames, in any order, and to repeat the decoding if necessary. To decode an image frame use the asynchronous conversion method
Note: The use of
There are different type of sub-procedures which have to be followed before decode conversion, they are:
Basic Procedure For Bitmap Masks conversion
The high level steps to Bitmap Masks conversion are as follows:
There is a second variant of the
Within the Symbian platform it is normal to store the bitmap mask separately from the main image data. Calls such as
To determine whether an image contains a bitmap mask use
The following two types of mask are available:
8-bit alpha blend - indicated by the
Simple on/off mask - if no
Note: Images that contain bitmap masks do not have to have those masks decoded if they are not required.
Basic Procedure For Scaling and display modes
The high level steps to Scale and display are shown here:
Before
If the
Note: The mask bitmap must have the same size in pixels as the main image, even though the display mode is generally different.
The size of the image bitmap is available via
If the
Basic Procedure For Animations
The high level steps to decode a GIF multi-frame image are as follow:
Included in the
Processing the information from these flags will inevitably require a state machine, and additional timers, within the application. Requirements will vary depending on the architecture of the client application itself.
Basic Procedure For Background colours
Some image formats contain background colour information. This is information is presented through
If a non-masked image with background colour is decoded, the colour is included in the image data. If the decoded image also contains a bitmap mask, then the background colour will be a component of the mask
Basic Procedure To Retrieve Information From An Image
The high level steps to retrieve the information stored in certain types of images are shown here:
Basic Procedure Streamed and Progressive Decoding
The high level steps to perform the streaming and the progressive during decoding are shown here:
If there is insufficient data to work out the image format (plugin decoder to use)
As soon as the correct plugin decoder has been determined it is opened and whatever addition image data available is scanned. The plugin decoder continues to decode image data as it arrives, updating
Frames can be decoded before the entire image is loaded, but the frame to be decoded must be at least partially loaded. If
Once
Where only a partial conversion has been completed,
Note: The
There is no explicit decoder call to say "all of the data is now present". This could be done via inference, continuously checking
Basic Procedure For Buffered Decoding
The high level steps to perform the buffered decoding are shown here:
The decoder is created using the
Warning: The decoding and enquiry functions must not be used until an internal decoder has been created, otherwise calls will panic with
Additional data can be supplied to the decoder, when it becomes available, by using
Note: As with
The process for decoding the image header and frames are the same as for
The decoder can be reused by calling a
This document gives you more information about the Image Decoding functionality.
+The image decoding class
Required Background
Image decoding features are provided through
+Imaging Frameworks and Imaging plugins. The standard formats supported by
+the decode plugins are shown in the table in
Introduction
The decoding process comprises the following sections:
Creation - The
+creation of the
Conversion - +Covers the basic form of image decoding. More advanced features such as progressive +and buffered decoding are described separately.
Enquiry features - +Additional features that enable you to retrieve information stored in certain +types of images, for example frame information and comments.
Streamed and progressive +decoding - Reading partial image files and displaying image data before +the entire image is read.
Buffered decoding - +The decoding of an image using a buffered input rather than a file or descriptor.
Setup +and Configuration Requirements
The
In
+addition to the use of active objects in the interfacing, many of the Imaging
+Frameworks internal functions make extensive use of them to provide asynchronous
+behaviour. As with any use of an active object it is necessary to have an
+active scheduler in the same thread as the application making use of the object.
+The Decoders can also be created so the plugin and framework runs in a separate
+thread. This is achieved by setting the
The Following tasks are covered +in this tutorial:
Basic Procedure For Creation
The +high level steps to create the object during decoding are as follows:
When you create a
MIME type The +plugin is determined by looking up a specified MIME type against a list of +known MIME type/plugin implementations. Use the following "File" factory function +(or its "Data" equivalent).
Image type and sub-type The +plugin is determined by looking up the specified image type and sub-types +against a list of known type/sub-type plugin implementations. Use the following +"File" factory function (or its "Data" equivalent).
Note: For images types that do not have sub-types
+use
Implementation UID The
+plugin is determined by looking up its specific UID and the image type and
+sub-type. Use the same
Note: Implementation +UID is supported because it is possible to have more than one plugin for a +particular image type. This method is recommended if the application or calling +DLL needs to exploit features of a particular plugin.
Automatic detection -
+no MIME type, format type/sub-type or UIDs are specified. The plugin analyses
+the header information of the specified image. Use the same
If
+a suitable plugin cannot be found, the factory function leaves with
Note: +Some image formats cannot be automatically detected because they do not contain +sufficient header information, for example, WBMP and OTA images. Under such +circumstances, use one of the other three alternative for opening the image.
It is possible for more than one valid plugin decoder to be available
+for a specific image format. If a plugin determined by MIME type or type/sub-type
+fails to open an image due to
Basic Procedure For Conversion
The +high level steps to convert encoded data to decoded data are as follow:
As part of the
You can decode any subset
+of individual frames, in any order, and to repeat the decoding if necessary.
+To decode an image frame use the asynchronous conversion method
Note: The
+use of
There are different type of sub-procedures +which have to be followed before decode conversion, they are:
Basic Procedure For Bitmap +Masks conversion
The high level steps to Bitmap Masks conversion +are as follows:
There is a second variant
+of the
Within the Symbian platform
+it is normal to store the bitmap mask separately from the main image data.
+Calls such as
To determine whether
+an image contains a bitmap mask use
The +following two types of mask are available:
8-bit alpha blend -
+indicated by the
Simple on/off mask -
+if no
Note: Images that contain bitmap masks do not have to have +those masks decoded if they are not required.
Basic Procedure For Scaling +and display modes
The high level steps to Scale and display are +shown here:
Before
If the
Note: The +mask bitmap must have the same size in pixels as the main image, even though +the display mode is generally different.
The size of the image
+bitmap is available via
If the
Basic Procedure For Animations
The +high level steps to decode a GIF multi-frame image are as follow:
Included in the
Processing the information +from these flags will inevitably require a state machine, and additional timers, +within the application. Requirements will vary depending on the architecture +of the client application itself.
Basic Procedure For Background +colours
Some image formats contain
+background colour information. This is information is presented through
If a non-masked image
+with background colour is decoded, the colour is included in the image data.
+If the decoded image also contains a bitmap mask, then the background colour
+will be a component of the mask
Basic Procedure To Retrieve +Information From An Image
The high level steps to retrieve the +information stored in certain types of images are shown here:
Basic Procedure Streamed +and Progressive Decoding
The +high level steps to perform the streaming and the progressive during decoding +are shown here:
If there is insufficient
+data to work out the image format (plugin decoder to use)
As soon as the correct
+plugin decoder has been determined it is opened and whatever addition image
+data available is scanned. The plugin decoder continues to decode image data
+as it arrives, updating
Frames can be decoded
+before the entire image is loaded, but the frame to be decoded must be at
+least partially loaded. If
Once
Where only a partial
+conversion has been completed,
Note: The
There is no explicit decoder call to say "all of the data is now
+present". This could be done via inference, continuously checking
Basic Procedure For Buffered +Decoding
The high level steps to perform +the buffered decoding are shown here:
The decoder is created
+using the
Warning: The decoding and enquiry functions
+must not be used until an internal decoder has been created, otherwise calls
+will panic with
Additional data can
+be supplied to the decoder, when it becomes available, by using
Note:
+As with
The process for decoding
+the image header and frames are the same as for
The decoder can be reused
+by calling a