CImageDecoderPriv Class Reference

class CImageDecoderPriv : public CActive

Inherits from

Public Member Functions
~CImageDecoderPriv ()
TBool AmInThread ()
TInt AppendImageData (const TImageDataBlock *)
TInt AppendImageDataBuffer (const HBufC8 *)
void BodyHandleCustomSyncL ( TInt )
void BodyInitCustomAsyncL ( TInt )
void BodyNotifyComplete ()
void Cleanup ()
void ContinueConvert ( RThread &, TRequestStatus *)
void ContinueProcessingHeaderL ()
void Convert ( RThread &, TRequestStatus *, CFbsBitmap &, TInt )
void Convert ( RThread &, TRequestStatus *, CFbsBitmap &, CFbsBitmap &, TInt )
void CreateFrameInfoL ()
void CreatePluginL ()
void CustomAsync ( RThread &, TRequestStatus *, TInt )
void CustomSyncL ( TInt )
TInt DataLength ()
CImageDecoder::TOptions DecoderOptions ()
void DeleteFrameInfoL ()
const CFbsBitmap & Destination ()
const CFbsBitmap & DestinationMask ()
void DoConvert ()
TInt FrameCount ()
const CFrameImageData & FrameData ( TInt )
const TFrameInfo & FrameInfo ( TInt )
CFrameInfoStrings * FrameInfoStringsLC ( TInt )
TInt GetDestinationSize ( TSize &, TInt )
void GetExtensionL ( TUid , MImageConvExtension *&)
void HandleNewlyOpenedImageL ()
void HandleProcessFrameResult ( TInt , TFrameState )
const TImageDataBlock * ImageData ( TInt )
TInt ImageDataCount ()
const TFrameInfo & ImageInfo ()
CImageReadCodec * ImageReadCodec ()
TUid ImplementationUid ()
void InitConvertL ()
TInt InsertImageData (const TImageDataBlock *, TInt )
TBool IsImageHeaderProcessingComplete ()
CImageDecoderPriv * NewL ( CImageDecodeConstruct *, MImageDecoderPrivSupport *)
TInt NumberOfFrames ()
CImageDecoderPlugin * Plugin ()
TInt Position ()
void PrepareForProcessFrameL ()
void ReadDataL ( TInt , TPtrC8 &, TInt )
void ReadFrameHeadersL ()
TInt ReducedSize (const TSize &, TInt , TSize &)
TInt ReductionFactor (const TSize &, const TSize &)
void RegisterClientRequestStatus ( RThread &, TRequestStatus *)
void RemoveImageData ( TInt )
void RequestComplete ( TInt )
void RequestInitL ( TInt )
void SelfComplete ( TInt )
TInt SetAgentProperty (TAgentProperty, TInt )
void SetClippingRectL (const TRect *)
void SetDataL ( RFs &, const TDesC8 &, const CImageDecoder::TOptions )
void SetDataLength ( TInt )
void SetFileL ( RFs &, const TDesC &, const CImageDecoder::TOptions )
void SetFileL ( RFile &, const CImageDecoder::TOptions )
void SetImageInfo (const TFrameInfo &)
void SetImageReadCodec ( CImageReadCodec *)
void SetImageTypeL ( TInt )
void SetIntent (TIntent)
void SetPosition (const TInt )
void SetSelfPending ()
void SetStartPosition ( TInt )
void SetThumbnailData ( HBufC8 *)
void SetUniqueIdL (const TDesC &)
TBool ShouldAbort ()
TBufPtr8 & SourceData ()
TInt SourceLength ()
void StartActivity ()
TInt StartPosition ()
TBool ValidDestination ()
TBool ValidDestinationMask ()
Protected Member Functions
void CopyBufferToDescriptor ( TDes8 &, const TDesC8 &, TInt , TInt )
TBool MustUseBufferWithDescriptor ()
Private Member Functions
CImageDecoderPriv ( CImageDecodeConstruct *, MImageDecoderPrivSupport *)
TInt DataSizeL ()
void DoCancel ()
void OpenExtraResourceFileLC ( RFs &, const TUid , RResourceFile &)
void RunL ()
void SeekReadL ( TInt , TDes8 &, TInt )
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::RunError(TInt)
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Inherited Enumerations
CActive:TPriority
Private Attributes
TInt iBlockLength
TInt iCachedDataSize
CImageDecodeConstruct * iConstruct
CContent * iContent
TRequestStatus * iConvStatus
TInt iCurrentBlockLength
TInt iCurrentFrame
TBool iCurrentlyProcessingData
CData * iData
TInt iDataLength
CFbsBitmap * iDestination
TInt iDestinationHandle
CFbsBitmap * iDestinationMask
TInt iDestinationMaskHandle
TSize iDestinationSize
TFileName iFileName
RPointerArray < CFrameImageData > iFrameData
RPointerArray < TFrameInfo > iFrameInfo
RFs * iFs
TBool iHaveCompleteImageHeaders
CImageDataArray iImageData
TFrameInfo iImageInfo
TImageParameterData iImageParameterData
CImageReadCodec * iImageReadCodec
TInt iImageType
TIntent iIntent
TBool iIntentHasBeenExecuted
TInt iLastExtent
TInt iLastPos
TInt iNextFrameOffset
TInt iOldSrcDesLength
CImageDecoder::TOptions iOptions
CImageDecoderPlugin * iPlugin
TInt iPosition
TBool iProcessingFrameInfo
HBufC8 * iReadBuffer
TBool iReadOnly
RThread * iRequestThread
TBufPtr8 iSrcDes
TInt iSrcLength
TInt iStartPosition
MImageDecoderPrivSupport * iSupport
HBufC8 * iThumbnailData
HBufC * iUniqueId
TBool iUseBufferReadOptimization
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

CImageDecoderPriv(CImageDecodeConstruct *, MImageDecoderPrivSupport *)

CImageDecoderPriv ( CImageDecodeConstruct * aConstruct,
MImageDecoderPrivSupport * aSupport
) [private]

Parameters

CImageDecodeConstruct * aConstruct
MImageDecoderPrivSupport * aSupport

~CImageDecoderPriv()

~CImageDecoderPriv ( ) [virtual]

Member Functions Documentation

AmInThread()

TBool AmInThread ( ) const

Indicate if running in a separate thread

AppendImageData(const TImageDataBlock *)

TInt AppendImageData ( const TImageDataBlock * aEntry ) [inline]

Parameters

const TImageDataBlock * aEntry

AppendImageDataBuffer(const HBufC8 *)

TInt AppendImageDataBuffer ( const HBufC8 * aImageBuffer ) [inline]

Parameters

const HBufC8 * aImageBuffer

BodyHandleCustomSyncL(TInt)

void BodyHandleCustomSyncL ( TInt aParam ) [inline]

Default version of HandleCustomSyncL - always leaves with KErrNotSupported

Parameters

TInt aParam

BodyInitCustomAsyncL(TInt)

void BodyInitCustomAsyncL ( TInt aParam ) [inline]

Default version of InitCustomAsyncL - always leaves with KErrNotSupported

Parameters

TInt aParam

BodyNotifyComplete()

void BodyNotifyComplete ( ) [inline]

Default version of NotifyComplete - NO-OP

Cleanup()

void Cleanup ( )

ContinueConvert(RThread &, TRequestStatus *)

void ContinueConvert ( RThread & aRequestThread,
TRequestStatus * aRequestStatus
)

Parameters

RThread & aRequestThread
TRequestStatus * aRequestStatus

ContinueProcessingHeaderL()

void ContinueProcessingHeaderL ( )

Convert(RThread &, TRequestStatus *, CFbsBitmap &, TInt)

void Convert ( RThread & aRequestThread,
TRequestStatus * aRequestStatus,
CFbsBitmap & aDestination,
TInt aFrameNumber
)

Parameters

RThread & aRequestThread
TRequestStatus * aRequestStatus
CFbsBitmap & aDestination
TInt aFrameNumber

Convert(RThread &, TRequestStatus *, CFbsBitmap &, CFbsBitmap &, TInt)

void Convert ( RThread & aRequestThread,
TRequestStatus * aRequestStatus,
CFbsBitmap & aDestination,
CFbsBitmap & aDestinationMask,
TInt aFrameNumber = 0
)

Parameters

RThread & aRequestThread
TRequestStatus * aRequestStatus
CFbsBitmap & aDestination
CFbsBitmap & aDestinationMask
TInt aFrameNumber = 0

CopyBufferToDescriptor(TDes8 &, const TDesC8 &, TInt, TInt)

void CopyBufferToDescriptor ( TDes8 & aBuffer,
const TDesC8 & aSource,
TInt aPosition,
TInt aSize
) [protected, inline]

Parameters

TDes8 & aBuffer
const TDesC8 & aSource
TInt aPosition
TInt aSize

CreateFrameInfoL()

void CreateFrameInfoL ( )

CreatePluginL()

void CreatePluginL ( )

CustomAsync(RThread &, TRequestStatus *, TInt)

void CustomAsync ( RThread & aRequestThread,
TRequestStatus * aRequestStatus,
TInt aParam
)

Plugin is interrogated with InitCustomAsyncL. If this works, then set internal Convert() cycle going

Parameters

RThread & aRequestThread
TRequestStatus * aRequestStatus
TInt aParam

CustomSyncL(TInt)

void CustomSyncL ( TInt aParam )

Passes on CustomSyncL to plugin

Parameters

TInt aParam

DataLength()

TInt DataLength ( ) const [inline]

DataSizeL()

TInt DataSizeL ( ) [private]

DecoderOptions()

CImageDecoder::TOptions DecoderOptions ( ) const [inline]

DeleteFrameInfoL()

void DeleteFrameInfoL ( )

Destination()

const CFbsBitmap & Destination ( ) const [inline]

DestinationMask()

const CFbsBitmap & DestinationMask ( ) const [inline]

DoCancel()

void DoCancel ( ) [private, virtual]

Implements cancellation of an outstanding request.

This function is called as part of the active object's Cancel() .

It must call the appropriate cancel function offered by the active object's asynchronous service provider. The asynchronous service provider's cancel is expected to act immediately.

DoCancel() must not wait for event completion; this is handled by Cancel() .

CActive::Cancel

DoConvert()

void DoConvert ( )

FrameCount()

TInt FrameCount ( ) const [inline]

Return the number of frames in the image being decoded. This function can be called immediately after the call to create the decoder, thus enabling the caller to know how many frames need to be converted.

FrameData(TInt)

const CFrameImageData & FrameData ( TInt aFrameNumber ) const

Parameters

TInt aFrameNumber

FrameInfo(TInt)

const TFrameInfo & FrameInfo ( TInt aFrameNumber ) const

Parameters

TInt aFrameNumber

FrameInfoStringsLC(TInt)

CFrameInfoStrings * FrameInfoStringsLC ( TInt aFrameNumber )

Parameters

TInt aFrameNumber

GetDestinationSize(TSize &, TInt)

TInt GetDestinationSize ( TSize & aSize,
TInt aFrameNumber = 0
)

Parameters

TSize & aSize
TInt aFrameNumber = 0

GetExtensionL(TUid, MImageConvExtension *&)

void GetExtensionL ( TUid aExtUid,
MImageConvExtension *& aExtPtr
)

Parameters

TUid aExtUid
MImageConvExtension *& aExtPtr

HandleNewlyOpenedImageL()

void HandleNewlyOpenedImageL ( )

HandleProcessFrameResult(TInt, TFrameState)

void HandleProcessFrameResult ( TInt aErrCode,
TFrameState aCodecState
)

Parameters

TInt aErrCode
TFrameState aCodecState

ImageData(TInt)

const TImageDataBlock * ImageData ( TInt aIndex ) const [inline]

Parameters

TInt aIndex

ImageDataCount()

TInt ImageDataCount ( ) const [inline]

ImageInfo()

const TFrameInfo & ImageInfo ( ) const [inline]

ImageReadCodec()

CImageReadCodec * ImageReadCodec ( ) const [inline]

ImplementationUid()

TUid ImplementationUid ( ) const

InitConvertL()

void InitConvertL ( )

InsertImageData(const TImageDataBlock *, TInt)

TInt InsertImageData ( const TImageDataBlock * aEntry,
TInt aPos
) [inline]

Parameters

const TImageDataBlock * aEntry
TInt aPos

IsImageHeaderProcessingComplete()

TBool IsImageHeaderProcessingComplete ( ) const [inline]

Return the status of the image. If the image is incomplete or not terminated correctly EFalse will be returned

MustUseBufferWithDescriptor()

TBool MustUseBufferWithDescriptor ( ) const [protected, inline]

NewL(CImageDecodeConstruct *, MImageDecoderPrivSupport *)

CImageDecoderPriv * NewL ( CImageDecodeConstruct * aConstruct,
MImageDecoderPrivSupport * aSupport
) [static]

Parameters

CImageDecodeConstruct * aConstruct
MImageDecoderPrivSupport * aSupport

NumberOfFrames()

TInt NumberOfFrames ( ) const [inline]

OpenExtraResourceFileLC(RFs &, const TUid, RResourceFile &)

void OpenExtraResourceFileLC ( RFs & aFs,
const TUid aUid,
RResourceFile & aResourceFile
) const [private]

Parameters

RFs & aFs
const TUid aUid
RResourceFile & aResourceFile

Plugin()

CImageDecoderPlugin * Plugin ( ) const [inline]

Position()

TInt Position ( ) const [inline]

PrepareForProcessFrameL()

void PrepareForProcessFrameL ( )

ReadDataL(TInt, TPtrC8 &, TInt)

void ReadDataL ( TInt aPosition,
TPtrC8 & aReadBuffer,
TInt aLength
)

Parameters

TInt aPosition
TPtrC8 & aReadBuffer
TInt aLength

ReadFrameHeadersL()

void ReadFrameHeadersL ( )

ReducedSize(const TSize &, TInt, TSize &)

TInt ReducedSize ( const TSize & aOriginalSize,
TInt aReductionFactor,
TSize & aReducedSize
) const

Parameters

const TSize & aOriginalSize
TInt aReductionFactor
TSize & aReducedSize

ReductionFactor(const TSize &, const TSize &)

TInt ReductionFactor ( const TSize & aOriginalSize,
const TSize & aReducedSize
) const

Parameters

const TSize & aOriginalSize
const TSize & aReducedSize

RegisterClientRequestStatus(RThread &, TRequestStatus *)

void RegisterClientRequestStatus ( RThread & aRequestThread,
TRequestStatus * aRequestStatus
)

Parameters

RThread & aRequestThread
TRequestStatus * aRequestStatus

RemoveImageData(TInt)

void RemoveImageData ( TInt aPos ) [inline]

Parameters

TInt aPos

RequestComplete(TInt)

void RequestComplete ( TInt aReason )

Parameters

TInt aReason

RequestInitL(TInt)

void RequestInitL ( TInt aFrameNumber )

Parameters

TInt aFrameNumber

RunL()

void RunL ( ) [private, virtual]

Handles an active object's request completion event.

A derived class must provide an implementation to handle the completed request. If appropriate, it may issue another request.

The function is called by the active scheduler when a request completion event occurs, i.e. after the active scheduler's WaitForAnyRequest() function completes.

Before calling this active object's RunL() function, the active scheduler has:

1. decided that this is the highest priority active object with a completed request

2. marked this active object's request as complete (i.e. the request is no longer outstanding)

RunL() runs under a trap harness in the active scheduler. If it leaves, then the active scheduler calls RunError() to handle the leave.

Note that once the active scheduler's Start() function has been called, all user code is run under one of the program's active object's RunL() or RunError() functions.

CActiveScheduler::Start CActiveScheduler::Error CActiveScheduler::WaitForAnyRequest TRAPD

SeekReadL(TInt, TDes8 &, TInt)

void SeekReadL ( TInt aPosition,
TDes8 & aDest,
TInt aSize
) [private]

Issues a read operation by sending the start position along with the destination descriptor and size.

When this function is used to read data from a file, it can send the start position and length in one IPC operation, and so avoid having to issue a seek first.

Because ContentAccess::CData does not support a synchronous version of this API, this function takes care of waiting for the operation to complete, and leaves with any error code. This simplifies the calling code.

leave
Any Symbian OS error code.

Parameters

TInt aPosition Position in source data to read from.
TDes8 & aDest The data is written into this descriptor.
TInt aSize Amount of data to read in bytes.

SelfComplete(TInt)

void SelfComplete ( TInt aReason )

Parameters

TInt aReason

SetAgentProperty(TAgentProperty, TInt)

TInt SetAgentProperty ( TAgentProperty aProperty,
TInt aValue
)

Parameters

TAgentProperty aProperty
TInt aValue

SetClippingRectL(const TRect *)

void SetClippingRectL ( const TRect * aClipRect )

Parameters

const TRect * aClipRect

SetDataL(RFs &, const TDesC8 &, const CImageDecoder::TOptions)

void SetDataL ( RFs & aFs,
const TDesC8 & aSourceData,
const CImageDecoder::TOptions aOptions = CImageDecoder::EOptionNone
)

Parameters

RFs & aFs
const TDesC8 & aSourceData
const CImageDecoder::TOptions aOptions = CImageDecoder::EOptionNone

SetDataLength(TInt)

void SetDataLength ( TInt aDataLength ) [inline]

Parameters

TInt aDataLength

SetFileL(RFs &, const TDesC &, const CImageDecoder::TOptions)

void SetFileL ( RFs & aFs,
const TDesC & aSourceFilename,
const CImageDecoder::TOptions aOptions = CImageDecoder::EOptionNone
)

Parameters

RFs & aFs
const TDesC & aSourceFilename
const CImageDecoder::TOptions aOptions = CImageDecoder::EOptionNone

SetFileL(RFile &, const CImageDecoder::TOptions)

void SetFileL ( RFile & aFile,
const CImageDecoder::TOptions aOptions = CImageDecoder::EOptionNone
)

Parameters

RFile & aFile
const CImageDecoder::TOptions aOptions = CImageDecoder::EOptionNone

SetImageInfo(const TFrameInfo &)

void SetImageInfo ( const TFrameInfo & aImageInfo ) [inline]

Parameters

const TFrameInfo & aImageInfo

SetImageReadCodec(CImageReadCodec *)

void SetImageReadCodec ( CImageReadCodec * aImageReadCodec ) [inline]

Parameters

CImageReadCodec * aImageReadCodec

SetImageTypeL(TInt)

void SetImageTypeL ( TInt aImageType )

Parameters

TInt aImageType

SetIntent(TIntent)

void SetIntent ( TIntent aIntent )

Parameters

TIntent aIntent

SetPosition(const TInt)

void SetPosition ( const TInt aPosition ) [inline]

Parameters

const TInt aPosition

SetSelfPending()

void SetSelfPending ( )

SetStartPosition(TInt)

void SetStartPosition ( TInt aStartPosition ) [inline]

Parameters

TInt aStartPosition

SetThumbnailData(HBufC8 *)

void SetThumbnailData ( HBufC8 * aThumbnailData )

Parameters

HBufC8 * aThumbnailData

SetUniqueIdL(const TDesC &)

void SetUniqueIdL ( const TDesC & aUniqueId )

Parameters

const TDesC & aUniqueId

ShouldAbort()

TBool ShouldAbort ( ) const

Indicate if a decode should abort early (ie. following a Cancel). Always false unless in a thread.

SourceData()

TBufPtr8 & SourceData ( )

SourceLength()

TInt SourceLength ( ) const [inline]

StartActivity()

void StartActivity ( )

StartPosition()

TInt StartPosition ( ) const [inline]

ValidDestination()

TBool ValidDestination ( ) const [inline]

ValidDestinationMask()

TBool ValidDestinationMask ( ) const [inline]

Member Data Documentation

TInt iBlockLength

TInt iBlockLength [private]

TInt iCachedDataSize

TInt iCachedDataSize [private]

Size of data source in bytes. Only valid if data source is read-only.

CImageDecodeConstruct * iConstruct

CImageDecodeConstruct * iConstruct [private]

CContent * iContent

CContent * iContent [private]

TRequestStatus * iConvStatus

TRequestStatus * iConvStatus [private]

TInt iCurrentBlockLength

TInt iCurrentBlockLength [private]

TInt iCurrentFrame

TInt iCurrentFrame [private]

TBool iCurrentlyProcessingData

TBool iCurrentlyProcessingData [private]

CData * iData

CData * iData [private]

TInt iDataLength

TInt iDataLength [private]

CFbsBitmap * iDestination

CFbsBitmap * iDestination [private]

TInt iDestinationHandle

TInt iDestinationHandle [private]

CFbsBitmap * iDestinationMask

CFbsBitmap * iDestinationMask [private]

TInt iDestinationMaskHandle

TInt iDestinationMaskHandle [private]

TSize iDestinationSize

TSize iDestinationSize [private]

TFileName iFileName

TFileName iFileName [private]

RPointerArray< CFrameImageData > iFrameData

RPointerArray < CFrameImageData > iFrameData [private]

RPointerArray< TFrameInfo > iFrameInfo

RPointerArray < TFrameInfo > iFrameInfo [private]

RFs * iFs

RFs * iFs [private]

TBool iHaveCompleteImageHeaders

TBool iHaveCompleteImageHeaders [private]

CImageDataArray iImageData

CImageDataArray iImageData [private]

TFrameInfo iImageInfo

TFrameInfo iImageInfo [private]

TImageParameterData iImageParameterData

TImageParameterData iImageParameterData [private]

CImageReadCodec * iImageReadCodec

CImageReadCodec * iImageReadCodec [private]

TInt iImageType

TInt iImageType [private]

TIntent iIntent

TIntent iIntent [private]

TBool iIntentHasBeenExecuted

TBool iIntentHasBeenExecuted [private]

TInt iLastExtent

TInt iLastExtent [private]

Byte after last data block which was read from data source.

TInt iLastPos

TInt iLastPos [private]

Start byte of last read from data file.

TInt iNextFrameOffset

TInt iNextFrameOffset [private]

TInt iOldSrcDesLength

TInt iOldSrcDesLength [private]

CImageDecoder::TOptions iOptions

CImageDecoder::TOptions iOptions [private]

CImageDecoderPlugin * iPlugin

CImageDecoderPlugin * iPlugin [private]

TInt iPosition

TInt iPosition [private]

TBool iProcessingFrameInfo

TBool iProcessingFrameInfo [private]

HBufC8 * iReadBuffer

HBufC8 * iReadBuffer [private]

TBool iReadOnly

TBool iReadOnly [private]

Flag to indicate if file input is read only or will grow

RThread * iRequestThread

RThread * iRequestThread [private]

TBufPtr8 iSrcDes

TBufPtr8 iSrcDes [private]

TInt iSrcLength

TInt iSrcLength [private]

TInt iStartPosition

TInt iStartPosition [private]

MImageDecoderPrivSupport * iSupport

MImageDecoderPrivSupport * iSupport [private]

HBufC8 * iThumbnailData

HBufC8 * iThumbnailData [private]

HBufC * iUniqueId

HBufC * iUniqueId [private]

TBool iUseBufferReadOptimization

TBool iUseBufferReadOptimization [private]

Flag to Check whether to Use Image buffer read optimization