#include <imageconversion.h>
class CImageEncoder : public CBase |
Public Member Enumerations | |
---|---|
enum | TOptions { EOptionNone, EOptionAlwaysThread, EOptionGenerateAdaptivePalette, EPreferFastEncode, ..., EOptionExtReserved3 } |
Protected Member Functions | |
---|---|
CImageEncoder() | |
IMPORT_C void | CustomAsync(TRequestStatus *, TInt) |
IMPORT_C void | CustomSyncL(TInt) |
IMPORT_C CImageEncoderPlugin * | Plugin() |
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.
Flags to control how the image is encoded. These can be combined using an OR operation.
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 | ( | ) |
Get the extension interface for block streaming on image.
See also: TImageConvStreamedEncode
Returns: Interface to image conversion operations.
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.
See also: TBmpImageData
Parameter | Description |
---|---|
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. |
aSource | A bitmap to encode. |
aFrameImageData | 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.
Parameter | Description |
---|---|
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. |
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.
Parameter | Description |
---|---|
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.
See also: TOptions
Parameter | Description |
---|---|
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. |
aMIMEType | The MIME type to use for the encoding. |
aOptions | Encoder options to use. |
Returns: A pointer to the newly created encoder.
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.
See also: KUidICLJpegEXIFInterface KUidICLJpegImageFrameInterface
See also: TOptions
Parameter | Description |
---|---|
aDestinationData | The buffer pointer into which to put the encoded image. |
aOptions | The encoder options to use. |
aImageType | The image type to use for the encoding (mandatory). |
aImageSubType | The image sub-type to use for the encoding (only if applicable, defaults to KNullUid). |
aEncoderUid | 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. |
Returns: A pointer to the newly created encoder.
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.
See also: TOptions
Parameter | Description |
---|---|
aFs | A reference to a file server session for the encoder to use. |
aDestinationFilename | The name of the file into which to put the encoded image. |
aMIMEType | The MIME type to use for the encoding. |
aOptions | The encoder options to use. |
Returns: Returns a pointer to the newly created encoder.
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.
See also: KUidICLJpegEXIFInterface KUidICLJpegImageFrameInterface
See also: TOptions
Parameter | Description |
---|---|
aFs | A reference to a file server session for the encoder to use. |
aDestinationFilename | The name of the file into which to put the encoded image. |
aOptions | Options to use. |
aImageType | The image type to use for the encoding (mandatory). |
aImageSubType | The image sub-type to use for the encoding (only if applicable, defaults to KNullUid). |
aEncoderUid | 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. |
Returns: A pointer to the newly created encoder.
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.
See also: TOptions
Parameter | Description |
---|---|
aFile | The handle of an open file to write the encoded image to |
aMIMEType | The MIME type to use for the encoding. |
aOptions | The encoder options to use. |
Returns: Returns a pointer to the newly created encoder.
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.
See also: KUidICLJpegEXIFInterface KUidICLJpegImageFrameInterface
See also: TOptions
Parameter | Description |
---|---|
aFile | The handle of an open file to write the encoded image to |
aOptions | Options to use. |
aImageType | The image type to use for the encoding (mandatory). |
aImageSubType | The image sub-type to use for the encoding (only if applicable, defaults to KNullUid). |
aEncoderUid | 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. |
Returns: A pointer to the newly created encoder.
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.
Parameter | Description |
---|---|
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.
Parameter | Description |
---|---|
aImageType | The basic image type for which a list of sub-types should be returned. |
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.
Parameter | Description |
---|---|
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).
Parameter | Description |
---|---|
aRequiredUids | The array containing the UIDs of the required uids (properties, image type, image sub-type or class uids). |
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).
Parameter | Description |
---|---|
aRequiredUids | The array containing the UIDs of 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 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.
Parameter | Description |
---|---|
aImplementationUid | The encoder implementation UID for which the plugin properties need to be retrieved. |
aPropertiesArray | The array of plugin properties owned by the specified encoder. The caller has the ownership of the array. |
IMPORT_C TUid | ImplementationUid | ( | ) | const |
Returns the implementation UID of the encoder being used to encode the bitmap.
Returns: The implementation UID of the encoder.
IMPORT_C TImageConvOperation * | OperationL | ( | ) |
Get the extension interface for operations on image.
See also: TImageConvOperation
Returns: Interface to image conversion operations (rotate/mirror over axis).
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.
See also: CImageEncoder::Convert
Parameter | Description |
---|---|
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 | SetEncoderThreadPriority | ( | TThreadPriority | aPriority | ) |
Set the encoder worker thread priority
See also: TThreadPriority
Parameter | Description |
---|---|
aPriority | a new value for worker thread priority |
Returns: KErrNotSupported the encoder object doesn't use a worker thread. Other system-wide error codes.
IMPORT_C void | SetThumbnail | ( | TBool | aDoGenerateThumbnail | ) |
Select to encode or not the thumbnail
Parameter | Description |
---|---|
aDoGenerateThumbnail | EFalse if no generation of thumbnail |