![Symbian Developer Library](../../../../a_stock/images/mainheading.gif)
![]() |
![]() |
|
class CImageEncoderPlugin : public CBase;
The plugin API for Image Converter Library encoder plugins.
Intended for use by plugin writers only.
CBase
-
Base class for all classes to be instantiated on the heap.
CImageEncoderPlugin
-
The plugin API for Image Converter Library encoder plugins.
Defined in CImageEncoderPlugin
:
AmInThread()const
Indicates if this encoder is running in a separate thread.CImageEncoderPlugin()
Constructor for this class. Cleanup()
Called when the plugin is destroyed or an encode is cancelled to perform cleanup...CurrentImageSizeL()const
Returns the current size of the encoded image in bytes.DestinationData()
Returns the value to be fed to CImageWriteCodec::ProcessFrameL(TBufPtr8 &), ...DoConvert()
Performs the encoding process.FinishConvertL()
Notifies the framework that the main frame encoding is complete, so it can tidy ...FrameInfoOverallSizeInPixels()const
Returns the overall size of the image frame in pixels.HandleCustomSyncL(TInt)
Called as a result of the associated CImageEncoder::CustomSyncL(TInt) function b...HandleProcessFrameResult(TInt,TFrameState)
Deals with the result from ProcessFrameL().ImageWriteCodec()const
Returns the plugin's write codec.InitConvertL()
Initialises data structures prior to encoding a frame.InitCustomAsyncL(TInt)
Called as a result of the associated CImageEncoder::CustomAsync(TRequestStatus *...NotifyComplete()
Plugin defined actions resulting from a call by CImageEncoderPlugin::RequestComp...Position()const
Returns the current position within the internal data buffer that is being writt...PrepareEncoderL(const CFrameImageData *)
Allocates the specific codec used for the encoding and passes ownership to the p...RequestComplete(TInt)
This function must be called on completion of encoding the image data.RequestInitL()
Forces initialization of data structures prior to decoding a frame. SelfComplete(TInt)
Must be called at the end of a slice of encoding. If called with KErrNone will c...SetImageWriteCodec(CImageWriteCodec *)const
Sets the plugin's write codec.SetSelfPending()
May be called at the start of a slice of encoding if the encoding is expected to...ShouldAbort()const
Indicates if an encode should abort early (ie. following a Cancel).Source()const
Returns the bitmap which is being encoded.StartPosition()const
Returns the starting position of the internal data buffer of the encoded image t...UpdateHeaderL()
May be used to fill in additional fields at the end of the encoding process, whi...ValidSource()const
Checks the validity of the bitmap which is being encoded. Returns ETrue if the b...WriteDataL(TInt,const TDesC8 &)
Writes a descriptor to the internal data buffer of the encoded image without inc...WriteDataPositionIncL(TInt,const TDesC8 &)
Writes a descriptor to the internal data buffer of the encoded image. In additio...WriteExifDataL(TRequestStatus *&)
Originally only used by the jpeg codec, but now in use as a generic pre-convert ...~CImageEncoderPlugin()
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...protected: IMPORT_C virtual void Cleanup();
Called when the plugin is destroyed or an encode is cancelled to perform cleanup functions.
This function may be overriden in derived classes in which case the derived class should ensure it calls this version after performing any plugin specific cleanup.
protected: IMPORT_C virtual void InitConvertL();
Initialises data structures prior to encoding a frame.
This may be overriden in derived classes in which case the derived class should ensure it calls this version after performing any plugin initialisation.
protected: IMPORT_C void RequestInitL();
Forces initialization of data structures prior to decoding a frame.
protected: IMPORT_C virtual void DoConvert();
Performs the encoding process.
This call may be overriden in derived classes. If this is not the case and a custom decode is not performed, the derived class should ensure that this base class's version is called.
protected: IMPORT_C void HandleProcessFrameResult(TInt aErrCode, TFrameState aCodecState);
Deals with the result from ProcessFrameL().
This processes the results of the standard ProcessFrameL() call, feeding in the resultant error code from its TRAP and the
status result. It will call CImageEncoderPlugin::RequestComplete(TInt)
or CImageEncoderPlugin::SelfComplete(TInt)
as appropriate. Note that if no data was created by ProcessFrameL(), CImageEncoderPlugin::HandleProcessFrameResult(TInt,TFrameState)
assumes that the encoding process is complete. If this is not appropriate, an overloaded CImageEncoderPlugin::DoConvert()
should be used to handle it.
|
protected: IMPORT_C TBufPtr8& DestinationData();
Returns the value to be fed to CImageWriteCodec::ProcessFrameL(TBufPtr8 &)
, and will be used by codecs that fully override CImageEncoderPlugin::DoConvert()
.
|
protected: IMPORT_C void FinishConvertL();
Notifies the framework that the main frame encoding is complete, so it can tidy up. This results in a call to CImageEncoderPlugin::UpdateHeaderL()
and then either the descriptor is copied across or the file is closed.
Note: This function is only used if a decoder replaces the CImageEncoderPlugin::DoConvert()
call - the default version does this as part of its processing.
protected: IMPORT_C void WriteDataL(TInt aPosition, const TDesC8 &aDes);
Writes a descriptor to the internal data buffer of the encoded image without incrementing the position in the buffer, and
therefore a call to CImageEncoderPlugin::Position()const
will return the same value before or after a call to this function.
|
CImageEncoderPlugin::Position()const
Returns the current position within the internal data buffer that is being writt...protected: IMPORT_C void WriteDataPositionIncL(TInt aPosition, const TDesC8 &aDes);
Writes a descriptor to the internal data buffer of the encoded image. In addition, the position in the buffer that is written
to (obtained with CImageEncoderPlugin::Position()const
) will be incremented returning aPosition + aDes.Length().
|
CImageEncoderPlugin::Position()const
Returns the current position within the internal data buffer that is being writt...protected: IMPORT_C const CFbsBitmap& Source() const;
Returns the bitmap which is being encoded.
|
protected: IMPORT_C TBool ValidSource() const;
Checks the validity of the bitmap which is being encoded. Returns ETrue if the bitmap is valid, otherwise EFalse.
|
protected: IMPORT_C CImageWriteCodec* ImageWriteCodec() const;
Returns the plugin's write codec.
|
protected: IMPORT_C void SetImageWriteCodec(CImageWriteCodec *aImageWriteCodec) const;
Sets the plugin's write codec.
Ownership of the codec is transferred to the plugin.
|
protected: IMPORT_C TInt& StartPosition() const;
Returns the starting position of the internal data buffer of the encoded image that is being written to.
|
protected: IMPORT_C TInt& Position() const;
Returns the current position within the internal data buffer that is being written to.
|
CImageEncoderPlugin::WriteDataPositionIncL(TInt,const TDesC8 &)
Writes a descriptor to the internal data buffer of the encoded image. In additio...CImageEncoderPlugin::WriteDataL(TInt,const TDesC8 &)
Writes a descriptor to the internal data buffer of the encoded image without inc...protected: IMPORT_C const TSize& FrameInfoOverallSizeInPixels() const;
Returns the overall size of the image frame in pixels.
|
protected: virtual void PrepareEncoderL(const CFrameImageData *aFrameImageData)=0;
Allocates the specific codec used for the encoding and passes ownership to the plugin.
This is a pure virtual function that each individual plugin must implement.
|
protected: virtual void UpdateHeaderL()=0;
May be used to fill in additional fields at the end of the encoding process, which it may not have been possible to do earlier.
This is a pure virtual function that each individual plugin must implement.
protected: IMPORT_C TInt CurrentImageSizeL() const;
Returns the current size of the encoded image in bytes.
|
protected: IMPORT_C void RequestComplete(TInt aReason);
This function must be called on completion of encoding the image data.
|
CImageEncoderPlugin::SelfComplete(TInt)
Must be called at the end of a slice of encoding. If called with KErrNone will c...protected: IMPORT_C void SelfComplete(TInt aReason);
Must be called at the end of a slice of encoding. If called with KErrNone will cause a repeat call to CImageEncoderPlugin::DoConvert()
.
|
CImageEncoderPlugin::RequestComplete(TInt)
This function must be called on completion of encoding the image data.protected: IMPORT_C void SetSelfPending();
May be called at the start of a slice of encoding if the encoding is expected to complete asynchronously. This sets the AO
in CImageEncoderPriv
to active, but does not complete the request.
When the encoding of the slice is complete, there must be a call to CImageEncoderPlugin::SelfComplete(TInt)
CImageEncoderPlugin::SelfComplete(TInt)
Must be called at the end of a slice of encoding. If called with KErrNone will c...protected: IMPORT_C virtual void HandleCustomSyncL(TInt aParam);
Called as a result of the associated CImageEncoder::CustomSyncL(TInt)
function being called. Plugins may override this to provide extended commands in CImageEncoder
. Default version leaves with KErrNotSupported.
|
protected: IMPORT_C virtual void InitCustomAsyncL(TInt aParam);
Called as a result of the associated CImageEncoder::CustomAsync(TRequestStatus *,TInt)
function being called. If this function finishes normally, then a convert cycle is started - so that CImageEncoderPlugin::DoConvert()
will be subsequently started in the background - otherwise, if this function leaves then the error result is immediately
signalled back to the caller of CustomAsync().
The default version leaves with KErrNotSupported unless overridden to change this behaviour. Plugins may override this to
provide extended commands in CImageEncoder
.
|
protected: IMPORT_C virtual void NotifyComplete();
Plugin defined actions resulting from a call by CImageEncoderPlugin::RequestComplete(TInt)
.
This function is called when a CImageEncoderPlugin::RequestComplete(TInt)
is issued indicating that an asynchronous command has finished. Plugins can extend this function to clear any custom command
flags.
protected: IMPORT_C TBool AmInThread() const;
Indicates if this encoder is running in a separate thread.
|
protected: IMPORT_C TBool ShouldAbort() const;
Indicates if an encode should abort early (ie. following a Cancel).
Note: This function always returns EFalse unless the encoder is running in its own thread.
|
private: IMPORT_C virtual void WriteExifDataL(TRequestStatus *&aScaleCompletionStatus);
Originally only used by the jpeg codec, but now in use as a generic pre-convert async step
|