CImageFrame Class Reference

#include <imageframe.h>

class CImageFrame : public CBase

Inherits from

Public Member Functions
~CImageFrame()
virtual IMPORT_C TDes8 &Data()
virtual IMPORT_C const TDesC8 &Data()
virtual IMPORT_C RChunk &DataChunk()
virtual IMPORT_C TIntDataOffset()
virtual IMPORT_C const TFrameFormatBase &FrameFormat()
virtual IMPORT_C const TFrameLayoutBase &FrameLayout()
virtual IMPORT_C const TSize &FrameSizeInPixels()
virtual IMPORT_C TBoolIsChunk()
virtual IMPORT_C TIntMaxBufferSize()
IMPORT_C CImageFrame *NewL(const TDes8 &, TInt)
IMPORT_C CImageFrame *NewL(const TDes8 &, TInt, const TSize &, const TFrameFormatBase &, const TFrameLayoutBase &)
IMPORT_C CImageFrame *NewL(const RChunk *, TInt, TInt)
IMPORT_C CImageFrame *NewL(const RChunk *, TInt, TInt, const TSize &, const TFrameFormatBase &, const TFrameLayoutBase &)
virtual IMPORT_C voidSetFrameFormatL(const TFrameFormatBase &)
virtual IMPORT_C voidSetFrameLayoutL(const TFrameLayoutBase &)
virtual IMPORT_C voidSetFrameSizeInPixels(const TSize &)
Protected Member Functions
CImageFrame()
IMPORT_C voidConstructL(const TDes8 &, TInt)
IMPORT_C voidConstructL(const TDes8 &, TInt, const TSize &, const TFrameFormatBase &, const TFrameLayoutBase &)
IMPORT_C voidConstructL(const RChunk *, TInt, TInt)
IMPORT_C voidConstructL(const RChunk *, TInt, TInt, const TSize &, const TFrameFormatBase &, const TFrameLayoutBase &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
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()

Detailed Description

CImageFrame class exposes an API for accessing binary image data in a uniform way. It is implemented as a wrapper around TDes8 or RChunk objects.

Constructor & Destructor Documentation

CImageFrame ( )

IMPORT_CCImageFrame()[protected]

Constructor for the CImageFrame class.

~CImageFrame ( )

IMPORT_C~CImageFrame()

Destructor for the CImageFrame class.

Member Function Documentation

ConstructL ( const TDes8 &, TInt )

IMPORT_C voidConstructL(const TDes8 &aBuffer,
TIntaMaxBufferSize
)[protected]

Function used to initialise a CImageFrame object encapsulating a descriptor.

Parameters
aBufferA reference to the TDes8 object encapsulated by the CImageFrame object.
aMaxBufferSizeThe maximum space in bytes reserved for this frame.
Leave Codes
KErrArgument
KErrNoMemoryor other system wide error code.

ConstructL ( const TDes8 &, TInt, const TSize &, const TFrameFormatBase &, const TFrameLayoutBase & )

IMPORT_C voidConstructL(const TDes8 &aBuffer,
TIntaMaxBufferSize,
const TSize &aFrameSize,
const TFrameFormatBase &aFrameFormat,
const TFrameLayoutBase &aFrameLayout
)[protected]

Function used to initialise a CImageFrame object encapsulating a descriptor.

Parameters
aBufferA reference to the TDes8 object encapsulated by the CImageFrame object.
aMaxBufferSizeThe maximum space in bytes reserved for this frame.
aFrameSizeA reference to a TSize object that defines the frame size in pixels of the CImageFrame object.
aFrameFormatA reference to a TFrameFormatBase object that defines the format of the CImageFrame object.
aFrameLayoutA reference to a TFrameLayoutBase object that defines the memory layout of the CImageFrame object.
Leave Codes
KErrArgument
KErrNoMemoryor other system wide error code.

ConstructL ( const RChunk *, TInt, TInt )

IMPORT_C voidConstructL(const RChunk *aBuffer,
TIntaMaxBufferSize,
TIntaDataOffset
)[protected]

Function used to initialise a CImageFrame object encapsulating a chunk.

Parameters
aBufferA pointer to the RChunk object encapsulated by the CImageFrame object.
aMaxBufferSizeThe maximum space in bytes reserved for this frame.
aDataOffsetThe offset in bytes at which the data for this frame starts from the chunk start.
Leave Codes
KErrArgument
KErrNoMemoryor other system wide error code.

ConstructL ( const RChunk *, TInt, TInt, const TSize &, const TFrameFormatBase &, const TFrameLayoutBase & )

IMPORT_C voidConstructL(const RChunk *aBuffer,
TIntaMaxBufferSize,
TIntaDataOffset,
const TSize &aFrameSize,
const TFrameFormatBase &aFrameFormat,
const TFrameLayoutBase &aFrameLayout
)[protected]

Function used to initialise a CImageFrame object encapsulating a chunk.

Parameters
aBufferA pointer to the RChunk object encapsulated by the CImageFrame object.
aMaxBufferSizeThe maximum space in bytes reserved for this frame.
aDataOffsetThe offset in bytes at which the data for this frame starts from the chunk start.
aFrameSizeA reference to a TSize object that defines the frame size in pixels of the CImageFrame object.
aFrameFormatA reference to a TFrameFormatBase object that defines the format of the CImageFrame object.
aFrameLayoutA reference to a TFrameLayoutBase object that defines the memory layout of the CImageFrame object.
Leave Codes
KErrArgument
KErrNoMemoryor other system wide error code.

Data ( )

IMPORT_C TDes8 &Data()[virtual]

Provides a writeable TDes8 reference to the data buffer. The reference can be used for reading and writing the data.

Return Value
A writeable TDes8 reference to the data buffer.

Data ( )

IMPORT_C const TDesC8 &Data()const [virtual]

Provides a TDesC8 reference to the data buffer. The reference can only be used for reading the data.

Return Value
A TDesC8 reference to the data buffer for reading only.

DataChunk ( )

IMPORT_C RChunk &DataChunk()[virtual]

Returns a reference to the chunk encapsulated by the CImageFrame object.

Note:

The function will panic if the object does not encapsulate an RChunk. Before calling this function call IsChunk() to check if the CImageFrame object encapsulates a chunk.

Return Value
A reference to the chunk.
Panic Codes
EInvalidValueif the

DataOffset ( )

IMPORT_C TIntDataOffset()const [virtual]

Returns the offset at which the data for this frame starts. For CImageFrame objects encapsulating descriptors the offset is zero.

Return Value
The offset at which the data for this frame starts in bytes.

FrameFormat ( )

IMPORT_C const TFrameFormatBase &FrameFormat()const [virtual]

Returns the format of the CImageFrame object.

Return Value
A reference to a TFrameFormatBase object that describes the format of the CImageFrame object.

FrameLayout ( )

IMPORT_C const TFrameLayoutBase &FrameLayout()const [virtual]

Returns the memory layout of the CImageFrame object.

Return Value
A reference to a TFrameLayoutBase object that describes the memory layout of the CImageFrame object.

FrameSizeInPixels ( )

IMPORT_C const TSize &FrameSizeInPixels()const [virtual]

Returns the size in pixels of the image the CImageFrame refers to.

Return Value
The image size in pixels.

IsChunk ( )

IMPORT_C TBoolIsChunk()const [virtual]

Returns whether CImageFrame object encapsulates a chunk.

Return Value
ETrue if the CImageFrame object uses a chunk, otherwise EFalse.

MaxBufferSize ( )

IMPORT_C TIntMaxBufferSize()const [virtual]

Returns the maximum space reserved for this frame.

Return Value
The maximum space in bytes reserved for this frame.

NewL ( const TDes8 &, TInt )

IMPORT_C CImageFrame *NewL(const TDes8 &aBuffer,
TIntaMaxBufferSize
)[static]

Factory function used to create a CImageFrame object encapsulating a descriptor.

Parameters
aBufferA reference to the TDes8 object encapsulated by the CImageFrame object.
aMaxBufferSizeThe maximum space in bytes reserved for this frame.
Return Value
A pointer to the newly created CImageFrame object.
Leave Codes
KErrArgument
KErrNoMemoryor other system wide error code.

NewL ( const TDes8 &, TInt, const TSize &, const TFrameFormatBase &, const TFrameLayoutBase & )

IMPORT_C CImageFrame *NewL(const TDes8 &aBuffer,
TIntaMaxBufferSize,
const TSize &aFrameSize,
const TFrameFormatBase &aFrameFormat,
const TFrameLayoutBase &aFrameLayout
)[static]

Factory function used to create a CImageFrame object encapsulating a descriptor.

Parameters
aBufferA reference to the TDes8 object encapsulated by the CImageFrame object.
aMaxBufferSizeThe maximum space in bytes reserved for this frame.
aFrameSizeA reference to a TSize object that defines the frame size in pixels of the CImageFrame object.
aFrameFormatA reference to a TFrameFormatBase object that defines the format of the CImageFrame object.
aFrameLayoutA reference to a TFrameLayoutBase object that defines the memory layout of the CImageFrame object.
Return Value
A pointer to the newly created CImageFrame object.
Leave Codes
KErrArgument
KErrNoMemoryor other system wide error code.

NewL ( const RChunk *, TInt, TInt )

IMPORT_C CImageFrame *NewL(const RChunk *aBuffer,
TIntaMaxBufferSize,
TIntaDataOffset
)[static]

Factory function used to create a CImageFrame object encapsulating a chunk.

Parameters
aBufferA pointer to the RChunk object encapsulated by the CImageFrame object.
aMaxBufferSizeThe maximum space in bytes reserved for this frame.
aDataOffsetThe offset in bytes at which the data for this frame starts.
Return Value
A pointer to the newly created CImageFrame object.
Leave Codes
KErrArgument
KErrNoMemoryor other system wide error code.

NewL ( const RChunk *, TInt, TInt, const TSize &, const TFrameFormatBase &, const TFrameLayoutBase & )

IMPORT_C CImageFrame *NewL(const RChunk *aBuffer,
TIntaMaxBufferSize,
TIntaDataOffset,
const TSize &aFrameSize,
const TFrameFormatBase &aFrameFormat,
const TFrameLayoutBase &aFrameLayout
)[static]

Factory function used to create a CImageFrame object encapsulating a chunk.

Parameters
aBufferA pointer to the RChunk object encapsulated by the CImageFrame object.
aMaxBufferSizeThe maximum space in bytes reserved for this frame.
aDataOffsetThe offset in bytes at which the data for this frame starts from the chunk start.
aFrameSizeA reference to a TSize object that defines the frame size in pixels of the CImageFrame object.
aFrameFormatA reference to a TFrameFormatBase object that defines the format of the CImageFrame object.
aFrameLayoutA reference to a TFrameLayoutBase object that defines the memory layout of the CImageFrame object.
Return Value
A pointer to the newly created CImageFrame object.
Leave Codes
KErrArgument
KErrNoMemoryor other system wide error code.

SetFrameFormatL ( const TFrameFormatBase & )

IMPORT_C voidSetFrameFormatL(const TFrameFormatBase &aFormat)[virtual]

Sets the format of the CImageFrame object.

Parameters
aFormatA reference to a TFrameFormatBase object that is used to set the format of the CImageFrame.
Leave Codes
KErrNoMemory

SetFrameLayoutL ( const TFrameLayoutBase & )

IMPORT_C voidSetFrameLayoutL(const TFrameLayoutBase &aFrameLayout)[virtual]

Sets the layout of the CImageFrame object.

Parameters
aFrameLayoutA reference to a TFrameLayoutBase object that is used to set the memory layout of the CImageFrame object.
Leave Codes
KErrNoMemory

SetFrameSizeInPixels ( const TSize & )

IMPORT_C voidSetFrameSizeInPixels(const TSize &aFrameSize)[virtual]

Sets the size in pixels of the image CImageFrame refers to.

Parameters
aFrameSizeA reference to a TSize object used to set the image size (in pixels) for the CImageFrame object.
Panic Codes
EInvalidValueif the framesize value is invalid.