#include <imageconversion.h>
Link against: imageconversion.lib
class CImageDecoder : public CBase |
Public Member Enumerations | |
---|---|
enum | TImageType { EImageTypeThumbnail, EImageTypeMain } |
enum | TOptions { EOptionNone, EOptionNoDither, EOptionAlwaysThread, EOptionAllowZeroFrameOpen, ..., EOptionOptimisedPartialImageDecoding } |
Protected Member Functions | |
---|---|
CImageDecoder() | |
IMPORT_C void | CustomAsync(TRequestStatus *, TInt) |
IMPORT_C void | CustomSyncL(TInt) |
IMPORT_C CImageDecoderPlugin * | Plugin() |
Provides access to the Image Conversion Library decoders.
This class provides functions to decode images held in files or descriptors. To decode buffered images use the buffered version of this class CBufferedImageDecoder.
Regarding DRM: Note that intent is evaluated when a CImageDecoder instance is being constructed by one of the FileNewL() methods. It is executed after at least one frame of the image has been successfully decoded. Subsequent converts using the same CImageDecoder instance will not execute intent.
Flags to control which image is decoded. This can be used when the source file or descriptor contains multiple distinct image sources.
Enumerator | Value | Description |
---|---|---|
EImageTypeThumbnail | 0x01 |
Use the thumbnail as source image |
EImageTypeMain | 0x02 |
Use the main image |
Flags to control how the image is decoded. These can be combined using an OR operation.
Enumerator | Value | Description |
---|---|---|
EOptionNone | 0x00 |
No flag set |
EOptionNoDither | 0x01 |
Do not dither the decoded image |
EOptionAlwaysThread | 0x02 |
Perform the decoding in a separate thread |
EOptionAllowZeroFrameOpen | 0x04 |
Allow Opens to complete with no error if there is less than one frame available. This should be set for streaming. |
EAllowGeneratedMask | 0x08 |
Setting this flag requests that the plugin generate a mask during decoding. Note: This option is only relevant to image formats that do not already contain mask information. The client must check that TFrameInfo::ETransparencyPossible is set before attempting to obtain the mask, because not all plugins support mask generation. |
EPreferFastDecode | 0x10 |
Use the highest possible image decoding speed; this may result in lower image quality. This flag is more applicable to formats which use "lossy" compression algorithms, such as JPEG. Decoders that do not support fast decoding will ignore it. |
EOptionMngSubframesNoLoops | 0x20 |
Prevent MNG ImageDecoder from unwinding all the loops |
EOptionUseFrameSizeInPixels | 0x40 |
Setting this flag requests that the plugin use the frame size rather than the overall size when calculating its reduction factor |
EOptionIgnoreExifMetaData | 0x80 |
When specified, this flag indicates that the decoder must ignore the EXIF meta-data, if present. In this case, the ExifMetaData() should return NULL. This option value is also used to indicate the requirement to ignore the EXIF meta-data when doing the image transformation. |
EOptionExtCrop | 0x0100 |
Codec must support crop. |
EOptionExtStream | 0x0200 |
Codec must support block streaming extension. |
EOptionExtRotation | 0x0400 |
Codec must support rotation through the operation extension. |
EOptionExtMirrorHorizontalAxis | 0x0800 |
Codec must support horizontal mirror through the operation extension. |
EOptionExtMirrorVerticalAxis | 0x1000 |
Codec must support vertical mirror through the operation extension. |
EOptionExtScaling | 0x2000 |
Codec must support the scaling extension. |
EOptionExtReserved7 | 0x4000 |
Reserved. |
EOptionExtReserved8 | 0x8000 |
Reserved. |
EOptionPngMissingiENDFail | 0x010000 |
Requests that decode always fails for Png images without an iEND chunk. |
EOptionWmfIgnoreViewportMetaData | 0x020000 |
Allows WMF codec to ignore any SETVIEWPORTORG, SETVIEWPORTEXT, SCALEVIEWPORTEXT or OFFSETVIEWPORTORG commands in the metafile and allows scaling to destination bitmap. |
EOptionAutoRotate | 0x040000 |
Requests that codec applies the auto rotation when decoding according to the orientation tag in the image Exif header. |
EOptionOptimisedPartialImageDecoding | 0x80000 |
Requests the Codec to do optimised partial image decoding, whenever partial decoding is needed. |
IMPORT_C | ~CImageDecoder | ( | ) | [virtual] |
Destructor for this class.
If using a local file session, it closes it. It also informs ECom that has finished with the decoder instance.
Frees all resources owned by the object prior to its destruction.
IMPORT_C TImageConvStreamedDecode * | BlockStreamerL | ( | ) |
Get the extension interface for block streaming on the image.
See also: TImageConvStreamedDecode
Leave Codes | |
---|---|
KErrNotSupported | if loaded codec plugin does not support this optional extension. |
Other | system wide errors. |
IMPORT_C void | Cancel | ( | ) |
Cancels any conversions currently in progress (Cancel is synchronous).
IMPORT_C void | ContinueConvert | ( | TRequestStatus * | aRequestStatus | ) | [virtual] |
Continue decoding a frame and/or mask after new image data was added to the source file or descriptor and a previous call to Convert() or ContinueConvert() returned KErrUnderflow.
Parameters | |
---|---|
aRequestStatus | Request status. On completion contains an error code. KErrNone if frame was decoded successfully, KErrUnderflow if the frame was partially decoded otherwise another of the system-wide error codes. |
IMPORT_C void | ContinueProcessingHeaderL | ( | ) |
Continue processing image headers after new image data was added to the source file or descriptor.
See also: IsImageHeaderProcessingComplete()
IMPORT_C void | Convert | ( | TRequestStatus * | aRequestStatus, |
CFbsBitmap & | aDestination, | |||
TInt | aFrameNumber = 0 | |||
) | [virtual] |
Start decoding an image frame asynchronously.
If the operations completes with KErrUnderflow, then there is insufficient information in the descriptor. In this situation, ContinueConvert() should be called repeatedly until the descriptor has accumulated enough information for ContinueConvert() to complete with KErrNone.It is the responsibility of the caller to ensure that the original data source used to create this decoder object gets enough information. If there is no data available then a caller can ignore this error code and use partially decoded image.
As most codec plugins support downscaling the image but not upscaling, the standard behaviour (i.e. no requested transformations) for codecs begins with the size of the destination bitmap passed to CImageDecoder::Convert being inspected, and:
1. If the destination size matches the frame size of the image then the image is decoded full size into the destination bitmap.
2. If the destination size is larger than the frame size of the image then the image is decoded full size into the destination bitmap with no upscaling. The image origin is aligned with the top left corner of the bitmap and any area in the bitmap to the bottom and right of image is left in its initialised state.
3. If the destination size is smaller than the frame size of the image then a reduction factor is calculated and the image is scaled down (1/2, 1/4, 1/8 size) whilst maintaining the aspect ratio of the image. The size is the next smallest size that will fit in the destination bitmap. The use case for this is when the client wants to pass in the screen size of device and have the image scaled to fill as much of the screen as possible. However, if the extension interfaces (clipping, scale, operation) are used then the additional behaviour below applies.
4. If the extension interfaces for clipping rectangle and/or operation are applied, but not scaling, then the size of the destination bitmap for an unscaled image can be obtained via CImageDecoder::GetDestinationSize. Lets call that SizeA. The same rules apply as given in 1, 2, 3 above resulting in a down-scaled destination if the destination bitmap is smaller than SizeA.
5. If the extension interface for scaling is called via one of the two TImageConvScaler::SetScalingL(.. functions then it is required that the destination size is obtained through CImageDecoder::GetDestinationSize and that a destination bitmap of that size is passed to CImageDecoder::Convert. Failure to do this will cause the decoder to fail with KErrArgument. This rule holds if clipping and/or operation is applied as well as scaling.
Parameters | |
---|---|
aRequestStatus | Request status. On completion contains an error code. KErrNone if frame was decoded successfully, KErrUnderflow if the frame was partially decoded otherwise another of the system-wide error codes. |
aDestination | A bitmap that will contain the decoded frame. |
aFrameNumber | The frame in a multi-frame image to decode (optional, defaults to zero). |
IMPORT_C void | Convert | ( | TRequestStatus * | aRequestStatus, |
CFbsBitmap & | aDestination, | |||
CFbsBitmap & | aDestinationMask, | |||
TInt | aFrameNumber = 0 | |||
) | [virtual] |
Start decoding an image frame and mask asynchronously.
If the operations completes with KErrUnderflow, then there is insufficient information in the descriptor. In this situation, ContinueConvert() should be called repeatedly until the descriptor has accumulated enough information for ContinueConvert() to complete with KErrNone.It is the responsibility of the caller to ensure that the original data source used to create this decoder object gets enough information. If there is no data available then a caller can ignore this error code and use partially decoded image.
See also: TFrameInfo
Parameters | |
---|---|
aRequestStatus | Request status. On completion contains an error code. KErrNone if frame was decoded successfully, KErrUnderflow if the frame was partially decoded otherwise another of the system-wide error codes. |
aDestination | A bitmap that will contain the decoded frame. |
aDestinationMask | A bitmap that will contain the decoded frame mask. |
aFrameNumber | The frame in multi-frame image to decode (optional, defaults to zero). |
IMPORT_C void | CustomAsync | ( | TRequestStatus * | aRequestStatus, |
TInt | aParam | |||
) | [protected] |
Sets up background convert cycle, bypassing Convert(). A call to this will result in a call to the associated CImageDecoderPlugin::InitCustomAsyncL(aParam), which if successful will start background processing. This function uses the same mechanism as Convert(), and therefore cannot be used concurrently. Cancel() etc work as expected.
Note: This function is intended for use by plugin writers only.
Parameters | |
---|---|
aRequestStatus | Request status. On completion contains an error code. KErrNone if the bitmap was successfully decoded, otherwise another of the system-wide error codes. |
aParam | Interpretation dependent on plugin. |
IMPORT_C void | CustomSyncL | ( | TInt | aParam | ) | [protected] |
Calls CImageDecoderPlugin::HandleCustomSyncL(aParam) that executes user defined plugin specific functions. Subsequent behaviour depends on the CImageDecoderPlugin class.
This function is part of the support for extended codecs for use within classes derived from CImageDecoder.
Note: This function is intended for use by plugin writers only.
See also: CImageDecoderPlugin::HandleCustomSyncL()
Parameters | |
---|---|
aParam | Interpretation dependent on plugin. |
IMPORT_C CImageDecoder * | DataNewL | ( | RFs & | aFs, |
const TDesC8 & | aSourceData, | |||
const TDesC8 & | aMIMEType, | |||
const TOptions | aOptions = EOptionNone | |||
) | [static] |
Create a decoder for the image in the source buffer. The client supplies a MIME type which will be used to try and select an appropriate plugin decoder. If a decoder is found it is created and then used to scan the beginning of the image file.
See also: TOptions
Parameters | |
---|---|
aFs | A reference to a file server session for the decoder to use. |
aSourceData | The buffer containing the image to be decoded. Note that the framework doesn't take a copy of the actual data, therefore both the descriptor object and the data must persist during decoding. |
aMIMEType | The MIME type of the image in the file(used to determine the plugin to create). |
aOptions | The decoder options to use. Specifying one of more extension options (for example EOptionExtCrop) can be used to cause the to cause a plugin to load which supports the image type and supports the requested extensions. |
Leave Codes | |
---|---|
KEComErrNoInterfaceIdentified | ECom could not find the specified interface. |
KErrNotFound | No appropriate plugin decoder for this image has been found. |
IMPORT_C CImageDecoder * | DataNewL | ( | RFs & | aFs, |
const TDesC8 & | aSourceData, | |||
const TOptions | aOptions = EOptionNone, | |||
const TUid | aImageType = TUid::Null(), | |||
const TUid | aImageSubType = TUid::Null(), | |||
const TUid | aDecoderUid = TUid::Null() | |||
) | [static] |
Creates a decoder for the image in the source buffer.
If the client supplies an image type (and sub-type, if applicable) or decoder UID, these will be used to try and select an appropriate plugin decoder. If not, then the selection will be done by matching the image header from the buffer. If it finds a decoder, it is created and then used to scan the beginning of the image buffer.
See also: KUidICLJpegEXIFInterface KUidICLJpegImageFrameInterface
See also: TOptions
Parameters | |
---|---|
aFs | A reference to a file server session for the decoder to use. |
aSourceData | The buffer containing the image to be decoded. Note that the framework doesn't take a copy of the actual data, therefore both the descriptor object and the data must persist during decoding. |
aOptions | Decoder options to use. |
aImageType | The image type of the image in the file (optional, defaults to KNullUid). |
aImageSubType | The image sub-type of the image in the file (optional, defaults to KNullUid). |
aDecoderUid | The implementation UID for a specific codec or a decoder/encoder class UID (optional, defaults to KNullUid). If this option is selected for a specific codec the image type and image sub type for the displayer must be supplied. When loading plugins by class UID the image type and image subtype are not mandatory and the first valid plugin from the list of available plugins with the specified class UID will be loaded. |
Leave Codes | |
---|---|
KErrUnderflow | Not enough data in descriptor to identify which plugin decoder to use. |
KErrNotFound | No appropriate plugin decoder for this image has been found. |
KEComErrNoInterfaceIdentified | ECom could not find the specified interface. |
Panic Codes | |
---|---|
ImageConversion | 19 No base type given for sub-type. |
IMPORT_C CImageDecoder * | FileNewL | ( | RFs & | aFs, |
const TDesC & | aSourceFilename, | |||
const TDesC8 & | aMIMEType, | |||
const TOptions | aOptions = EOptionNone | |||
) | [static] |
Create a decoder for the image in the named file. The client supplies a MIME type which will be used to try and select an appropriate plugin decoder. If it finds a decoder it creates it and then goes on to use that decoder to scan the beginning of the image file.
If any file related errors are encountered opening the specified file, this function leaves with an appropriate file related leave code.
See also: TOptions
Parameters | |
---|---|
aFs | A reference to a file server session for the decoder to use. |
aSourceFilename | The name of the file to be decoded. |
aMIMEType | The MIME type of the image in the file. |
aOptions | Decoder options to use. |
Leave Codes | |
---|---|
KEComErrNoInterfaceIdentified | ECom could not find the specified interface. |
KErrNotFound | Either the specific plugin decoder for this file hasn't been found, or the file itself is missing. |
IMPORT_C CImageDecoder * | FileNewL | ( | RFs & | aFs, |
const TDesC & | aSourceFilename, | |||
const TOptions | aOptions = EOptionNone, | |||
const TUid | aImageType = TUid::Null(), | |||
const TUid | aImageSubType = TUid::Null(), | |||
const TUid | aDecoderUid = TUid::Null() | |||
) | [static] |
Create a decoder for the image in the named file.
If the client supplies an image type (and sub-type, if applicable) or decoder UID, these will be used to try and select an appropriate plugin decoder. If not, then the selection will be done by matching the image header in the file. If it finds a decoder, it will be created and then used to scan the beginning of the image file.
Note: Every image format has two IDs, known as the type and the sub-type (although generally the sub-type is KNullUid). To retrieve a list of supported types and sub-types that can be decoded, use the static functions GetImageTypesL() and GetImageSubTypesL().
See also: KUidICLJpegEXIFInterface KUidICLJpegImageFrameInterface
See also: TOptions
Parameters | |
---|---|
aFs | A reference to a file server session for the decoder to use. |
aSourceFilename | The name of the file to be decoded. |
aOptions | Decoder options to use. |
aImageType | The image type of the image in the file (optional, defaults to KNullUid). |
aImageSubType | The image sub-type of the image in the file (optional, defaults to KNullUid). |
aDecoderUid | The implementation UID for a specific codec or a decoder/encoder class UID (optional, defaults to KNullUid). If this option is selected for a specific codec the image type and image sub type for the displayer must be supplied. When loading plugins by class UID the image type and image subtype are not mandatory and the first valid plugin from the list of available plugins with the specified class UID will be loaded. |
Leave Codes | |
---|---|
KErrUnderflow | Not enough data in file to identify which plugin decoder to use. |
KErrNotFound | Either the appropriate plugin decoder for this file hasn't been found, or the file itself is missing. |
KEComErrNoInterfaceIdentified | ECom could not find the specified interface. |
Panic Codes | |
---|---|
ImageConversion | 19 No base type given for sub-type. |
IMPORT_C CImageDecoder * | FileNewL | ( | RFs & | aFs, |
const TDesC & | aSourceFilename, | |||
const TDesC8 & | aMIMEType, | |||
ContentAccess::TIntent | aIntent, | |||
const TOptions | aOptions = EOptionNone | |||
) | [static] |
Create a decoder for the image in the named file. The client supplies a MIME type which will be used to try and select an appropriate plugin decoder. If it finds a decoder it creates it and then goes on to use that decoder to scan the beginning of the image file.
Parameters | |
---|---|
aFs | A reference to a file server session for the decoder to use. |
aSourceFilename | The name of the file to be decoded. |
aMIMEType | The MIME type of the image in the file. |
aIntent | The DRM Intent for image conversion. |
aOptions | The decoder options to use. |
Leave Codes | |
---|---|
KEComErrNoInterfaceIdentified | ECom could not find the specified interface. |
KErrNotFound | Either the specific plugin decoder for this file hasn't been found, or the file itself is missing. |
IMPORT_C CImageDecoder * | FileNewL | ( | RFs & | aFs, |
const TDesC & | aSourceFilename, | |||
ContentAccess::TIntent | aIntent, | |||
const TOptions | aOptions = EOptionNone, | |||
const TUid | aImageType = TUid::Null(), | |||
const TUid | aImageSubType = TUid::Null(), | |||
const TUid | aDecoderUid = TUid::Null() | |||
) | [static] |
Creates a decoder for the image in the named file. If the client supplies an image type (and sub-type, if applicable) or decoder UID, these will be used to try and select an appropriate plugin decoder. If not, then the selection will be done by matching the image header in the file. If it finds a decoder it creates it and then goes on to use that decoder to scan the beginning of the image file.
See also: KUidICLJpegEXIFInterface KUidICLJpegImageFrameInterface
See also: TOptions
Parameters | |
---|---|
aFs | A reference to a file server session for the decoder to use. |
aSourceFilename | The name of the file to be decoded. |
aIntent | The DRM Intent for image conversion. |
aOptions | The decoder options to use. See TOptions. |
aImageType | The image type of the image in the file (optional, defaults to KNullUid). |
aImageSubType | The image sub-type of the image in the file (optional, defaults to KNullUid). |
aDecoderUid | The implementation UID for a specific codec or a decoder/encoder class UID (optional, defaults to KNullUid). If this option is selected for a specific codec the image type and image sub type for the displayer must be supplied. When loading plugins by class UID the image type and image subtype are not mandatory and the first valid plugin from the list of available plugins with the specified class UID will be loaded. |
Leave Codes | |
---|---|
KErrUnderflow | Not enough data in file to identify which plugin decoder to use. |
KErrNotFound | Either the appropriate plugin decoder for this file hasn't been found, or the file itself is missing. |
KEComErrNoInterfaceIdentified | ECom could not find the specified interface. |
Panic Codes | |
---|---|
ImageConversion | 19 No base type given for sub-type. |
IMPORT_C CImageDecoder * | FileNewL | ( | RFile & | aFile, |
const TDesC8 & | aMIMEType, | |||
ContentAccess::TIntent | aIntent, | |||
const TOptions | aOptions = EOptionNone | |||
) | [static] |
Create a decoder for the image in the named file. The client supplies a MIME type which will be used to try and select an appropriate plugin decoder. If it finds a decoder it creates it and then goes on to use that decoder to scan the beginning of the image file.
If any file related errors are encountered opening the specified file, this function leaves with an appropriate file related leave code.
See also: TOptions
Parameters | |
---|---|
aFile | The handle of the file to decode |
aMIMEType | The MIME type of the image in the file. |
aIntent | The DRM Intent to open the file with |
aOptions | Decoder options to use. |
Leave Codes | |
---|---|
KEComErrNoInterfaceIdentified | ECom could not find the specified interface. |
KErrNotFound | Either the appropriate plugin decoder for this file hasn't been found, or the file itself is missing. |
IMPORT_C CImageDecoder * | FileNewL | ( | RFile & | aFile, |
ContentAccess::TIntent | aIntent, | |||
const TOptions | aOptions = EOptionNone, | |||
const TUid | aImageType = TUid::Null(), | |||
const TUid | aImageSubType = TUid::Null(), | |||
const TUid | aDecoderUid = TUid::Null() | |||
) | [static] |
Creates a decoder for the image in the named file. If the client supplies an image type (and sub-type, if applicable) or decoder UID, these will be used to try and select an appropriate plugin decoder. If not, then the selection will be done by matching the image header in the file. If it finds a decoder it creates it and then goes on to use that decoder to scan the beginning of the image file.
See also: KUidICLJpegEXIFInterface KUidICLJpegImageFrameInterface
See also: TOptions
Parameters | |
---|---|
aFile | The handle of the file to decode |
aIntent | The DRM Intent for image conversion. |
aOptions | The decoder options to use. See TOptions. |
aImageType | The image type of the image in the file (optional, defaults to KNullUid). |
aImageSubType | The image sub-type of the image in the file (optional, defaults to KNullUid). |
aDecoderUid | The implementation UID for a specific codec or a decoder/encoder class UID (optional, defaults to KNullUid). If this option is selected for a specific codec the image type and image sub type for the displayer must be supplied. When loading plugins by class UID the image type and image subtype are not mandatory and the first valid plugin from the list of available plugins with the specified class UID will be loaded. |
Leave Codes | |
---|---|
KErrUnderflow | Not enough data in file to identify which plugin decoder to use. |
KErrNotFound | Either the appropriate plugin decoder for this file hasn't been found, or the file itself is missing. |
KEComErrNoInterfaceIdentified | ECom could not find the specified interface. |
Panic Codes | |
---|---|
ImageConversion | 19 No base type given for sub-type. |
IMPORT_C CImageDecoder * | FileNewL | ( | RFs & | aFs, |
const TMMSource & | aFileSource, | |||
const TDesC8 & | aMIMEType, | |||
const TOptions | aOptions = EOptionNone | |||
) | [static] |
Create a decoder for the image in the named file. The client supplies a MIME type which will be used to try and select an appropriate plugin decoder. If it finds a decoder it creates it and then goes on to use that decoder to scan the beginning of the image file.
Parameters | |
---|---|
aFs | A reference to a file server session for the decoder to use. |
aFileSource | An interface between filename based and file handle. |
aMIMEType | The MIME type of the image in the file. |
aOptions | The decoder options to use. Specifying one of more extension options (for example EOptionExtCrop) can be used to cause the to cause a plugin to load which supports the image type and supports the requested extensions. |
Leave Codes | |
---|---|
KErrNotSupported | A matching decoder could not be found for the MIME type. |
KErrNotFound | Either the specific plugin decoder for this source image hasn't been found, or the source image itself is missing, or a plugin with the requested extensions cannot be found. |
IMPORT_C CImageDecoder * | FileNewL | ( | RFs & | aFs, |
const TMMSource & | aFileSource, | |||
const TOptions | aOptions = EOptionNone, | |||
const TUid | aImageType = TUid::Null(), | |||
const TUid | aImageSubType = TUid::Null(), | |||
const TUid | aDecoderUid = TUid::Null() | |||
) | [static] |
Create a decoder for the image in the named source.
See also: KUidICLJpegEXIFInterface KUidICLJpegImageFrameInterface
Parameters | |
---|---|
aFs | A reference to a file server session for the decoder to use. |
aFileSource | An interface between filename based and file handle. |
aOptions | The decoder options to use. Specifying one of more extension options (for example EOptionExtCrop) can be used to cause the to cause a plugin to load which supports the image type and supports the requested extensions. |
aImageType | The image type of the image in the file. |
aImageSubType | The image sub-type of the image in the file. |
aDecoderUid | The implementation UID for a specific codec or a decoder/encoder class UID. |
Leave Codes | |
---|---|
KErrNotSupported | A matching decoder could not be found for the MIME type. |
KErrNotFound | Either the specific plugin decoder for this source image hasn't been found, or the source image itself is missing. |
KEComErrNoInterfaceIdentified | ECom could not find the specified interface. |
Panic Codes | |
---|---|
ImageConversion | 19 No base type given for sub-type. |
Return a particular comment attached to a given frame of the image.
The desired order of calling methods should be FrameCount(),NumberOfFrameComments() and then FrameCommentL().
Use FrameCount() to retrieve the number of frames in the image to ensure that a valid aFrameNumber is used.
Use NumberOfFrameComments() to retrieve the number of comments attached to a given frame of the image (as opposed to the whole image),to ensure that a valid aCommentNumber is used.
Ownership of the returned buffer is transferred to the caller.
For further informantion on panic categories, please see the note in CImageDecoder::IsImageHeaderProcessingComplete().
See also: IsImageHeaderProcessingComplete() FrameCount() NumberOfFrameComments()
Parameters | |
---|---|
aFrameNumber | The frame number within the image from which to retrieve the specified comment. |
aCommentNumber | The comment number to retrieve from the specified frame. |
Panic Codes | |
---|---|
ImageConversion | 10 aFrameNumber is not valid. See |
ImageConversion | 13 Header processing has not completed. See |
ImageConversion | 14 aCommentNumber is not valid. See |
IMPORT_C TInt | FrameCount | ( | ) | const |
Return the number of frames in the image being decoded.
This function can be called immediately after the call to create the decoder, thus enabling the caller to know how many frames need to be converted. Client may have to call IsImageHeaderProcessingComplete() & ContinueProcessingHeaders() to ensure all all data is available.
IMPORT_C const CFrameImageData & | FrameData | ( | TInt | aFrameNumber = 0 | ) | const |
Returns additional plugin specific information on a specified frame.
The plugin specific information usually covers advanced image features such as image quality, advanced colour settings and so on.
Use FrameCount() to determine how many frames are contained in the image before using this function.
See also: CImageDecoder::FrameCount()
Parameters | |
---|---|
aFrameNumber | The frame number. |
Panic Codes | |
---|---|
ImageConversion | 10 Frame number outside the range 0 to |
IMPORT_C const TFrameInfo & | FrameInfo | ( | TInt | aFrameNumber = 0 | ) | const |
Return the frame info for a specified frame of the image.
This function can be called immediately after the call to create the decoder, thus enabling the caller to know about each frame in advance of converting it.
The returned information contains details of the size of the image, the dimensions of the frame, its colour depth and so on. More advanced information may be available for the image using FrameData().
Use FrameCount() to determine how many frames are contained in the image before using this function.
See also: CImageDecoder::FrameCount()
Parameters | |
---|---|
aFrameNumber | The frame number. |
Panic Codes | |
---|---|
ImageConversion | 10 Frame number outside the range 0 to |
IMPORT_C CFrameInfoStrings * | FrameInfoStringsL | ( | TInt | aFrameNumber = 0 | ) |
Return the formatted frame information strings for a specific frame. Ownership is transferred to the caller.
Parameters | |
---|---|
aFrameNumber | The frame number from which to retrieve the formatted information string. |
IMPORT_C CFrameInfoStrings * | FrameInfoStringsLC | ( | TInt | aFrameNumber = 0 | ) |
Return the formatted frame information strings for a specific frame and leave it on the cleanup stack.
Ownership is transferred to the caller.
Parameters | |
---|---|
aFrameNumber | The frame number from which to retrieve the formatted information string. |
Get the size of the decoded image for the given frame. The calculation will account for any clipping rectangle set, scaling applied through the TImageConvScaler extension and any operation applied through TImageConvOperation. If TImageConvScaler::SetScalingL(.. has been called then the size of the bitmap passed to CImageDecoder::Convert must match the size returned from this function.
Parameters | |
---|---|
aSize | Returns the size of the decoded image. |
aFrameNumber | The frame number. |
IMPORT_C void | GetFileTypesL | ( | RFileExtensionMIMETypeArray & | aFileExtensionArray | ) | [static] |
Get a list of the file extensions that can be decoded and their corresponding MIME types, based on the currently available decoder plugins.
Ownership of the array is passed to the caller so, before the array goes out of scope in the client, the caller must call ResetAndDestroy() on it to free the entries.
Parameters | |
---|---|
aFileExtensionArray | An empty array, into which this function will put a list of entries. Each entry will consist of a file extension string for which a decoder plugin has been found, accompanied by the primary MIME type and then any secondary MIME types (if present). |
IMPORT_C void | GetImageSubTypesL | ( | const TUid | aImageType, |
RImageTypeDescriptionArray & | aSubTypeArray | |||
) | [static] |
For a given basic image type, get a list of the sub image types that can be decoded, based on the currently available decoder plugins.
Ownership of the array is passed to the caller so, before the array goes out of scope in the client, the caller must call ResetAndDestroy() on it to free the entries.
Parameters | |
---|---|
aImageType | The basic image type for which you want a list of sub-types. |
aSubTypeArray | An empty array, into which this function will put a list of entries. Each entry will consist of the "display string" from the registry entry for a plugin that has been found and that is a decoder for a sub-type of the given basic image type, accompanied by the Uids for the sub type. The first Uid, for the basic type, will always correspond to aImageType. |
IMPORT_C void | GetImageTypesL | ( | RImageTypeDescriptionArray & | aImageTypeArray | ) | [static] |
Get a list of the basic image types that can be decoded, based on the currently available decoder plugins.
Ownership of the array is passed to the caller so, before the array goes out of scope in the client, the caller must call ResetAndDestroy() on it to free the entries.
Parameters | |
---|---|
aImageTypeArray | An empty array, into which this function will put a list of entries. Each entry will consist of the "display string" from the registry entry for a plugin that has been found and that is a decoder for a basic image type, accompanied by the Uids for that image type. Since we asked for basic types the second Uid, for the image sub-type, will always be zero. |
IMPORT_C CImplementationInformationType * | GetImplementationInformationL | ( | TUid | aImplementationUid | ) | [static] |
Gets the implementation information for a specific decoder plugin
Ownership of the implementation information is passed to the caller.
Parameters | |
---|---|
aImplementationUid | The decoder implementation UID for which to retrieve implementation information |
IMPORT_C void | GetInterfaceImplementationsL | ( | const RUidDataArray & | aRequiredUids, |
RUidDataArray & | aImplArray | |||
) | [static] |
Gets a list of decoder implementations UIDs which have a set of specific capabilities defined by UIDs.
Parameters | |
---|---|
aRequiredUids | The array containing the required UIDs (properties, image type, image sub-type or class UIDs). |
aImplArray | The array containing the implementation UIDs of the available decoder plugins with the required UIDs. The caller has the ownership of the array. |
IMPORT_C void | GetInterfaceImplementationsL | ( | const TUid * | aRequiredUids, |
const TInt | aLength, | |||
RUidDataArray & | aImplArray | |||
) | [static] |
Gets a list of decoder implementations UIDs which have a set of specific capabilities defined by UIDs.
Parameters | |
---|---|
aRequiredUids | The array containing the required UIDs (properties, image type, image sub-type or class UIDs). |
aLength | The length of aRequiredUids (number of required UIDs). |
aImplArray | The array containing the implementation UIDs of the available decoder plugins with the required UIDs. The caller has the ownership of the array. |
Get the primary MIME type of the decoder that will be used to decode a descriptor. Some file types (like OTA or WBPM), which do not have unique pattern in their header may not be recognised. Such files are not supported by this API
Parameters | |
---|---|
aImageData | A descriptor containing the image data for which a MIME type has to be determined. |
aMimeType | An empty descriptor in which the MIME type assosiated with the file will be returned. Ownership is passed to the caller. |
Get the primary MIME type of the decoder that will be used to decode a file. Some file types (like OTA or WBPM), which do not have unique pattern in their header may not be recognised, in case when the source file name doesn't have extension or, extension is not common to that file type. Such files are not supported by this API.
Parameters | |
---|---|
aFs | A reference to a file server session to use. |
aFileName | The name of the file for which a MIME type has to be determined |
aMimeType | An empty descriptor in which the MIME type assosiated with the file will be returned. Ownership is passed to the caller. |
IMPORT_C void | GetPluginPropertiesL | ( | const TUid | aImplementationUid, |
RUidDataArray & | aPropertiesArray | |||
) | [static] |
Gets a list of the properties of a specific decoder plugin.
Parameters | |
---|---|
aImplementationUid | The decoder implementation UID for which the plugin properties need to be retrieved. |
aPropertiesArray | The array of plugin properties owned by the specified decoder. The caller has the ownership of the array. |
Return a particular comment attached to the image.
Ownership of the returned buffer is transferred to the caller. Use NumberOfImageComments() to determine how many (if any) comments are contained within the image.
For further informantion on panic categories, please see the note in CImageDecoder::IsImageHeaderProcessingComplete().
See also: IsImageHeaderProcessingComplete() NumberOfImageComments()
Parameters | |
---|---|
aCommentNumber | The comment number. |
Panic Codes | |
---|---|
ImageConversion | 12 Comments are not supported. See |
ImageConversion | 13 Header processing has not completed. See |
ImageConversion | 14 aCommentNumber is not valid. See |
Retrieves the image type and sub-type for a given frame of the image that has just been decoded.
For further informantion on panic categories, please see the note in CImageDecoder::IsImageHeaderProcessingComplete().
Parameters | |
---|---|
aFrameNumber | The frame number for which type information should be retreived. |
aImageType | On return contains the image type UID for the specified frame. |
aImageSubType | On return contains the image sub-type UID if there is one (or KNullUid if there is not). |
Panic Codes | |
---|---|
ImageConversion | 10 aFrameNumber is not valid. See |
IMPORT_C TUid | ImplementationUid | ( | ) | const |
Return the implementation UID of the decoder being used to decode the image.
IMPORT_C TBool | IsImageHeaderProcessingComplete | ( | ) | const |
Return the status of the image.
If the image is incomplete EFalse will be returned. The client should continue to supply more data and call ContinueProcessingHeaders() until ETrue is returned.
Panic categories: Many CImageDecoder functions are dependent upon this function returning ETrue before they can successfully be called. If the client calls one of these dependent functions, then that function call may panic with either the 'ImageConversion' panic category or a decoder plugin specific panic category, for example: 'BMPConvertPlugin', 'GIFConvertPlugin', 'ICOConvertPlugin', 'JPEGConvertPlugin', 'MBMConvertPlugin', 'OTAConvertPlugin', 'PNGConvertPlugin', 'TIFFConvertPlugin', 'WBMPConvertPlugin', 'WMFConvertPlugin'.
Return the number of comments attached to a given frame of the image (as opposed to the whole image).
Use FrameCount() to retrieve the number of frames in the image to ensure that a valid aFrameNumber is used.
For further informantion on panic categories, please see the note in CImageDecoder::IsImageHeaderProcessingComplete().
Parameters | |
---|---|
aFrameNumber | The frame number. |
Panic Codes | |
---|---|
ImageConversion | 10 aFrameNumber is not valid. See |
ImageConversion | 13 Header processing has not completed. See |
IMPORT_C TInt | NumberOfImageComments | ( | ) | const |
Return the number of comments attached to the image (as opposed to a particular frame).
For further informantion on panic categories, please see the note in CImageDecoder::IsImageHeaderProcessingComplete().
See also: IsImageHeaderProcessingComplete()
Panic Codes | |
---|---|
ImageConversion | 13 Header processing has not completed. See |
IMPORT_C TImageConvOperation * | OperationL | ( | ) |
The order of post processing operations when applied for decoding is
1. Clip the image
2. Scale the image
3. Operate on the image
See also: CImageDecoder::SetClippingRectL() TImageConvScaler TImageConvOperation
Leave Codes | |
---|---|
KErrNotSupported | if loaded codec plugin does not support this optional extension. |
Other | system wide errors |
IMPORT_C CImageDecoderPlugin * | Plugin | ( | ) | const [protected] |
Returns associated CImageDecoderPlugin.
Allows the extended CImageDecoder object to talk to its CImageDecoderPlugin equivalent.
Note: This function is intendend for use by plugin writers only.
IMPORT_C void | Prepare | ( | TRequestStatus * | aRequestStatus | ) |
Optional call from client which may be made on the decoder to allow analysis of image prior to calling Convert.
Should be called once decode is fully set up e.g. clipping rectangle set.
See also: CImageDecoder::Convert
Parameters | |
---|---|
aRequestStatus | Request status. On completion this contains an error code. This is KErrNone if the frame was analyzed successfully, KErrNotSupported if the codec does not support analysis, or a system-wide error code. |
IMPORT_C TInt | ReducedSize | ( | const TSize & | aOriginalSize, |
TInt | aReductionFactor, | |||
TSize & | aReducedSize | |||
) | const |
Calculates reduced size of the decoded bitmap based on the input parameters and updates aReducedSize with this value.
Parameters | |
---|---|
aOriginalSize | A reference to the original size of an image. |
aReductionFactor | The Reduction Factor to be applied |
aReducedSize | A reference to the new size of the image. |
Function to calculate the reduction factor based on the input parameters.
Parameters | |
---|---|
aOriginalSize | A reference to the original size of an image. |
aReducedSize | A reference to the new size of an image. |
IMPORT_C TImageConvScaler * | ScalerL | ( | ) |
Get the extension interface for scaling the image.
See also: TImageConvScaler
See also: note under CImageDecoder::OperationL.
Leave Codes | |
---|---|
KErrNotSupported | if loaded codec plugin does not support this optional extension. |
Other | system wide errors. |
IMPORT_C TInt | SetAgentProperty | ( | ContentAccess::TAgentProperty | aProperty, |
TInt | aValue | |||
) |
Sets the properties for the Image decoder.
Parameters | |
---|---|
aProperty | The property to set. |
aValue | The value of the property. |
IMPORT_C void | SetClippingRectL | ( | const TRect * | aClipRect | ) |
Sets the area of interest of the image to be decoded. This function can leave with any of the system-wide error codes.
See also: TRect::IsEmpty() TRect::IsNormalized() TRect::Normalize()note under CImageDecoder::OperationL
Parameters | |
---|---|
aClipRect | A pointer to a TRect that specifies the location and size of the region to be decoded. This rectangle must have positive width and height values as per TRect::IsNormalized() and TRect::Normalize(). Passing in a NULL value will clear the clipping rectangle. Note that a clipping rectangle may not be valid for all frames of an image. |
Leave Codes | |
---|---|
KErrNotSupported | This function is not supported. |
KErrArgument | Returned if the clipping rectangle: a) is empty (i.e. IsEmpty() returns ETrue) b) is not normalised (i.e. IsNormalized() returns EFalse) c) has coordinates that are not located within, or on, the coodinates of at least one frame of the original image. d) has a width or a height of 0 |
IMPORT_C TInt | SetDecoderThreadPriority | ( | TThreadPriority | aPriority | ) |
Parameters | |
---|---|
aPriority | a new value for worker thread priority |
IMPORT_C void | SetImageTypeL | ( | TInt | aImageType | ) |
Set the source image type, this can be any value from TImageType. It can leave with a system wide error. Typical leaves are documented below.
Parameters | |
---|---|
aImageType | An image type from TImageType to denote source image that the decoder should use. |
Leave Codes | |
---|---|
KErrNotFound | If the image for the type specified is not found. |
KErrCorrupt | For a corrupt image. In the case of failing to change the source image from a valid EImageTypeMain image to a corrupt EImageTypeThumbnail, the decoder resets the image type back to the valid EImageTypeMain. |