Location:
ImageConversion.h
Link against: imageconversion.lib
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.
CBase
- Base class for all classes to be instantiated on the heap
CImageEncoder
- Provides access to the ICL (image conversion library) encoders
Defined in CImageEncoder
:
CImageEncoder()
, Cancel()
, Convert()
, CustomAsync()
, CustomSyncL()
, DataNewL()
, DataNewL()
, EOptionAlwaysThread
, EOptionGenerateAdaptivePalette
, EOptionNone
, FileNewL()
, FileNewL()
, FileNewL()
, FileNewL()
, GetFileTypesL()
, GetImageSubTypesL()
, GetImageTypesL()
, ImplementationUid()
, Plugin()
, SetEncoderThreadPriority()
, SetThumbnail()
, TOptions
, ~CImageEncoder()
Inherited from CBase
:
Delete()
,
Extension_()
,
operator new()
virtual IMPORT_C ~CImageEncoder();
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.
static IMPORT_C void GetImageTypesL(RImageTypeDescriptionArray &aImageTypeArray);
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.
|
static IMPORT_C void GetImageSubTypesL(const TUid aImageType, RImageTypeDescriptionArray &aSubTypeArray);
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.
|
static IMPORT_C void GetFileTypesL(RFileExtensionMIMETypeArray &aFileExtensionArray);
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.
|
static IMPORT_C CImageEncoder *FileNewL(RFs &aFs, const TDesC &aDestinationFilename, const TDesC8 &aMIMEType, const TOptions
aOptions=EOptionNone);
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.
|
|
static IMPORT_C CImageEncoder *FileNewL(RFs &aFs, const TDesC &aDestinationFilename, const TOptions aOptions=EOptionNone,
const TUid aImageType=TUid::Null(), const TUid aImageSubType=TUid::Null(), const TUid aEncoderUid=TUid::Null());
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.
|
|
|
|
static IMPORT_C CImageEncoder *FileNewL(RFile &aFile, const TDesC8 &aMIMEType, const TOptions aOptions=EOptionNone);
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.
|
|
|
static IMPORT_C CImageEncoder *FileNewL(RFile &aFile, const TOptions aOptions=EOptionNone, const TUid aImageType=TUid::Null(),
const TUid aImageSubType=TUid::Null(), const TUid aEncoderUid=TUid::Null());
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.
|
|
|
|
static IMPORT_C CImageEncoder *DataNewL(HBufC8 *&aDestinationData, const TDesC8 &aMIMEType, const TOptions aOptions=EOptionNone);
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.
|
|
static IMPORT_C CImageEncoder *DataNewL(HBufC8 *&aDestinationData, const TOptions aOptions=EOptionNone, const TUid aImageType=TUid::Null(),
const TUid aImageSubType=TUid::Null(), const TUid aEncoderUid=TUid::Null());
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.
|
|
|
|
IMPORT_C void Convert(TRequestStatus *aRequestStatus, const CFbsBitmap &aSource, const CFrameImageData *aFrameImageData=0);
Encodes a bitmap asynchronously.
When encoding is complete, successfully or otherwise, the status is returned in aRequestStatus.
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 TUid ImplementationUid() const;
Returns the implementation UID of the encoder being used to encode the bitmap.
|
IMPORT_C void SetThumbnail(TBool aDoGenerateThumbnail);
Select to encode or not the thumbnail
|
IMPORT_C TInt SetEncoderThreadPriority(TThreadPriority aPriority);
Set the encoder worker thread priority
|
|
protected: IMPORT_C void CustomSyncL(TInt aParam);
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.
|
protected: IMPORT_C void CustomAsync(TRequestStatus *aRequestStatus, TInt aParam);
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.
|
protected: IMPORT_C CImageEncoderPlugin *Plugin() const;
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.
|
TOptions
Flags to control how the image is encoded. These can be combined using an OR operation.
|