class CImageEncoder : public CBase |
Provides access to the ICL (image conversion library) encoders.
This class provides functions that convert image data held in CFbsBitmap objects into well know formats and store the results in either files of descriptors.
Protected Member Functions | |
---|---|
CImageEncoder () | |
IMPORT_C void | CustomAsync ( TRequestStatus *, TInt ) |
IMPORT_C void | CustomSyncL ( TInt ) |
IMPORT_C CImageEncoderPlugin * | Plugin () |
Private Member Functions | |
---|---|
void | ImageTypeGetEncoderListL ( RImplInfoPtrArray &, const TUid , const TUid , const TUid , const TOptions ) |
void | MimeTypeGetEncoderListL ( RImplInfoPtrArray &, const TDesC8 &, const TOptions ) |
CImageEncodeConstruct * | NewEncodeConstructL (const CImplementationInformation &, const TOptions ) |
CImageEncoder * | NewL ( CImageEncodeConstruct *, TOptions ) |
CImageEncoder * | NewL () |
IMPORT_C void | ReservedVirtual1 () |
IMPORT_C void | ReservedVirtual2 () |
IMPORT_C void | ReservedVirtual3 () |
IMPORT_C void | ReservedVirtual4 () |
TBool | ValidProperties () |
Public Member Enumerations | |
---|---|
enum |
TOptions
{
EOptionNone = 0x00, EOptionAlwaysThread = 0x01, EOptionGenerateAdaptivePalette = 0x02, EPreferFastEncode = 0x04, EOptionExtStream = 0x0100, EOptionExtRotation = 0x0200, EOptionExtMirrorHorizontalAxis = 0x0400, EOptionExtMirrorVerticalAxis = 0x0800, EOptionExtUseWithSetThumbnail = 0x1000, EOptionExtReserved1 = 0x2000, EOptionExtReserved2 = 0x4000, EOptionExtReserved3 = 0x8000 } |
Private Attributes | |
---|---|
MImageEncoderRelay * | iRelay |
IMPORT_C | ~CImageEncoder | ( | ) | [virtual] |
Destructor for this class.
Closes the file. If using a local file session, it closes it. Calls ECom to tell it the encoder instance is no longer required.
Frees all other resources owned by the object prior to its destruction.
IMPORT_C TImageConvStreamedEncode * | BlockStreamerL | ( | ) |
IMPORT_C void | Convert | ( | TRequestStatus * | aRequestStatus, |
const CFbsBitmap & | aSource, | |||
const CFrameImageData * | aFrameImageData = NULL | |||
) |
Encodes a bitmap asynchronously.
When encoding is complete, successfully or otherwise, the status is returned in aRequestStatus.
TRequestStatus * aRequestStatus | The request status. On completion contains an error code. KErrNone if the bitmap was successfully encoded, otherwise another of the system-wide error codes. |
const CFbsBitmap & aSource | A bitmap to encode. |
const CFrameImageData * aFrameImageData = NULL | The frame image data (optional, defaults to NULL). There exists format-specific image data variants that are used by encoders to obtain image specific data. This behaviour is invoked by specifying aFrameImageData. Otherwise, encoder specific defaults are invoked. |
IMPORT_C void | CustomAsync | ( | TRequestStatus * | aRequestStatus, |
TInt | aParam | |||
) | [protected] |
Sets up background convert cycle, bypassing Convert() .
Use this function to inititate CImageEncoderPlugin::InitCustomAsyncL(aParam), which if successful will start background processing. Convert() uses the same mechanism as CustomAsync() , and therefore cannot be used concurrently. Cancel() and other related functions still work as expected.
Note: For use by plugin writers only.
TRequestStatus * aRequestStatus | The request status. On completion contains an error code. KErrNone if the bitmap was successfully encoded, otherwise another of the system-wide error codes. |
TInt aParam | Interpretation determined by plugin. |
IMPORT_C void | CustomSyncL | ( | TInt | aParam | ) | [protected] |
Calls CImageEncoderPlugin::HandleCustomSyncL() that executes user defined plugin specific functions. Subsequent behaviour therefore depends on the CImageEncoderPlugin class.
Note: For use by plugin writers only.
TInt aParam | Interpretation determined by plugin. |
IMPORT_C CImageEncoder * | DataNewL | ( | HBufC8 *& | aDestinationData, |
const TDesC8 & | aMIMEType, | |||
const TOptions | aOptions = EOptionNone | |||
) | [static] |
Creates a plugin encoder for a specified MIME type and writes output to a descriptor.
The client supplies a MIME type which will be used to try and select an appropriate plugin encoder. If an appropriate encoder is found, it creates it.
HBufC8 *& aDestinationData | The buffer pointer into which to put the encoded image. This must be a NULL pointer. Memory will be allocated internally and ownership of the data passed to the caller. |
const TDesC8 & aMIMEType | The MIME type to use for the encoding. |
const TOptions aOptions = EOptionNone | Encoder options to use. |
IMPORT_C CImageEncoder * | DataNewL | ( | HBufC8 *& | aDestinationData, |
const TOptions | aOptions = EOptionNone, | |||
const TUid | aImageType = KNullUid, | |||
const TUid | aImageSubType = KNullUid, | |||
const TUid | aEncoderUid = KNullUid | |||
) | [static] |
Creates a plugin encoder based on optional parameters and writes output to a descriptor.
The client must supply a basic image type (and a sub-type, if applicable) or specific encoder/class, implementation UID which will be used to try and select an appropriate plugin encoder. If an appropriate encoder is found, it is created.
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 encoded, use the static functions GetImageTypesL() and GetImageSubTypesL() .
If no plugin encoder can be found that matches the details provided in aImageType, aImageSubType and possibly aEncoderUid this function leaves with KErrNotFound or KEComErrNoInterfaceIdentified.
HBufC8 *& aDestinationData | The buffer pointer into which to put the encoded image. |
const TOptions aOptions = EOptionNone | The encoder options to use. |
const TUid aImageType = KNullUid | The image type to use for the encoding (mandatory). |
const TUid aImageSubType = KNullUid | The image sub-type to use for the encoding (only if applicable, defaults to KNullUid). |
const TUid aEncoderUid = 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 CImageEncoder * | FileNewL | ( | RFs & | aFs, |
const TDesC & | aDestinationFilename, | |||
const TDesC8 & | aMIMEType, | |||
const TOptions | aOptions = EOptionNone | |||
) | [static] |
Creates an encoder based on a specified MIME type and write output to a named file.
The client supplies a MIME type which will be used to try and select an appropriate plugin encoder. If an appropriate encoder is found, it is created.
If any file related errors are encountered opening the specified file, this function leaves with an appropriate file related leave code.
RFs & aFs | A reference to a file server session for the encoder to use. |
const TDesC & aDestinationFilename | The name of the file into which to put the encoded image. |
const TDesC8 & aMIMEType | The MIME type to use for the encoding. |
const TOptions aOptions = EOptionNone | The encoder options to use. |
IMPORT_C CImageEncoder * | FileNewL | ( | RFs & | aFs, |
const TDesC & | aDestinationFilename, | |||
const TOptions | aOptions = EOptionNone, | |||
const TUid | aImageType = KNullUid, | |||
const TUid | aImageSubType = KNullUid, | |||
const TUid | aEncoderUid = KNullUid | |||
) | [static] |
Creates an encoder based on a supplied parameters and writes output to a named file.
The client must supply a basic image type (and a sub-type, if applicable) or a specific encoder implementation UID, which will be used to try and select an appropriate plugin encoder. If an appropriate encoder is found, it is created.
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 encoded, use the static functions GetImageTypesL() and GetImageSubTypesL() .
If no plugin encoder can be found that matches the details provided in aImageType, aImageSubType and possibly aEncoderUid this function leaves with KErrNotFound or KEComErrNoInterfaceIdentified.
If any file related errors are encountered opening the specified file, this function leaves with an appropriate file related leave code.
RFs & aFs | A reference to a file server session for the encoder to use. |
const TDesC & aDestinationFilename | The name of the file into which to put the encoded image. |
const TOptions aOptions = EOptionNone | Options to use. |
const TUid aImageType = KNullUid | The image type to use for the encoding (mandatory). |
const TUid aImageSubType = KNullUid | The image sub-type to use for the encoding (only if applicable, defaults to KNullUid). |
const TUid aEncoderUid = 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 CImageEncoder * | FileNewL | ( | RFile & | aFile, |
const TDesC8 & | aMIMEType, | |||
const TOptions | aOptions = EOptionNone | |||
) | [static] |
Creates an encoder based on a specified MIME type and write output to a named file.
The client supplies a MIME type which will be used to try and select an appropriate plugin encoder. If an appropriate encoder is found, it is created.
If any file related errors are encountered opening the specified file, this function leaves with an appropriate file related leave code.
IMPORT_C CImageEncoder * | FileNewL | ( | RFile & | aFile, |
const TOptions | aOptions = EOptionNone, | |||
const TUid | aImageType = KNullUid, | |||
const TUid | aImageSubType = KNullUid, | |||
const TUid | aEncoderUid = KNullUid | |||
) | [static] |
Creates an encoder based on a supplied parameters and writes output to a named file.
The client must supply a basic image type (and a sub-type, if applicable) or a specific encoder/class implementation UID, which will be used to try and select an appropriate plugin encoder. If an appropriate encoder is found, it is created.
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 encoded, use the static functions GetImageTypesL() and GetImageSubTypesL() .
If no plugin encoder can be found that matches the details provided in aImageType, aImageSubType and possibly aEncoderUid this function leaves with KErrNotFound or KEComErrNoInterfaceIdentified.
If any file related errors are encountered opening the specified file, this function leaves with an appropriate file related leave code.
RFile & aFile | The handle of an open file to write the encoded image to |
const TOptions aOptions = EOptionNone | Options to use. |
const TUid aImageType = KNullUid | The image type to use for the encoding (mandatory). |
const TUid aImageSubType = KNullUid | The image sub-type to use for the encoding (only if applicable, defaults to KNullUid). |
const TUid aEncoderUid = 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 void | GetFileTypesL | ( | RFileExtensionMIMETypeArray & | aFileExtensionArray | ) | [static] |
Get a list of the file extensions that can be encoded and their corresponding MIME types, based on the currently available encoder 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 the array's ResetAndDestroy() method to free any 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 an encoder 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, returns a list of the image sub-types that can be encoded, based on the currently available encoder plugins.
Each entry in the returned array consists of the "display string" for the plugin as well as the UID for the sub-type. The first UID represents the basic type and is always set to aImageType.
Ownership of the array is passed to the caller, so before the array goes out of scope in the client, the caller must call the array's ResetAndDestroy() method to free any entries.
const TUid aImageType | The basic image type for which a list of sub-types should be returned. |
RImageTypeDescriptionArray & aSubTypeArray | An empty array, into which this function will put a list of of supported image sub-types. |
IMPORT_C void | GetImageTypesL | ( | RImageTypeDescriptionArray & | aImageTypeArray | ) | [static] |
Returns a list of the basic image types that can be encoded, based on the currently available encoder plugins.
The returned array contains entries for the supported image types. Each entry consists of the "display string" as well as the UID for that image type. Since this function only returns basic image type UID's, the second UID which represents the sub-type will always be zero.
Ownership of the array is passed to the caller so, before the array goes out of scope in the client, the caller must call the array's ResetAndDestroy() method to free any entries.
RImageTypeDescriptionArray & aImageTypeArray | An empty array, into which this function will put a list of supported image types. |
IMPORT_C void | GetInterfaceImplementationsL | ( | const RUidDataArray & | aRequiredUids, |
RUidDataArray & | aImplArray | |||
) | [static] |
Gets a list of encoder implementations UIDs that have some specific uids (properties, image type, image sub-type or class uids).
const RUidDataArray & aRequiredUids | The array containing the UIDs of the required uids (properties, image type, image sub-type or class uids). |
RUidDataArray & aImplArray | The array containing the implementation UIDs of the available encoder 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 encoder implementations UIDs that have some specific required uids (properties, image type, image sub-type or class uids).
const TUid * aRequiredUids | The array containing the UIDs of 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 encoder plugins with the required UIDs. The caller has the ownership of the array. |
IMPORT_C void | GetPluginPropertiesL | ( | const TUid | aImplementationUid, |
RUidDataArray & | aPropertiesArray | |||
) | [static] |
Gets a list of the properties of a specific encoder plugin.
const TUid aImplementationUid | The encoder implementation UID for which the plugin properties need to be retrieved. |
RUidDataArray & aPropertiesArray | The array of plugin properties owned by the specified encoder. The caller has the ownership of the array. |
void | ImageTypeGetEncoderListL | ( | RImplInfoPtrArray & | aEncoderList, |
const TUid | aImageType, | |||
const TUid | aImageSubType, | |||
const TUid | aEncoderUid, | |||
const TOptions | aOptions = EOptionNone | |||
) | [private, static] |
Create a list of encoders that support the specified image type.
KUidICLJpegEXIFInterface KUidICLJpegImageFrameInterface
RImplInfoPtrArray & aEncoderList | A list of encoders that support the specified image type. |
const TUid aImageType | The image base type. |
const TUid aImageSubType | The image sub type. |
const TUid aEncoderUid | The implementation UID for a specific codec or a decoder/encoder class UID. |
const TOptions aOptions = EOptionNone | Encoder options to use. |
IMPORT_C TUid | ImplementationUid | ( | ) | const |
Returns the implementation UID of the encoder being used to encode the bitmap.
void | MimeTypeGetEncoderListL | ( | RImplInfoPtrArray & | aEncoderList, |
const TDesC8 & | aMIMEType, | |||
const TOptions | aOptions = EOptionNone | |||
) | [private, static] |
Creates a list of encoders that support the specified MIME type.
RImplInfoPtrArray & aEncoderList | Create a list of encoders that support the given MIME type. |
const TDesC8 & aMIMEType | The MIME type to encode to. |
const TOptions aOptions = EOptionNone | Decoder options to use. |
CImageEncodeConstruct * | NewEncodeConstructL | ( | const CImplementationInformation & | aEncoderInfo, |
const TOptions | aOptions = EOptionNone | |||
) | [private, static] |
Create an encode construct using a image type, sub type and encoder implementation UID.
const CImplementationInformation & aEncoderInfo | Implementation information for the encoder to be created. |
const TOptions aOptions = EOptionNone | Encoder options to use. |
CImageEncoder * | NewL | ( | CImageEncodeConstruct * | aConstruct, |
TOptions | aOptions | |||
) | [private, static] |
Called internally to create a CImageEncoder and associated iRelay body
CImageEncodeConstruct * aConstruct | |
TOptions aOptions |
CImageEncoder * | NewL | ( | ) | [private, static] |
Actual factory function for CImageEncoder - ie. it creates the object Called back plugin - to allow plugin to override if required
IMPORT_C TImageConvOperation * | OperationL | ( | ) |
IMPORT_C CImageEncoderPlugin * | Plugin | ( | ) | const [protected] |
Returns the associated CImageEncoderPlugin .
This is part of support for extended codecs, for use within classes derived from CImageEncoder . Allows the extended CImageEncoder object to talk to its CImageEncoderPlugin equivalent.
Note: For use by plugin writers only.
IMPORT_C void | Prepare | ( | TRequestStatus * | aRequestStatus | ) |
Optional call from client which may be made on the encoder to allow analysis of image prior to calling Convert.
Should be called once encode is fully set up e.g. any encode operations defined.
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 void | ReservedVirtual1 | ( | ) | [private, virtual] |
Intended for future proofing - will pannic if called
IMPORT_C void | ReservedVirtual2 | ( | ) | [private, virtual] |
Intended for future proofing - will pannic if called
IMPORT_C void | ReservedVirtual3 | ( | ) | [private, virtual] |
Intended for future proofing - will pannic if called
IMPORT_C void | ReservedVirtual4 | ( | ) | [private, virtual] |
Intended for future proofing - will pannic if called
IMPORT_C TInt | SetEncoderThreadPriority | ( | TThreadPriority | aPriority | ) |
Set the encoder worker thread priority
TThreadPriority aPriority | a new value for worker thread priority |
IMPORT_C void | SetThumbnail | ( | TBool | aDoGenerateThumbnail | ) |
Select to encode or not the thumbnail
TBool aDoGenerateThumbnail | EFalse if no generation of thumbnail |
Flags to control how the image is encoded. These can be combined using an OR operation.
EOptionNone = 0x00 |
No flag set |
EOptionAlwaysThread = 0x01 |
Perform the encoding in a separate thread |
EOptionGenerateAdaptivePalette = 0x02 |
If the codec supports it, generate a palette based on the colors present in the image data, rather than using the default palette |
EPreferFastEncode = 0x04 |
Use the highest possible image encoding 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 encoding will ignore it. |
EOptionExtStream = 0x0100 |
Codec must support block streaming extension. |
EOptionExtRotation = 0x0200 |
Codec must support rotation through the operation extension. |
EOptionExtMirrorHorizontalAxis = 0x0400 |
Codec must support horizontal mirror through the operation extension. |
EOptionExtMirrorVerticalAxis = 0x0800 |
Codec must support vertical mirror through the operation extension. |
EOptionExtUseWithSetThumbnail = 0x1000 |
Codec must support setting thumbnail when using the other extensions (e.g. thumbnail rotation) |
EOptionExtReserved1 = 0x2000 |
Reserved. |
EOptionExtReserved2 = 0x4000 |
Reserved. |
EOptionExtReserved3 = 0x8000 |
Reserved. |
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.