class CImageDecoder : public CBase |
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.
Protected Member Functions | |
---|---|
CImageDecoder () | |
IMPORT_C void | CustomAsync ( TRequestStatus *, TInt ) |
IMPORT_C void | CustomSyncL ( TInt ) |
IMPORT_C CImageDecoderPlugin * | Plugin () |
Public Member Enumerations | |
---|---|
enum | TImageType { EImageTypeThumbnail = 0x01, EImageTypeMain = 0x02 } |
enum |
TOptions
{
EOptionNone = 0x00, EOptionNoDither = 0x01, EOptionAlwaysThread = 0x02, EOptionAllowZeroFrameOpen = 0x04, EAllowGeneratedMask = 0x08, EPreferFastDecode = 0x10, EOptionMngSubframesNoLoops = 0x20, EOptionUseFrameSizeInPixels = 0x40, EOptionIgnoreExifMetaData = 0x80, EOptionExtCrop = 0x0100, EOptionExtStream = 0x0200, EOptionExtRotation = 0x0400, EOptionExtMirrorHorizontalAxis = 0x0800, EOptionExtMirrorVerticalAxis = 0x1000, EOptionExtScaling = 0x2000, EOptionExtReserved7 = 0x4000, EOptionExtReserved8 = 0x8000, EOptionPngMissingiENDFail = 0x010000, EOptionWmfIgnoreViewportMetaData = 0x020000, EOptionAutoRotate = 0x040000 } |
Private Attributes | |
---|---|
MImageDecoderRelay * | iRelay |
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 | ( | ) |
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.
TRequestStatus * 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.
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.
TRequestStatus * 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. |
CFbsBitmap & aDestination | A bitmap that will contain the decoded frame. |
TInt aFrameNumber = 0 | 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.
TRequestStatus * 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. |
CFbsBitmap & aDestination | A bitmap that will contain the decoded frame. |
CFbsBitmap & aDestinationMask | A bitmap that will contain the decoded frame mask. |
TInt aFrameNumber = 0 | 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.
TRequestStatus * aRequestStatus | Request status. On completion contains an error code. KErrNone if the bitmap was successfully decoded, otherwise another of the system-wide error codes. |
TInt 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.
TInt aParam | Interpretation dependent on plugin. |
CImageDecoder * | DataDecoderNewL | ( | const CImplementationInformation & | aDecoderInfo, |
RFs & | aFs, | |||
const TDesC8 & | aSourceData, | |||
const TOptions | aOptions | |||
) | [private, static] |
Create a construct that can create a decoder and call functions to initialise the decoder with the image data.
const CImplementationInformation & aDecoderInfo | Implementation information for the decoder to be created. |
RFs & aFs | A file server session for the decoder to use. |
const TDesC8 & aSourceData | The data to decode. |
const TOptions aOptions | Options the decoder must use. |
CImageDecoder * | DataFindDecoderNewL | ( | const RImplInfoPtrArray & | aDecoderList, |
RFs & | aFs, | |||
const TDesC8 & | aSourceData, | |||
const TOptions | aOptions | |||
) | [private, static] |
Scan a sorted list of decoders for the first one that can decode the image.
const RImplInfoPtrArray & aDecoderList | A list of decoders that support the image format. |
RFs & aFs | A file server session for the decoder to use. |
const TDesC8 & aSourceData | The data to decode. |
const TOptions aOptions | Options to use during decoding. |
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.
RFs & aFs | A reference to a file server session for the decoder to use. |
const TDesC8 & 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. |
const TDesC8 & aMIMEType | The MIME type of the image in the file(used to determine the plugin to create). |
const TOptions aOptions = EOptionNone | 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. |
IMPORT_C CImageDecoder * | DataNewL | ( | RFs & | aFs, |
const TDesC8 & | aSourceData, | |||
const TOptions | aOptions = EOptionNone, | |||
const TUid | aImageType = KNullUid, | |||
const TUid | aImageSubType = KNullUid, | |||
const TUid | aDecoderUid = KNullUid | |||
) | [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.
RFs & aFs | A reference to a file server session for the decoder to use. |
const TDesC8 & 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. |
const TOptions aOptions = EOptionNone | Decoder options to use. |
const TUid aImageType = KNullUid | The image type of the image in the file (optional, defaults to KNullUid). |
const TUid aImageSubType = KNullUid | The image sub-type of the image in the file (optional, defaults to KNullUid). |
const TUid aDecoderUid = KNullUid | 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. |
void | DoGetMimeTypeL | ( | const TDesC & | aFileName, |
const TDesC8 & | aMatchString, | |||
TDes8 & | aMimeType | |||
) | [private, static] |
Get the MIME type for a given match string.
CImageDecoder * | FileDecoderNewL | ( | const CImplementationInformation & | aDecoderInfo, |
RFs & | aFs, | |||
const TDesC & | aSourceFilename, | |||
const TOptions | aOptions, | |||
const TDesC & | aUniqueId | |||
) | [private, static] |
Create a construct that can create a decoder and call functions to initialise the decoder with the image data.
const CImplementationInformation & aDecoderInfo | Implementation information for the decoder to be created. |
RFs & aFs | A file server session for the decoder to use. |
const TDesC & aSourceFilename | The filename of the file to decode. |
const TOptions aOptions | Options the decoder must use. |
const TDesC & aUniqueId |
CImageDecoder * | FileDecoderNewL | ( | const CImplementationInformation & | aDecoderInfo, |
RFile & | aFile, | |||
const TOptions | aOptions, | |||
const TDesC & | aUniqueId | |||
) | [private, static] |
Create a construct that can create a decoder and call functions to initialise the decoder with the image data.
const CImplementationInformation & aDecoderInfo | Implementation information for the decoder to be created. |
RFile & aFile | A file server session for the decoder to use. |
const TOptions aOptions | Options the decoder must use. |
const TDesC & aUniqueId | Identifier of file within a multi-part archive. |
CImageDecoder * | FileFindDecoderNewL | ( | const RImplInfoPtrArray & | aDecoderList, |
RFs & | aFs, | |||
const TDesC & | aSourceFilename, | |||
const TOptions | aOptions, | |||
const TDesC & | aUniqueId | |||
) | [private, static] |
Scans a sorted list of decoders for the first one that can decode the image.
const RImplInfoPtrArray & aDecoderList | A list of decoders that support the image format. |
RFs & aFs | A file server session for the decoder to use. |
const TDesC & aSourceFilename | The filename of the file to decode. |
const TOptions aOptions | The options to use during decoding. |
const TDesC & aUniqueId |
CImageDecoder * | FileFindDecoderNewL | ( | const RImplInfoPtrArray & | aDecoderList, |
RFile & | aFile, | |||
const TOptions | aOptions, | |||
const TDesC & | aUniqueId | |||
) | [private, static] |
Scans a sorted list of decoders for the first one that can decode the image.
const RImplInfoPtrArray & aDecoderList | A list of decoders that support the image format. |
RFile & aFile | A file server session for the decoder to use. |
const TOptions aOptions | The options to use during decoding. |
const TDesC & aUniqueId | Identifier of file within a multi-part archive. |
CImageDecoder * | FileNewImplL | ( | RFs & | aFs, |
const TDesC & | aSourceFilename, | |||
const TDesC8 & | aMIMEType, | |||
const TDesC & | aUniqueId, | |||
const ContentAccess::TIntent | aIntent, | |||
const TOptions | aOptions = EOptionNone | |||
) | [private, static] |
Creates 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.
RFs & aFs | A reference to a file server session for the decoder to use. |
const TDesC & aSourceFilename | The name of the file to be decoded. |
const TDesC8 & aMIMEType | The MIME type of the image in the file. |
const TDesC & aUniqueId | The object to open for reading. If the UniqueId is set to KNullDesC the entire file will be opened for reading with no transformation. |
const ContentAccess::TIntent aIntent | The DRM Intent for image conversion. |
const TOptions aOptions = EOptionNone | The decoder options to use. |
CImageDecoder * | FileNewImplL | ( | RFs & | aFs, |
const TDesC & | aSourceFilename, | |||
const TDesC & | aUniqueId, | |||
const ContentAccess::TIntent | aIntent, | |||
const TOptions | aOptions = EOptionNone, | |||
const TUid | aImageType = KNullUid, | |||
const TUid | aImageSubType = KNullUid, | |||
const TUid | aDecoderUid = KNullUid | |||
) | [private, 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.
RFs & aFs | A reference to a file server session for the decoder to use. |
const TDesC & aSourceFilename | The name of the file to be decoded. |
const TDesC & aUniqueId | The object to open for reading. If the UniqueId is set to KNullDesC the entire file will be opened for reading with no transformation. |
const ContentAccess::TIntent aIntent | The DRM Intent for image conversion |
const TOptions aOptions = EOptionNone | The decoder options to use. See TOptions. |
const TUid aImageType = KNullUid | The image type of the image in the file (optional, defaults to KNullUid). |
const TUid aImageSubType = KNullUid | The image sub-type of the image in the file (optional, defaults to KNullUid). |
const TUid aDecoderUid = KNullUid | 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. |
CImageDecoder * | FileNewImplL | ( | RFile & | aFile, |
const TDesC8 & | aMIMEType, | |||
const TDesC & | aUniqueId, | |||
const ContentAccess::TIntent | aIntent, | |||
const TOptions | aOptions = EOptionNone | |||
) | [private, static] |
CImageDecoder * | FileNewImplL | ( | RFile & | aFile, |
const TDesC & | aUniqueId, | |||
const ContentAccess::TIntent | aIntent, | |||
const TOptions | aOptions = EOptionNone, | |||
const TUid | aImageType = KNullUid, | |||
const TUid | aImageSubType = KNullUid, | |||
const TUid | aDecoderUid = KNullUid | |||
) | [private, static] |
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.
IMPORT_C CImageDecoder * | FileNewL | ( | RFs & | aFs, |
const TDesC & | aSourceFilename, | |||
const TOptions | aOptions = EOptionNone, | |||
const TUid | aImageType = KNullUid, | |||
const TUid | aImageSubType = KNullUid, | |||
const TUid | aDecoderUid = KNullUid | |||
) | [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() .
RFs & aFs | A reference to a file server session for the decoder to use. |
const TDesC & aSourceFilename | The name of the file to be decoded. |
const TOptions aOptions = EOptionNone | Decoder options to use. |
const TUid aImageType = KNullUid | The image type of the image in the file (optional, defaults to KNullUid). |
const TUid aImageSubType = KNullUid | The image sub-type of the image in the file (optional, defaults to KNullUid). |
const TUid aDecoderUid = KNullUid | 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. |
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.
RFs & aFs | A reference to a file server session for the decoder to use. |
const TDesC & aSourceFilename | The name of the file to be decoded. |
const TDesC8 & aMIMEType | The MIME type of the image in the file. |
ContentAccess::TIntent aIntent | The DRM Intent for image conversion. |
const TOptions aOptions = EOptionNone | The decoder options to use. |
IMPORT_C CImageDecoder * | FileNewL | ( | RFs & | aFs, |
const TDesC & | aSourceFilename, | |||
ContentAccess::TIntent | aIntent, | |||
const TOptions | aOptions = EOptionNone, | |||
const TUid | aImageType = KNullUid, | |||
const TUid | aImageSubType = KNullUid, | |||
const TUid | aDecoderUid = KNullUid | |||
) | [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.
RFs & aFs | A reference to a file server session for the decoder to use. |
const TDesC & aSourceFilename | The name of the file to be decoded. |
ContentAccess::TIntent aIntent | The DRM Intent for image conversion. |
const TOptions aOptions = EOptionNone | The decoder options to use. See TOptions. |
const TUid aImageType = KNullUid | The image type of the image in the file (optional, defaults to KNullUid). |
const TUid aImageSubType = KNullUid | The image sub-type of the image in the file (optional, defaults to KNullUid). |
const TUid aDecoderUid = KNullUid | 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. |
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.
IMPORT_C CImageDecoder * | FileNewL | ( | RFile & | aFile, |
ContentAccess::TIntent | aIntent, | |||
const TOptions | aOptions = EOptionNone, | |||
const TUid | aImageType = KNullUid, | |||
const TUid | aImageSubType = KNullUid, | |||
const TUid | aDecoderUid = KNullUid | |||
) | [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.
RFile & aFile | The handle of the file to decode |
ContentAccess::TIntent aIntent | The DRM Intent for image conversion. |
const TOptions aOptions = EOptionNone | The decoder options to use. See TOptions. |
const TUid aImageType = KNullUid | The image type of the image in the file (optional, defaults to KNullUid). |
const TUid aImageSubType = KNullUid | The image sub-type of the image in the file (optional, defaults to KNullUid). |
const TUid aDecoderUid = KNullUid | 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. |
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.
RFs & aFs | A reference to a file server session for the decoder to use. |
const TMMSource & aFileSource | An interface between filename based and file handle. |
const TDesC8 & aMIMEType | The MIME type of the image in the file. |
const TOptions aOptions = EOptionNone | 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. |
IMPORT_C CImageDecoder * | FileNewL | ( | RFs & | aFs, |
const TMMSource & | aFileSource, | |||
const TOptions | aOptions = EOptionNone, | |||
const TUid | aImageType = KNullUid, | |||
const TUid | aImageSubType = KNullUid, | |||
const TUid | aDecoderUid = KNullUid | |||
) | [static] |
Create a decoder for the image in the named source.
RFs & aFs | A reference to a file server session for the decoder to use. |
const TMMSource & aFileSource | An interface between filename based and file handle. |
const TOptions aOptions = EOptionNone | 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. |
const TUid aImageType = KNullUid | The image type of the image in the file. |
const TUid aImageSubType = KNullUid | The image sub-type of the image in the file. |
const TUid aDecoderUid = KNullUid | The implementation UID for a specific codec or a decoder/encoder class UID. |
IMPORT_C HBufC * | FrameCommentL | ( | TInt | aFrameNumber, |
TInt | aCommentNumber | |||
) | const |
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() .
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.
TInt aFrameNumber = 0 | The frame number. |
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.
TInt aFrameNumber = 0 | The frame number. |
IMPORT_C CFrameInfoStrings * | FrameInfoStringsL | ( | TInt | aFrameNumber = 0 | ) |
Return the formatted frame information strings for a specific frame. Ownership is transferred to the caller.
TInt aFrameNumber = 0 | 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.
TInt aFrameNumber = 0 | The frame number from which to retrieve the formatted information string. |
ContentAccess::CContent * | GetContentLC | ( | const TDesC & | aSourceFilename | ) | [private, static] |
const TDesC & aSourceFilename |
IMPORT_C TInt | GetDestinationSize | ( | TSize & | aSize, |
TInt | aFrameNumber = 0 | |||
) |
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.
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.
RFileExtensionMIMETypeArray & 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.
const TUid aImageType | The basic image type for which you want a list of sub-types. |
RImageTypeDescriptionArray & 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.
RImageTypeDescriptionArray & 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.
TUid 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.
const RUidDataArray & aRequiredUids | The array containing the required UIDs (properties, image type, image sub-type or class UIDs). |
RUidDataArray & 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.
const TUid * aRequiredUids | The array containing the required UIDs (properties, image type, image sub-type or class UIDs). |
const TInt aLength | The length of aRequiredUids (number of required UIDs). |
RUidDataArray & 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 | GetMimeTypeDataL | ( | const TDesC8 & | aImageData, |
TDes8 & | aMimeType | |||
) | [static] |
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
IMPORT_C void | GetMimeTypeFileL | ( | RFs & | aFs, |
const TDesC & | aFileName, | |||
TDes8 & | aMimeType | |||
) | [static] |
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.
IMPORT_C void | GetPluginPropertiesL | ( | const TUid | aImplementationUid, |
RUidDataArray & | aPropertiesArray | |||
) | [static] |
Gets a list of the properties of a specific decoder plugin.
const TUid aImplementationUid | The decoder implementation UID for which the plugin properties need to be retrieved. |
RUidDataArray & aPropertiesArray | The array of plugin properties owned by the specified decoder. The caller has the ownership of the array. |
IMPORT_C HBufC * | ImageCommentL | ( | TInt | aCommentNumber | ) | const |
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() .
TInt aCommentNumber | The comment number. |
IMPORT_C void | ImageType | ( | TInt | aFrameNumber, |
TUid & | aImageType, | |||
TUid & | aImageSubType | |||
) | const |
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() .
void | ImageTypeGetDecoderListL | ( | RImplInfoPtrArray & | aDecoderList, |
const TDesC8 & | aImageHeader, | |||
const TUid | aImageType, | |||
const TUid | aImageSubType, | |||
const TUid | aDecoderUid, | |||
const TOptions | aOptions = EOptionNone | |||
) | [private, static] |
Create a list of decoders that support the specified image type.
KUidICLJpegEXIFInterface KUidICLJpegImageFrameInterface
RImplInfoPtrArray & aDecoderList | A list of decoders that support the specified image type. |
const TDesC8 & aImageHeader | The header of the image file. |
const TUid aImageType | The image base type. |
const TUid aImageSubType | The image sub type. |
const TUid aDecoderUid | The implementation UID for a specific codec or a decoder/encoder class UID. |
const TOptions aOptions = EOptionNone | Extension options which must be supported by the plugin. |
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'.
void | MimeTypeGetDecoderListL | ( | RImplInfoPtrArray & | aDecoderList, |
const TDesC8 & | aMIMEType, | |||
const TOptions | aOptions = EOptionNone | |||
) | [private, static] |
Create a list of decoders that support the specified MIME type.
RImplInfoPtrArray & aDecoderList | A list of decoders that support the given MIME type. |
const TDesC8 & aMIMEType | The MIME type to decode. |
const TOptions aOptions = EOptionNone | Extension options which must be supported by the plugin. |
CImageDecodeConstruct * | NewDecodeConstructL | ( | const CImplementationInformation & | aDecoderInfo, |
const TOptions | aOptions = EOptionNone | |||
) | [private, static] |
Create a construct object for the specified decoder.
const CImplementationInformation & aDecoderInfo | Implementation information for the decoder to be created. |
const TOptions aOptions = EOptionNone | Extension options which must be supported by the plugin. |
CImageDecoder * | NewL | ( | CImageDecodeConstruct * | aConstruct, |
TOptions | aOptions | |||
) | [private, static] |
Called internally to create a CImageDecoder and associated iRelay body
This member is internal and not intended for use.
CImageDecodeConstruct * aConstruct | |
TOptions aOptions |
CImageDecoder * | NewL | ( | ) | [private, static] |
Actual factory function for CImageDecoder - ie. it creates the object Called back plugin - to allow plugin to override if required
This member is internal and not intended for use.
IMPORT_C TInt | NumberOfFrameComments | ( | TInt | aFrameNumber | ) | const |
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() .
TInt aFrameNumber | The frame number. |
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() .
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
CImageDecoder::SetClippingRectL() TImageConvScaler TImageConvOperation
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.
TRequestStatus * 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.
IMPORT_C TInt | ReductionFactor | ( | const TSize & | aOriginalSize, |
const TSize & | aReducedSize | |||
) | const |
Function to calculate the reduction factor based on the input parameters.
IMPORT_C void | ReservedVirtual1 | ( | ) | [private, virtual] |
Intended for future proofing - will panic if called
IMPORT_C void | ReservedVirtual2 | ( | ) | [private, virtual] |
Intended for future proofing - will panic if called
IMPORT_C void | ReservedVirtual3 | ( | ) | [private, virtual] |
Intended for future proofing - will panic if called
IMPORT_C void | ReservedVirtual4 | ( | ) | [private, virtual] |
Intended for future proofing - will panic if called
IMPORT_C TImageConvScaler * | ScalerL | ( | ) |
IMPORT_C TInt | SetAgentProperty | ( | ContentAccess::TAgentProperty | aProperty, |
TInt | aValue | |||
) |
Sets the properties for the Image decoder.
ContentAccess::TAgentProperty aProperty | The property to set. |
TInt 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.
const TRect * 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. |
IMPORT_C TInt | SetDecoderThreadPriority | ( | TThreadPriority | aPriority | ) |
Set the decoder worker thread priority
TThreadPriority 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.
TInt aImageType | An image type from TImageType to denote source image that the decoder should use. |
void | SuffixTypeGetDecoderListL | ( | RImplInfoPtrArray & | aDecoderList, |
const TDesC & | aFileName, | |||
const TOptions | aOptions = EOptionNone | |||
) | [private, static] |
Creates a list of decoders that support the specified file extension.
RImplInfoPtrArray & aDecoderList | A list of decoders that support the given file extension. |
const TDesC & aFileName | The file name from which the file extension will be taken. |
const TOptions aOptions = EOptionNone | Extension options which must be supported by the plugin. |
Flags to control which image is decoded. This can be used when the source file or descriptor contains multiple distinct image sources.
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.
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. |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.