|
||
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()
Constructor for this class. Cancel()
Asynchronously cancels any conversions currently in progress. Convert(TRequestStatus *,const CFbsBitmap &,const CFrameImageData *)
Encodes a bitmap asynchronously.CustomAsync(TRequestStatus *,TInt)
Sets up background convert cycle, bypassing CImageEncoder::Convert(TRequestStatu...CustomSyncL(TInt)
Calls CImageEncoderPlugin::HandleCustomSyncL(TInt) that executes user defined pl...DataNewL(HBufC8 *&,const TDesC8 &,const TOptions)
Creates a plugin encoder for a specified MIME type and writes output to a descri...DataNewL(HBufC8 *&,const TOptions,const TUid,const TUid,const TUid)
Creates a plugin encoder based on optional parameters and writes output to a des...EOptionAlwaysThread
Perform the encoding in a separate threadEOptionExtReserved1
Reserved.EOptionExtReserved2
Reserved.EOptionExtReserved3
Reserved.EOptionGenerateAdaptivePalette
If the codec supports it, generate a palette based on the colors present in the ...EOptionNone
No flag setFileNewL(RFile &,const TDesC8 &,const TOptions)
Creates an encoder based on a specified MIME type and write output to a named fi...FileNewL(RFile &,const TOptions,const TUid,const TUid,const TUid)
Creates an encoder based on a supplied parameters and writes output to a named f...FileNewL(RFs &,const TDesC &,const TDesC8 &,const TOptions)
Creates an encoder based on a specified MIME type and write output to a named fi...FileNewL(RFs &,const TDesC &,const TOptions,const TUid,const TUid,const TUid)
Creates an encoder based on a supplied parameters and writes output to a named f...GetFileTypesL(RFileExtensionMIMETypeArray &)
Get a list of the file extensions that can be encoded and their corresponding MI...GetImageSubTypesL(const TUid,RImageTypeDescriptionArray &)
For a given basic image type, returns a list of the image sub-types that can be ...GetImageTypesL(RImageTypeDescriptionArray &)
Returns a list of the basic image types that can be encoded, based on the curren...ImplementationUid()const
Returns the implementation UID of the encoder being used to encode the bitmap.Plugin()const
Returns the associated CImageEncoderPlugin.SetEncoderThreadPriority(TThreadPriority)
Set the encoder worker thread prioritySetThumbnail(TBool)
Select to encode or not the thumbnailTOptions
Flags to control how the image is encoded. These can be combined using an OR ope...~CImageEncoder()
Destructor for this class.Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.Extension_(TUint,TAny *&,TAny *)
Extension function operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...IMPORT_C virtual ~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.
IMPORT_C static 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.
|
IMPORT_C static 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.
|
IMPORT_C static 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.
|
IMPORT_C static 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.
|
|
CImageEncoder::TOptions
Flags to control how the image is encoded. These can be combined using an OR ope...IMPORT_C static 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 CImageEncoder::GetImageTypesL(RImageTypeDescriptionArray &)
and CImageEncoder::GetImageSubTypesL(const TUid,RImageTypeDescriptionArray &)
.
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.
|
|
|
|
CImageEncoder::TOptions
Flags to control how the image is encoded. These can be combined using an OR ope...IMPORT_C static 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.
|
|
|
CImageEncoder::TOptions
Flags to control how the image is encoded. These can be combined using an OR ope...IMPORT_C static 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 CImageEncoder::GetImageTypesL(RImageTypeDescriptionArray &)
and CImageEncoder::GetImageSubTypesL(const TUid,RImageTypeDescriptionArray &)
.
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.
|
|
|
|
CImageEncoder::TOptions
Flags to control how the image is encoded. These can be combined using an OR ope...IMPORT_C static 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.
|
|
CImageEncoder::TOptions
Flags to control how the image is encoded. These can be combined using an OR ope...IMPORT_C static 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 CImageEncoder::GetImageTypesL(RImageTypeDescriptionArray &)
and CImageEncoder::GetImageSubTypesL(const TUid,RImageTypeDescriptionArray &)
.
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.
|
|
|
|
CImageEncoder::TOptions
Flags to control how the image is encoded. These can be combined using an OR ope...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.
|
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(TInt)
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 CImageEncoder::Convert(TRequestStatus *,const CFbsBitmap &,const CFrameImageData *)
.
Use this function to inititate CImageEncoderPlugin::InitCustomAsyncL(aParam), which if successful will start background processing.
CImageEncoder::Convert(TRequestStatus *,const CFbsBitmap &,const CFrameImageData *)
uses the same mechanism as CImageEncoder::CustomAsync(TRequestStatus *,TInt)
, and therefore cannot be used concurrently. CImageEncoder::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.
|