|
||
class CImageDecoderPlugin : public CBase;
The PluginAPI for Image Converter Library decoder plugins.
Intended for use by plugin writers only.
CBase
-
Base class for all classes to be instantiated on the heap.
CImageDecoderPlugin
-
The PluginAPI for Image Converter Library decoder plugins.
Defined in CImageDecoderPlugin
:
AmInThread()const
Indicates if this decoder is running in a separate thread.AppendImageData(const TImageDataBlock *)
Appends a new image data data block to the end of the internally held array.AppendImageDataBuffer(const HBufC8 *)
Appends a new image data buffer to the end of the internally held arrayCImageDecoderPlugin()
Constructor for this class. Cleanup()
Called when the plugin is destroyed or a decode is cancelled. This may be overri...DataLength()const
Returns the maximum number of bytes of data that can be decoded.Destination()const
Returns the destination bitmap.DestinationMask()const
Returns the destination bitmap mask.DoConvert()
Performs a decode step. This effectively forms the RunL() call of the decoder.FrameBlockSize(TInt)const
Returns the block size used in the specified frame. Always returns 4096 regardle...FrameCommentL(TInt,TInt)const
Returns a particular comment attatched to a given frame of the image.FrameData(TInt)const
Returns the frame data for a specified frame of the image.FrameHeaderBlockSize(TInt)const
Returns the block size used in the specified frame's header. Always returns 4096...FrameInfo(TInt)const
Returns the frame info for a specified frame of the image.FrameInfoStringsL(RFs &,TInt)
Returns the codec specific frame information stored in resource files.HandleCustomSyncL(TInt)
Called as a result of an associated CImageDecoder::CustomSyncL(TInt) function be...HandleProcessFrameResult(TInt,TFrameState)
Deals with result from ProcessFrameL(). This function processes the results of t...ImageCommentL(TInt)const
Returns a particular comment attatched to the image. Ownership of the returned b...ImageData(TInt)const
Returns the image data block for the specified index.ImageDataCount()const
Returns the number of image data blocks present in the image data.ImageInfo()const
Returns image information such as colour depth, scaling support etc.ImageReadCodec()const
Returns the plugin's read codec.ImageType(TInt,TUid &,TUid &)const
Returns the image type and sub-type for a given frame of the image that has just...InitConvertL()
Initialises data structures prior to decoding a frame.InitCustomAsyncL(TInt)
Called as a result of the associated CImageDecoder::CustomAsync(TRequestStatus *...InsertImageData(const TImageDataBlock *,TInt)
Inserts an image data block into the internally held array at the specified posi...IsImageHeaderProcessingComplete()const
Returns the status of header processing. If the processing is incomplete or not ...NotifyComplete()
Plugin defined actions resulting from a call by CImageDecoderPlugin::RequestComp...NumberOfFrameComments(TInt)const
Returns the number of comments attatched to a given frame of the image.NumberOfFrames()const
Returns the number of frames to be decoded.NumberOfImageComments()const
Returns the number of comments attatched to the image.OpenExtraResourceFileLC(RFs &,const TUid,RResourceFile &)const
Locates the extra resource file for the decoder aUid_extra.rsc, opens the resour...Position()const
Returns the current position within the data.PrepareForProcessFrameL()
Initialises system for ProcessFrameL(). This reads in a new buffer for ProcessFr...ReadDataL(TInt,TPtrC8 &,TInt)
Reads a block of data into an internal buffer.ReadFrameHeadersL()
Invokes the ReadFrameHeadersL method of the supplied plugin which should process...RemoveImageData(TInt)
Removes a specified image data block from the internally held array.RequestComplete(TInt)
Must be called on completion of decoding the image data.RequestInitL(TInt)
Forces initialization of data structures prior to decoding a frame.ScanDataL()
Invokes the CImageDecoderPlugin::ReadFrameHeadersL() method of the supplied plug...SelfComplete(TInt)
Must be called at the end of a slice of decoding.SetDataLength(TInt)
Sets the maximum number of bytes of data that can be decoded.SetImageInfo(const TFrameInfo &)
Sets the image information.SetImageReadCodec(CImageReadCodec *)
Sets the plugin's read codec. Ownership of the codec is transferred to the plugi...SetPosition(const TInt)
Sets the current position in the data.SetSelfPending()
May be called at the start of a slice of decoding if the decoding is expected to...SetStartPosition(TInt)
Sets the starting position of the frame to be decoded.SetThumbnailData(HBufC8 *)
Passes a pointer to a descriptor containing the thumbnail from the plugin to the...ShouldAbort()const
Indicates if the decoder should abort early ie. following a call to Cancel().SourceData()
Value to be fed to CImageReadCodec::ProcessFrameL(TBufPtr8 &).SourceLength()const
Returns the length of the source data in bytes.StartPosition()const
Returns the starting position of the frame to be decoded.ValidDestination()const
Returns the validity of the destination bitmap.ValidDestinationMask()const
Indicates if the destination bitmap mask is valid.~CImageDecoderPlugin()
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 TInt NumberOfImageComments() const;
Returns the number of comments attatched to the image.
Some image formats allow comments to be attached to the entire image, others allow comments to be attached to individual frames
within the image. Use this function to retrieve the number of comments in the image. Use CImageDecoderPlugin::NumberOfFrameComments(TInt)const
for the frame equivalent.
|
IMPORT_C virtual HBufC* ImageCommentL(TInt aCommentNumber) const;
Returns a particular comment attatched to the image. Ownership of the returned buffer is transferred to the caller.
|
|
IMPORT_C virtual TInt NumberOfFrameComments(TInt aFrameNumber) const;
Returns the number of comments attatched to a given frame of the image.
Use CImageDecoderPlugin::NumberOfImageComments()const
for the image equivalent.
|
|
IMPORT_C virtual HBufC* FrameCommentL(TInt aFrameNumber, TInt aCommentNumber) const;
Returns a particular comment attatched to a given frame of the image.
Ownership of the returned buffer is transferred to the caller.
|
|
virtual void ImageType(TInt aFrameNumber, TUid &aImageType, TUid &aImageSubType) const=0;
Returns the image type and sub-type for a given frame of the image that has just been opened.
This is a virtual function that each individual plugin must implement.
|
protected: IMPORT_C virtual void Cleanup();
Called when the plugin is destroyed or a decode is cancelled. This may be overriden in derived classes.
Note: Derived classes must call this version after performing any plugin specific cleanup.
protected: IMPORT_C virtual void ReadFrameHeadersL();
Invokes the ReadFrameHeadersL method of the supplied plugin which should process the frame headers contained within the image.
protected: virtual void ScanDataL()=0;
Invokes the CImageDecoderPlugin::ReadFrameHeadersL()
method of the supplied plugin.
The plugin's version of CImageDecoderPlugin::ReadFrameHeadersL()
should read the image header information, create the required codec and read the frame headers.
This is a virtual function that each individual plugin must implement.
protected: IMPORT_C virtual TInt FrameHeaderBlockSize(TInt aFrameNumber) const;
Returns the block size used in the specified frame's header. Always returns 4096 regardless of the frame number specified. Should be overriden by codecs that use larger blocks.
|
|
protected: IMPORT_C virtual TInt FrameBlockSize(TInt aFrameNumber) const;
Returns the block size used in the specified frame. Always returns 4096 regardless of the frame number specified. Should be overriden by codecs that use larger blocks.
|
|
protected: IMPORT_C virtual CFrameInfoStrings* FrameInfoStringsL(RFs &aFs, TInt aFrameNumber=0)=0;
Returns the codec specific frame information stored in resource files.
This is a virtual function that each individual plugin must implement.
|
|
protected: IMPORT_C void OpenExtraResourceFileLC(RFs &aFs, const TUid aUid, RResourceFile &aResourceFile) const;
Locates the extra resource file for the decoder aUid_extra.rsc, opens the resource file and pushes it on the cleanup stack.
If the resource file is not found the method leaves with KErrNotFound. If more than one resource file is found, only the first one is opened.
|
protected: IMPORT_C void ReadDataL(TInt aPosition, TPtrC8 &aReadBuffer, TInt aLength);
Reads a block of data into an internal buffer.
A block of data of size aLength is read from the position specified by aPosition to an internal data buffer. After a successful read, aReadBuffer is set to point to the internal buffer.
If an attempt is made to read past the end of data, all available data is read and the descriptors length will indicate the actual number of bytes read.
|
protected: IMPORT_C virtual void InitConvertL();
Initialises data structures prior to decoding a frame.
This function may be overriden in derived classes. Any override should also call this version after performing any plugin initialistion.
protected: IMPORT_C void RequestInitL(TInt aFrameNumber);
Forces initialization of data structures prior to decoding a frame.
|
protected: IMPORT_C virtual void DoConvert();
Performs a decode step. This effectively forms the RunL() call of the decoder.
This call may be overriden in derived classes. However, if this the case, then if the custom decode is not performed and the
derived class should either ensure that this base class's version is called or should completely replace the base class's
version calling CImageDecoderPlugin::PrepareForProcessFrameL()
, ProcessFrameL() and CImageDecoderPlugin::HandleProcessFrameResult(TInt,TFrameState)
as appropriate. Unlike the standard version, an override instance may choose to spread these calls over several RunL() instances.
protected: IMPORT_C void PrepareForProcessFrameL();
Initialises system for ProcessFrameL(). This reads in a new buffer for ProcessFrameL().
protected: IMPORT_C void HandleProcessFrameResult(TInt aErrCode, TFrameState aCodecState);
Deals with result from ProcessFrameL(). This function processes the results of the standard ProcessFrameL() call, feeding
in the resultant error code from its TRAP and the status result. It will call CImageDecoderPlugin::RequestComplete(TInt)
or CImageDecoderPlugin::SelfComplete(TInt)
as appropriate.
Note that if no data was consumed by ProcessFrameL(), CImageDecoderPlugin::HandleProcessFrameResult(TInt,TFrameState)
assumes that it requires more data and calls RequestComplete(KErrUnderflow). If this is not appropriate, an overloaded CImageDecoderPlugin::DoConvert()
should be made to handle it.
|
protected: IMPORT_C TBufPtr8& SourceData();
Value to be fed to CImageReadCodec::ProcessFrameL(TBufPtr8 &)
.
This value is setup by CImageDecoderPlugin::PrepareForProcessFrameL()
- it returns the value that will be fed to CImageReadCodec::ProcessFrameL(TBufPtr8 &)
, and will be used by codecs that fully override CImageDecoderPlugin::DoConvert()
.
|
protected: IMPORT_C void RequestComplete(TInt aReason);
Must be called on completion of decoding the image data.
|
CImageDecoderPlugin::SelfComplete(TInt)
Must be called at the end of a slice of decoding.protected: IMPORT_C void SelfComplete(TInt aReason);
Must be called at the end of a slice of decoding.
If successful specify KErrNone that results in a repeat call to CImageDecoderPlugin::DoConvert()
.
|
CImageDecoderPlugin::RequestComplete(TInt)
Must be called on completion of decoding the image data.protected: IMPORT_C void SetSelfPending();
May be called at the start of a slice of decoding if the decoding is expected to complete asynchronously. This sets the AO
in CImageDecoderPriv
to active, but does not complete the request.
When decoding of the slice is complete, there must be a call to CImageDecoderPlugin::SelfComplete(TInt)
.
CImageDecoderPlugin::SelfComplete(TInt)
Must be called at the end of a slice of decoding.protected: IMPORT_C TBool IsImageHeaderProcessingComplete() const;
Returns the status of header processing. If the processing is incomplete or not terminated correctly EFalse will be returned
|
protected: IMPORT_C CImageReadCodec* ImageReadCodec() const;
Returns the plugin's read codec.
|
protected: IMPORT_C void SetImageReadCodec(CImageReadCodec *aImageReadCodec);
Sets the plugin's read codec. Ownership of the codec is transferred to the plugin.
|
protected: IMPORT_C const TFrameInfo& ImageInfo() const;
Returns image information such as colour depth, scaling support etc.
|
protected: IMPORT_C void SetImageInfo(const TFrameInfo &aImageInfo);
Sets the image information.
|
protected: IMPORT_C TInt NumberOfFrames() const;
Returns the number of frames to be decoded.
|
protected: IMPORT_C const TImageDataBlock* ImageData(TInt aIndex) const;
Returns the image data block for the specified index.
|
|
protected: IMPORT_C TInt InsertImageData(const TImageDataBlock *aEntry, TInt aPos);
Inserts an image data block into the internally held array at the specified position.
|
|
protected: IMPORT_C TInt AppendImageData(const TImageDataBlock *aEntry);
Appends a new image data data block to the end of the internally held array.
|
|
protected: IMPORT_C void RemoveImageData(TInt aPos);
Removes a specified image data block from the internally held array.
|
protected: IMPORT_C TInt ImageDataCount() const;
Returns the number of image data blocks present in the image data.
|
protected: IMPORT_C TInt AppendImageDataBuffer(const HBufC8 *aImageBuffer);
Appends a new image data buffer to the end of the internally held array
|
|
protected: IMPORT_C TInt DataLength() const;
Returns the maximum number of bytes of data that can be decoded.
|
protected: IMPORT_C void SetDataLength(TInt aDataLength);
Sets the maximum number of bytes of data that can be decoded.
|
protected: IMPORT_C TInt Position() const;
Returns the current position within the data.
|
protected: IMPORT_C void SetPosition(const TInt aPosition);
Sets the current position in the data.
|
protected: IMPORT_C TInt StartPosition() const;
Returns the starting position of the frame to be decoded.
|
protected: IMPORT_C void SetStartPosition(TInt aDataLength);
Sets the starting position of the frame to be decoded.
|
protected: IMPORT_C const CFbsBitmap& Destination() const;
Returns the destination bitmap.
|
protected: IMPORT_C TBool ValidDestination() const;
Returns the validity of the destination bitmap.
|
protected: IMPORT_C const CFbsBitmap& DestinationMask() const;
Returns the destination bitmap mask.
|
protected: IMPORT_C TBool ValidDestinationMask() const;
Indicates if the destination bitmap mask is valid.
|
protected: IMPORT_C const TFrameInfo& FrameInfo(TInt aFrameNumber=0) const;
Returns the frame info for a specified frame of the image.
This function can be called immediately after the call to create the decoder, thus enabling the caller to know about each frame in advance of decoding it.
|
|
protected: IMPORT_C const CFrameImageData& FrameData(TInt aFrameNumber=0) const;
Returns the frame data for a specified frame of the image.
|
|
protected: IMPORT_C TInt SourceLength() const;
Returns the length of the source data in bytes.
|
protected: IMPORT_C virtual void HandleCustomSyncL(TInt aParam);
Called as a result of an associated CImageDecoder::CustomSyncL(TInt)
function being called. Plugins may override this to provide extended commands in CImageDecoder
. Default version leaves with KErrNotSupported.
|
protected: IMPORT_C virtual void InitCustomAsyncL(TInt aParam);
Called as a result of the associated CImageDecoder::CustomAsync(TRequestStatus *,TInt)
function being called.
If this function finishes normally, then a convert cycle is started - so that CImageDecoderPlugin::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().
Plugins may override this to provide extended commands in CImageDecoder.Users of CImageEncoder
can then use the extended encoder functions by calling CustomAsync, rather than CImageEncoder::Convert(TRequestStatus *,const CFbsBitmap &,const CFrameImageData *)
.
By default this function leaves with KErrNotSupported unless overriden.
|
protected: IMPORT_C virtual void NotifyComplete();
Plugin defined actions resulting from a call by CImageDecoderPlugin::RequestComplete(TInt)
.
This function is called when a CImageDecoderPlugin::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 decoder is running in a separate thread.
|
protected: IMPORT_C TBool ShouldAbort() const;
Indicates if the decoder should abort early ie. following a call to Cancel().
Note: This function always returns false unless the decoder is running in its own thread.
|