CFbsBitmap Class Reference

#include <fbs.h>

Link against: fbscli.lib

class CFbsBitmap : public CBase

Inherits from

Protected Attributes
CBitwiseBitmap *iAddressPointer
RFbsSession *iFbs
TUint16 iFlags
TInt iHandle
TInt iServerHandle
TInt16 iUseCount
Protected Member Enumerations
enumanonymous { EIsRomBitmap, EIsExtendedBitmap, EIsReadOnlyBitmapMask }
Public Member Functions
CFbsBitmap()
~CFbsBitmap()
IMPORT_C voidBeginDataAccess()
IMPORT_C TIntCompress()
IMPORT_C TIntCompress(TBitmapfileCompressionScheme)
IMPORT_C voidCompressInBackground(TRequestStatus &)
IMPORT_C TIntCompressInBackground()
IMPORT_C voidCompressInBackground(TRequestStatus &, TBitmapfileCompressionScheme)
IMPORT_C TIntCompressInBackground(TBitmapfileCompressionScheme)
IMPORT_C TIntCreate(const TSize &, TDisplayMode)
IMPORT_C TIntCreateExtendedBitmap(const TSize &, TDisplayMode, TUid, const TAny *, TInt)
IMPORT_C TIntCreateExtendedBitmap(const TSize &, TDisplayMode, TUid, TInt, MFbsExtendedBitmapInitializer &)
IMPORT_C TIntCreateHardwareBitmap(const TSize &, TDisplayMode, TUid)
IMPORT_C TUint32 *DataAddress()
IMPORT_C TIntDataSize()
IMPORT_C TIntDataStride()
IMPORT_C TDisplayModeDisplayMode()
IMPORT_C TIntDuplicate(TInt)
IMPORT_C voidEndDataAccess(TBool)
IMPORT_C TUidExtendedBitmapType()
IMPORT_C voidExternalizeL(RWriteStream &)
IMPORT_C voidExternalizeRectangleL(RWriteStream &, const TRect &)
IMPORT_C TIntGetAllBitmapHandles(RArray< TInt > &)
IMPORT_C HBufC8 *GetDecompressionBuffer(TInt)
IMPORT_C HBufC8 *GetExtraBuffer(TInt)
IMPORT_C TIntGetPalette(CPalette *&)
IMPORT_C voidGetPixel(TRgb &, const TPoint &)
IMPORT_C voidGetScanLine(TDes8 &, const TPoint &, TInt, TDisplayMode)
IMPORT_C voidGetVerticalScanLine(TDes8 &, TInt, TDisplayMode)
IMPORT_C voidGetVerticalScanLine(TDes8 &, TInt, const TPoint &, TDisplayMode)
IMPORT_C TIntHandle()
IMPORT_C TIntHardwareBitmapHandle()
IMPORT_C SEpocBitmapHeaderHeader()
IMPORT_C TIntHorizontalPixelsToTwips(TInt)
IMPORT_C TIntHorizontalTwipsToPixels(TInt)
IMPORT_C TDisplayModeInitialDisplayMode()
IMPORT_C voidInternalizeL(RReadStream &)
IMPORT_C TBoolIsCompressedInRAM()
IMPORT_C TBoolIsFileInRom(const TDesC &, TUint32 *&)
IMPORT_C TBoolIsFileInRom(RFile &, TUint32 *&)
IMPORT_C TBoolIsLargeBitmap()
IMPORT_C TBoolIsMonochrome()
IMPORT_C TBoolIsRomBitmap()
IMPORT_C TBoolIsVolatile()
IMPORT_C TIntLoad(const TDesC &, TInt32, TBool)
IMPORT_C TIntLoad(const TDesC &, TInt32, TBool, TUint)
IMPORT_C TIntLoad(RFile &, TInt32, TBool)
IMPORT_C TIntLoad(RFile &, TInt32, TBool, TUint)
IMPORT_C TIntLoadAndCompress(const TDesC &, TInt32, TBool)
IMPORT_C TIntLoadAndCompress(const TDesC &, TInt32, TBool, TUint)
IMPORT_C TIntLoadAndCompress(RFile &, TInt32, TBool)
IMPORT_C TIntLoadAndCompress(RFile &, TInt32, TBool, TUint)
IMPORT_C voidLockHeap(TBool)
IMPORT_C voidLockHeapLC(TBool)
IMPORT_C voidPaletteAttributes(TBool &, TInt &)
IMPORT_C CFbsRasterizer *Rasterizer()
IMPORT_C voidReset()
IMPORT_C TIntResize(const TSize &)
IMPORT_C TIntSave(const TDesC &)
IMPORT_C TIntSave(RFile &)
IMPORT_C TIntScanLineLength(TInt, TDisplayMode)
IMPORT_C TInt64SerialNumber()
IMPORT_C TIntSetDisplayMode(TDisplayMode)
IMPORT_C voidSetPalette(CPalette *)
IMPORT_C voidSetRomBitmapL(CBitwiseBitmap *, TInt &)
IMPORT_C voidSetScanLine(TDes8 &, TInt)
IMPORT_C voidSetSizeInTwips(const MGraphicsDeviceMap *)
IMPORT_C voidSetSizeInTwips(const TSize &)
IMPORT_C TSizeSizeInPixels()
IMPORT_C TSizeSizeInTwips()
IMPORT_C voidStoreL(const TDesC &, TInt, const TDesC *, TInt32)
IMPORT_C voidStoreL(RFile &, TInt, const TDesC *, TInt32)
IMPORT_C TIntSwapWidthAndHeight()
IMPORT_C TIntTouchCount()
IMPORT_C voidUnlockHeap(TBool)
IMPORT_C voidUnlockHeap(TAny *)
IMPORT_C TIntVerticalPixelsToTwips(TInt)
IMPORT_C TIntVerticalTwipsToPixels(TInt)
Protected Member Functions
CBitwiseBitmap *Address()
CBitwiseBitmap *BeginDataAccessAndGetCleanAddress(TUint32 *&)
IMPORT_C CBitwiseBitmap *CleanAddress()
TInt DoCreate(const TSize &, const TSize *, TDisplayMode, TUid, TInt)
voidDoSaveL(RFile &)
IMPORT_C voidGetScanLine(TDes8 &, const TPoint &, TInt, const TPoint &, TDisplayMode)
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

Note that this class is not intended for user derivation. A bitmap managed by the font and bitmap server. The class also defines some palette functionality which is not yet implemented, since none of the modes currently supported by screen or bitmaps require variable palettes. Note that the CFbsBitmap format is internal to Symbian, but the Image Converter API can be used to convert such bitmaps to standard formats. CFbsBitmap instances cannot be shared between different threads. They use some shared thread local storage data. If you want to share a bitmap between threads, use Duplicate().

See also: CFbsBitmap::Duplicate()

Member Attribute Documentation

iAddressPointer

CBitwiseBitmap *iAddressPointer[protected]

WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only.

iFbs

RFbsSession *iFbs[protected]

WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only.

iFlags

TUint16 iFlags[protected]

WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only.

iHandle

TInt iHandle[protected]

WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only.

iServerHandle

TInt iServerHandle[protected]

WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only.

iUseCount

TInt16 iUseCount[protected]

WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only.

Member Enumeration Documentation

Enum anonymous

WARNING: For internal use ONLY. Compatibility is not guaranteed in future releases.

EnumeratorValueDescription
EIsRomBitmap0x0001
EIsExtendedBitmap0x0002
EIsReadOnlyBitmapMaskEIsRomBitmap | EIsExtendedBitmap

Constructor & Destructor Documentation

CFbsBitmap ( )

IMPORT_CCFbsBitmap()

~CFbsBitmap ( )

IMPORT_C~CFbsBitmap()

Destructor. Calls Reset().

See also: Reset()

Member Function Documentation

Address ( )

CBitwiseBitmap *Address()const [protected]

BeginDataAccess ( )

IMPORT_C voidBeginDataAccess()const

Marks the beginning of direct access to the bitmap data. This function prepares the bitmap for direct access to its pixel data and should be used before calling DataAddress(), otherwise performance may be degraded on certain platforms. Calls to BeginDataAccess() must be coupled with subsequent calls to EndDataAccess().

See also: CFbsBitmap::DataAddress() CFbsBitmap::EndDataAccess()

BeginDataAccessAndGetCleanAddress ( TUint32 *& )

CBitwiseBitmap *BeginDataAccessAndGetCleanAddress(TUint32 *&aDataAddress)const [protected, inline]

CleanAddress ( )

IMPORT_C CBitwiseBitmap *CleanAddress()const [protected]

Compress ( )

IMPORT_C TIntCompress()

Compress ( TBitmapfileCompressionScheme )

IMPORT_C TIntCompress(TBitmapfileCompressionSchemeaScheme)

Compresses bitmap in RAM.

Parameters
aSchemespecifies preferred compression type ERLECompression or EPaletteCompression
Return Value
KErrNone on success, KErrGeneral if the bitmap handle is NULL, KErrAccessDenied if the bitmap is in ROM or it is an extended bitmap, otherwise one of the system wide error codes.

CompressInBackground ( TRequestStatus & )

IMPORT_C voidCompressInBackground(TRequestStatus &aRequestStatus)

Submits the bitmap for asynchronous background compression.

Parameters
aRequestStatusThe request status which will be completed with the appropriate error code after the compression has finished The error code will be KErrNone on success, KErrGeneral if the bitmap handle is NULL, KErrAccessDenied if the bitmap is in ROM or it is an extended bitmap, otherwise one of the system wide error codes.

CompressInBackground ( )

IMPORT_C TIntCompressInBackground()

Submits the bitmap for asynchronous background compression. No notification will be provided when the compression has completed.

Return Value
KErrNone if the bitmap was successfully submitted to the background compression queue, KErrGeneral if the bitmap handle is NULL, KErrAccessDenied if the bitmap is in ROM or it is an extended bitmap, otherwise another of the system-wide error codes.

CompressInBackground ( TRequestStatus &, TBitmapfileCompressionScheme )

IMPORT_C voidCompressInBackground(TRequestStatus &aRequestStatus,
TBitmapfileCompressionSchemeaScheme
)

Submits the bitmap for asynchronous background compression.

Parameters
aRequestStatusThe request status which will be completed with the appropriate error code after the compression has finished. The error code will be KErrNone on success, KErrGeneral if the bitmap handle is NULL, KErrAccessDenied if the bitmap is in ROM or it is an extended bitmap, otherwise one of the system wide error codes.
aSchemeSpecifies preferred compression type: ERLECompression or EPaletteCompression

CompressInBackground ( TBitmapfileCompressionScheme )

IMPORT_C TIntCompressInBackground(TBitmapfileCompressionSchemeaScheme)

Submits the bitmap for asynchronous background compression. No notification will be provided when the compression has completed.

Return Value
KErrNone if the bitmap was successfully submitted to the background compression queue, KErrGeneral if the bitmap handle is NULL, KErrAccessDenied if the bitmap is in ROM or it is an extended bitmap, otherwise another of the system-wide error codes.

Create ( const TSize &, TDisplayMode )

IMPORT_C TIntCreate(const TSize &aSizeInPixels,
TDisplayModeaDispMode
)

Creates a bitmap with the specified size and display mode. The bitmap is created on the font and bitmap server's shared heap.

Parameters
aSizeInPixelsThe size of the bitmap to be created.
aDispModeThe display mode of the bitmap to be created.
Return Value
KErrNone if successful; KErrCouldNotConnect if no connection to the font and bitmap server could be made; KErrArgument if either the width or height specified in aSizeInPixels are negative or if the requested display mode is invalid; KErrTooBig if the requested size is too big.

CreateExtendedBitmap ( const TSize &, TDisplayMode, TUid, const TAny *, TInt )

IMPORT_C TIntCreateExtendedBitmap(const TSize &aSizeInPixels,
TDisplayModeaDispMode,
TUidaType,
const TAny *aData,
TIntaDataSize
)

Creates an extended bitmap. Extended bitmaps are used to store immutable data in a platform-specific format. They cannot be used as targets of graphics contexts, and modification of their data via DataAddress() or TBitmapUtil is not supported and results in undefined behaviour up to and including process termination.

Initialisation of the raw data of the new bitmap is carried out by copying the data pointed to by the parameter aData.

Read-only access to the raw data of an extended bitmap is provided by DataAddress() and DataSize() in conjunction with BeginDataAccess() and EndDataAccess().

Extended bitmaps have a conceptual size in pixels and a conceptual display mode for compatibility purposes. The raw data can be independent of these properties.

See also: CFbsBitmap::DataAddress() CFbsBitmap::DataSize() CFbsBitmap::BeginDataAccess() CFbsBitmap::EndDataAccess()

Parameters
aSizeInPixelsThe conceptual width and height of the new bitmap in pixels.
aDispModeThe conceptual display mode of the new bitmap.
aTypeThe UID identifying the data format of the new bitmap. Used by the extended bitmap rasterizer to distinguish between different data types.
aDataA pointer to the raw data to be stored in the new bitmap.
aDataSizeThe size in bytes of the raw data to be stored in the new bitmap.
Return Value
KErrNone if successful; KErrArgument if the width or height specified in aSizeInPixels is negative, aDispMode is an invalid display mode, aData is NULL, aDataSize is negative or zero, or aDataType is a UID reserved for OS use; KErrTooBig if the width or height specified in aSizeInPixels exceeds KMaxTInt/4, or aDataSize exceeds KMaxTInt/2; otherwise another of the system-wide error codes.

CreateExtendedBitmap ( const TSize &, TDisplayMode, TUid, TInt, MFbsExtendedBitmapInitializer & )

IMPORT_C TIntCreateExtendedBitmap(const TSize &aSizeInPixels,
TDisplayModeaDispMode,
TUidaType,
TIntaDataSize,
MFbsExtendedBitmapInitializer &aInitializer
)

Creates an extended bitmap. Extended bitmaps are used to store immutable data in a platform-specific format. They cannot be used as targets of graphics contexts, and modification of their data via DataAddress() or TBitmapUtil is not supported and results in undefined behaviour up to and including process termination.

Initialisation of the raw data of the new bitmap is carried out by a callback to the MFbsExtendedBitmapInitializer::InitExtendedBitmap() function passed through the parameter aInitializer.

Read-only access to the raw data of an extended bitmap is provided by DataAddress() and DataSize() in conjunction with BeginDataAccess() and EndDataAccess().

Extended bitmaps have a conceptual size in pixels and a conceptual display mode for compatibility purposes. The raw data can be independent of these properties.

See also: CFbsBitmap::DataAddress() CFbsBitmap::DataSize() CFbsBitmap::BeginDataAccess() CFbsBitmap::EndDataAccess() MFbsExtendedBitmapInitializer

Parameters
aSizeInPixelsThe conceptual width and height of the new bitmap in pixels.
aDispModeThe conceptual display mode of the new bitmap.
aTypeThe UID identifying the data format of the new bitmap. Used by the extended bitmap rasterizer to distinguish between different data types.
aDataSizeThe size in bytes of the raw data to be stored in the new bitmap.
aInitializerA reference to the initializer of the raw data to be stored in the new bitmap.
Return Value
KErrNone if successful; KErrArgument if the width or height specified in aSizeInPixels is negative, aDispMode is an invalid display mode, aData is NULL, aDataSize is negative or zero, or aDataType is a UID reserved for OS use; KErrTooBig if the width or height specified in aSizeInPixels exceeds KMaxTInt/4, or aDataSize exceeds KMaxTInt/2; otherwise another of the system-wide error codes.

CreateHardwareBitmap ( const TSize &, TDisplayMode, TUid )

IMPORT_C TIntCreateHardwareBitmap(const TSize &aSizeInPixels,
TDisplayModeaDispMode,
TUidaCreatorUid
)

Creates a hardware bitmap with a size and display mode.

Parameters
aSizeInPixelsThe bitmap's width and height in pixels.
aDispModeThe bitmap's display mode.
aCreatorUidThe UID of the application calling this function. This is used to allow segregation of the memory used for hardware bitmaps. For instance, if a device has video memory attached to display and graphics accelerator hardware, this UID is used to determine whether any video memory is pre-allocated for that application's use.
Return Value
KErrNone if successful, otherwise one of the system wide error codes. These include KErrCouldNotConnect if no connection has been made to the font and bitmap server, KErrArgument if either the width or height specified in aSizeInPixels are negative or if the requested display mode is invalid, or KErrNotSupported if hardware bitmaps are not supported on the device.

DataAddress ( )

IMPORT_C TUint32 *DataAddress()const

Gets the address of the first pixel in the bitmap. The first pixel is at the top-left. Access to the pixel data of a bitmap should be surrounded by calls to BeginDataAccess() and EndDataAccess(), otherwise performance may be degraded on certain platforms.

Note: Performing a Resize() or Compress() operation changes the value returned by this function.

See also: CFbsBitmap::BeginDataAccess() CFbsBitmap::EndDataAccess()

Return Value
The address of the first pixel of the bitmap.

DataSize ( )

IMPORT_C TIntDataSize()const

Gets the size in bytes of the bitmap data.

Return Value
The size in bytes of the bitmap data.

DataStride ( )

IMPORT_C TIntDataStride()const

Gets the length in bytes between scanlines in memory.

Return Value
The length in bytes between scanlines in memory.

DisplayMode ( )

IMPORT_C TDisplayModeDisplayMode()const

Gets the display mode of the bitmap.

Return Value
The display mode of the bitmap.

DoCreate ( const TSize &, const TSize *, TDisplayMode, TUid, TInt )

TInt DoCreate(const TSize &aSizeInPixels,
const TSize *aSizeInTwips,
TDisplayModeaDispMode,
TUidaUid,
TIntaDataSize = 0
)[protected]

Creates a bitmap with the specified size and display mode. The bitmap is created on the font and bitmap server's shared heap. Optionally sets the bitmap's size in twips.

Parameters
aSizeInPixelsThe size of the bitmap to be created.
aSizeInTwipsThe size in twips of the bitmap. Only set if not NULL.
aDispModeThe display mode of the bitmap to be created.
aUidThe creator's UID or, if an extended bitmap, the UID identifying the data format of the bitmap.
aDataSizeIf an extended bitmap is being created, the size in bytes of the raw data. Otherwise NULL.
Return Value
KErrNone if successful; KErrCouldNotConnect if no connection to the font and bitmap server could be made; KErrArgument if either the width or height specified in aSizeInPixels are negative or if the requested display mode is invalid; KErrTooBig if the requested size is too big.

DoSaveL ( RFile & )

voidDoSaveL(RFile &aFile)[protected]

Duplicate ( TInt )

IMPORT_C TIntDuplicate(TIntaHandle)

Duplicates a bitmap. This function does not create a copy of the bitmap. It just assigns another handle to the bitmap in the font and bitmap server, and sets this object's handle to that. If the specified bitmap is in the ROM, it just assigns a pointer to it.

See also: CFbsBitmap::Handle()

Parameters
aHandleThe handle to an existing bitmap.
Return Value
KErrNone if successful; KErrCouldNotConnect if no connection to the font and bitmap server could be made; KErrUnknown if no bitmap could be found with the specified handle number.

EndDataAccess ( TBool )

IMPORT_C voidEndDataAccess(TBoolaReadOnly = EFalse)const

Marks the end of direct access to the bitmap data. Use this function after ending direct access to the bitmap data. Calls to EndDataAccess() must correspond to prior calls to BeginDataAccess(). See BeginDataAccess() for more details.

See also: CFbsBitmap::BeginDataAccess()

Parameters
aReadOnlyTrue if the bitmap data had only been read. False if the data has been modified.

ExtendedBitmapType ( )

IMPORT_C TUidExtendedBitmapType()const

Gets the UID identifying the data format of an extended bitmap.

Return Value
The UID identifying the data format of the bitmap or KNullUid if the bitmap is not an extended bitmap.

ExternalizeL ( RWriteStream & )

IMPORT_C voidExternalizeL(RWriteStream &aStream)const

Externalises the bitmap to the specified stream. Not supported for extended bitmaps.

Parameters
aStreamThe write stream.

ExternalizeRectangleL ( RWriteStream &, const TRect & )

IMPORT_C voidExternalizeRectangleL(RWriteStream &aStream,
const TRect &aRect
)const

Externalises that area of the bitmap contained within a specified rectangular area. Not supported for extended bitmaps.

Parameters
aStreamThe write stream
aRectThe rectangular area of the bitmap to externalise. The bitmap that is externalized will be of this size.

GetAllBitmapHandles ( RArray< TInt > & )

IMPORT_C TIntGetAllBitmapHandles(RArray< TInt > &aBitmapIdArray)const
Gets all the bitmap handles for all the bitmaps stored in the Font Bitmap Server. There is a limit of the number of bitmaps that can be retrieved defined by KMaxBitmapHandleBufferSize. If this limit has been reached then KErrOverflow will be returned.
Parameters
aBitmapIdArrayreturns an array of all the bitmap handles
Return Value
KErrNone if successful, KErrOverflow if the bitmapBuffer is not large enough to store all the bitmap handles, otherwise another of the system-wide error codes.
Capability
ReadDeviceData

GetDecompressionBuffer ( TInt )

IMPORT_C HBufC8 *GetDecompressionBuffer(TIntaSize)[static]

Gets a pointer to the decompression buffer owned by this thread's FBServ session.

Parameters
aSizeThe size in bytes of the scan lines to decompress.
Return Value
A pointer to the decompression buffer or NULL if there is no FBServ session.

GetExtraBuffer ( TInt )

IMPORT_C HBufC8 *GetExtraBuffer(TIntaSize)[static]

Gets a pointer to an extra buffer for general use owned by this thread's FBServ session.

Parameters
aSizeThe size of the buffer in bytes
Return Value
A pointer to the extra buffer if successful or NULL if there is no FBServ session

GetPalette ( CPalette *& )

IMPORT_C TIntGetPalette(CPalette *&aPalette)const

Gets the bitmap's palette. This is not currently supported.

Parameters
aPaletteNot used.
Return Value
KErrNotSupported.

GetPixel ( TRgb &, const TPoint & )

IMPORT_C voidGetPixel(TRgb &aColor,
const TPoint &aPixel
)const
Gets the RGB value of the specified pixel. Note: The method only works for uncompressed bitmaps and extended bitmaps.
Parameters
aColorOn return, the RGB value of the specified pixel.
aPixelThe pixel whose colour is to be determined.
Panic Codes
FBSCLI11 in debug builds if this is a compressed bitmap.

GetScanLine ( TDes8 &, const TPoint &, TInt, TDisplayMode )

IMPORT_C voidGetScanLine(TDes8 &aBuf,
const TPoint &aPixel,
TIntaLength,
TDisplayModeaDispMode
)const

Gets the bitmap's scanline for the specified line starting from the specified point. The dither offset of the bitmap is taken to be TPoint(0,0).

Parameters
aBufThe buffer in which the scanline is returned.
aPixelThe start pixel.
aLengthThe number of pixels to get.
aDispModeFormat to be used to write the data to the buffer.

GetScanLine ( TDes8 &, const TPoint &, TInt, const TPoint &, TDisplayMode )

IMPORT_C voidGetScanLine(TDes8 &aBuf,
const TPoint &aPixel,
TIntaLength,
const TPoint &aDitherOffset,
TDisplayModeaDispMode
)const [protected]

Gets the bitmap's scanline for the specified line starting from the specified point and using the specified dither offset.

Parameters
aBufThe buffer in which the scanline is returned.
aPixelThe start pixel.
aLengthThe number of pixels to get.
aDitherOffsetThe dither offset of the bitmap.
aDispModeFormat to be used to write the data to the buffer.

GetVerticalScanLine ( TDes8 &, TInt, TDisplayMode )

IMPORT_C voidGetVerticalScanLine(TDes8 &aBuf,
TIntaX,
TDisplayModeaDispMode
)const
Gets the bitmap's vertical scanline starting at the specified x co-ordinate. Note: The method only works for uncompressed bitmaps. Note: The dither offset of the bitmap is taken to be TPoint(0,0).
Parameters
aBufThe buffer in which the vertical scanline is returned.
aXThe x co-ordinate of the vertical scanline.
aDispModeFormat to be used to write the data to the buffer.
Panic Codes
FBSCLI11 in debug builds if this is not an ucompressed bitmap or an extended bitmap.

GetVerticalScanLine ( TDes8 &, TInt, const TPoint &, TDisplayMode )

IMPORT_C voidGetVerticalScanLine(TDes8 &aBuf,
TIntaX,
const TPoint &aDitherOffset,
TDisplayModeaDispMode
)const
Gets the bitmap's vertical scanline starting at the specified x co-ordinate and using the specified dither offset. Note: The method only works for uncompressed bitmaps.
Parameters
aBufThe buffer in which the vertical scanline will be returned.
aXThe x co-ordinate of the vertical scanline to get.
aDitherOffsetThe dither offset of the bitmap.
aDispModeFormat to be used to write the data to the buffer.
Panic Codes
FBSCLI11 in debug builds if this is not an ucompressed bitmap or an extended bitmap.

Handle ( )

IMPORT_C TIntHandle()const

Gets the handle number of the bitmap. The returned value can be used to give another thread access to the bitmap.

See also: CFbsBitmap::Duplicate()

Return Value
The handle number of the bitmap.

HardwareBitmapHandle ( )

IMPORT_C TIntHardwareBitmapHandle()const

Returns the handle for the hardware bitmap which this CFbsBitmap is using.

Return Value
The handle to the hardware bitmap. The handle is NULL if it is not a hardware bitmap.

Header ( )

IMPORT_C SEpocBitmapHeaderHeader()const

Creates a bitmap header. This is used when streaming bitmaps to stores.

Return Value
The bitmap header for the bitmap.

HorizontalPixelsToTwips ( TInt )

IMPORT_C TIntHorizontalPixelsToTwips(TIntaPixels)const

Converts a horizontal dimension on the graphics device from pixels to twips.

Parameters
aPixelsA horizontal dimension on the graphics device in pixels.
Return Value
A horizontal dimension on the graphics device in twips.

HorizontalTwipsToPixels ( TInt )

IMPORT_C TIntHorizontalTwipsToPixels(TIntaTwips)const

Converts a horizontal dimension on the graphics device from twips to pixels.

Parameters
aTwipsA horizontal dimension on the graphics device in twips.
Return Value
A horizontal dimension on the graphics device in pixels.

InitialDisplayMode ( )

IMPORT_C TDisplayModeInitialDisplayMode()const

Returns the display mode that was used to create the bitmap.

Return Value
The display mode used to create the bitmap.

InternalizeL ( RReadStream & )

IMPORT_C voidInternalizeL(RReadStream &aStream)

Internalises a CFbsBitmap from a stream.

Parameters
aStreamThe read stream.

IsCompressedInRAM ( )

IMPORT_C TBoolIsCompressedInRAM()const

Tests whether the bitmap located in RAM has been compressed.

Return Value
ETrue if the bitmap is compressed, EFalse otherwise.

IsFileInRom ( const TDesC &, TUint32 *& )

IMPORT_C TBoolIsFileInRom(const TDesC &aFilename,
TUint32 *&aWord
)[static]

Tests whether or not the specified file is in ROM.

Parameters
aFilenameThe name of the file.
aWordOn return, contains the address of the file in ROM.
Return Value
ETrue if the file is in the ROM; EFalse otherwise.

IsFileInRom ( RFile &, TUint32 *& )

IMPORT_C TBoolIsFileInRom(RFile &aFile,
TUint32 *&aWord
)[static]

Tests whether or not the specified file is in ROM.

Parameters
aFileThe file handle
aWordOn return, contains the address of the file in ROM.
Return Value
ETrue if the file is in the ROM; EFalse otherwise.

IsLargeBitmap ( )

IMPORT_C TBoolIsLargeBitmap()const

Tests whether the bitmap is large.

Return Value
ETrue if the bitmap is large, EFalse if not.

IsMonochrome ( )

IMPORT_C TBoolIsMonochrome()const

Tests whether or not the bitmap is monochrome. Monochrome bitmaps have a display-mode of 1 bit-per-pixel.

Return Value
ETrue if the bitmap is monochrome; EFalse otherwise.

IsRomBitmap ( )

IMPORT_C TBoolIsRomBitmap()const

Tests whether or not the bitmap is read-only.

Return Value
ETrue if the bitmap is read-only, EFalse otherwise.

IsVolatile ( )

IMPORT_C TBoolIsVolatile()const

Tests whether the bitmap is volatile. A bitmap becomes volatile if CFbsBitmap::DataAdress() is called without CFbsBitmap::BeginDataAccess() having been called before and it can become non-volatile again if a resizing or compression is performed.

Load ( const TDesC &, TInt32, TBool )

IMPORT_C TIntLoad(const TDesC &aFileName,
TInt32aId = 0,
TBoolaShareIfLoaded = ETrue
)

Loads a specific bitmap from a multi-bitmap file. The bitmap may be shared by other font and bitmap server clients.

Parameters
aFileNameThe filename of the multi-bitmap (.mbm) file.
aIdThe bitmap identifier.
aShareIfLoadedSpecifies whether or not the loaded bitmap will be made available for sharing between font and bitmap server clients.
Return Value
KErrNone if successful, otherwise another of the system error codes.

Load ( const TDesC &, TInt32, TBool, TUint )

IMPORT_C TIntLoad(const TDesC &aFileName,
TInt32aId,
TBoolaShareIfLoaded,
TUintaFileOffset
)

Loads a specific bitmap from a multi-bitmap file. The bitmap may be shared by other font and bitmap server clients.

Parameters
aFileNameThe filename of the multi-bitmap (.mbm) file.
aIdThe bitmap identifier.
aShareIfLoadedSpecifies whether or not the loaded bitmap will be made available for sharing between FBSERV clients.
aFileOffsetBitmap file section offset within the file.
Return Value
KErrNone if successful, otherwise another of the system error codes.

Load ( RFile &, TInt32, TBool )

IMPORT_C TIntLoad(RFile &aFile,
TInt32aId = 0,
TBoolaShareIfLoaded = ETrue
)

Loads a specific bitmap from an opened multi-bitmap file handle. The bitmap may be shared by other font and bitmap server clients.

Parameters
aFileThe handle of the multi-bitmap (.mbm) file.
aIdThe bitmap identifier.
aShareIfLoadedSpecifies whether or not the loaded bitmap will be made available for sharing between font and bitmap server clients.
Return Value
KErrNone if successful, otherwise another of the system error codes.

Load ( RFile &, TInt32, TBool, TUint )

IMPORT_C TIntLoad(RFile &aFile,
TInt32aId,
TBoolaShareIfLoaded,
TUintaFileOffset
)

Loads a specific bitmap from an opened multi-bitmap file handle. The bitmap may be shared by other font and bitmap server clients.

Parameters
aFileThe handle of the multi-bitmap (.mbm) file.
aIdThe bitmap identifier.
aShareIfLoadedSpecifies whether or not the loaded bitmap will be made available for sharing between FBSERV clients.
aFileOffsetBitmap file section offset within the file.
Return Value
KErrNone if successful, otherwise another of the system error codes.

LoadAndCompress ( const TDesC &, TInt32, TBool )

IMPORT_C TIntLoadAndCompress(const TDesC &aFileName,
TInt32aId = 0,
TBoolaShareIfLoaded = ETrue
)

Loads and compresses a specific bitmap from a multi-bitmap file. The bitmap may be shared by other font and bitmap server clients. If the bitmap is loaded from ROM then compression is not allowed.

Parameters
aFileNameThe filename of the multi-bitmap (.mbm) file.
aIdThe bitmap identifier.
aShareIfLoadedSpecifies whether or not the loaded bitmap will be made available for sharing between FBSERV clients.
Return Value
KErrNone if successful, otherwise another of the system-wide error codes.

LoadAndCompress ( const TDesC &, TInt32, TBool, TUint )

IMPORT_C TIntLoadAndCompress(const TDesC &aFileName,
TInt32aId,
TBoolaShareIfLoaded,
TUintaFileOffset
)

Loads and compresses a specific bitmap from a multi-bitmap file. The bitmap may be shared by other font and bitmap server clients. If the bitmap is loaded from ROM then compression is not allowed.

Parameters
aFileNameThe filename of the multi-bitmap (.mbm) file.
aIdThe bitmap identifier.
aShareIfLoadedSpecifies whether or not the loaded bitmap will be made available for sharing between FBSERV clients.
aFileOffsetBitmap file section offset within the file.
Return Value
KErrNone if successful, otherwise another of the system-wide error codes.

LoadAndCompress ( RFile &, TInt32, TBool )

IMPORT_C TIntLoadAndCompress(RFile &aFile,
TInt32aId = 0,
TBoolaShareIfLoaded = ETrue
)

Loads and compresses a specific bitmap from an opened multi-bitmap file handle. The bitmap may be shared by other font and bitmap server clients. If the bitmap is loaded from ROM then compression is not allowed.

Parameters
aFileThe handle of the multi-bitmap (.mbm) file.
aIdThe bitmap identifier.
aShareIfLoadedSpecifies whether or not the loaded bitmap will be made available for sharing between FBSERV clients.
Return Value
KErrNone if successful, otherwise another of the system-wide error codes.

LoadAndCompress ( RFile &, TInt32, TBool, TUint )

IMPORT_C TIntLoadAndCompress(RFile &aFile,
TInt32aId,
TBoolaShareIfLoaded,
TUintaFileOffset
)

Loads and compresses a specific bitmap from an opened multi-bitmap file handle. The bitmap may be shared by other font and bitmap server clients. If the bitmap is loaded from ROM then compression is not allowed.

Parameters
aFileThe handle of the multi-bitmap (.mbm) file.
aIdThe bitmap identifier.
aShareIfLoadedSpecifies whether or not the loaded bitmap will be made available for sharing between FBSERV clients.
aFileOffsetBitmap file section offset within the file.
Return Value
KErrNone if successful, otherwise another of the system-wide error codes.

LockHeap ( TBool )

IMPORT_C voidLockHeap(TBoolaAlways = EFalse)const

Locks the global bitmap heap. This function is deprecated, since it is no longer necessary to lock the global bitmap heap to prevent the pixel data from being moved in memory asynchronously, as the value returned by DataAddress() can now only change as a result of bitmap operations explicitly requested by clients of the Font and Bitmap Server. Calls to LockHeap() should be replaced by calls to BeginDataAccess().

Calls to DeprecatedLockHeap() must be coupled with subsequent calls to CFbsBitmap::UnlockHeap(). Code called between a LockHeap() - UnlockHeap() pair must not include any other calls to CFbsBitmap methods, which internally may call CFbsBitmap::LockHeap(). Also, code must not leave between a LockHeap() - UnlockHeap() pair.
Note:

IMPORTANT: CFbsBitmap::LockHeap() cannot be used as a means of synchronization between threads concurrently accessing bitmap data.

See also: CFbsBitmap::UnlockHeap() CFbsBitmap::BeginDataAccess()

LockHeapLC ( TBool )

IMPORT_C voidLockHeapLC(TBoolaAlways = EFalse)const

Locks the global bitmap heap, leaving on the clean-up stack a pointer to a TCleanupItem that unlocks the heap on deletion. Use this function instead of LockHeap() if code may leave between the LockHeap() - UnlockHeap() pair. Calls to LockHeapLC() must be coupled with subsequent calls to CFbsBitmap::UnlockHeap() or CleanupStack::PopAndDestroy(). This function is deprecated. See CFbsBitmap::LockHeap() for more details.

Deprecated

See also: CFbsBitmap::LockHeap()

PaletteAttributes ( TBool &, TInt & )

IMPORT_C voidPaletteAttributes(TBool &aModifiable,
TInt &aNumEntries
)const

Gets the attributes of the bitmap's palette. This is not currently supported.

Parameters
aModifiableOn return, whether or not the palette is modifiable.
aNumEntriesOn return, the number of entries in the palette.

Rasterizer ( )

IMPORT_C CFbsRasterizer *Rasterizer()[static]

Gets a pointer to the rasterizer for extended bitmaps if present.

Return Value
A pointer to the rasterizer owned by this thread's FBServ session. NULL if the rasterizer is not present.

Reset ( )

IMPORT_C voidReset()

Releases the bitmap's handle from the font and bitmap server and decrements its access count. The server-side bitmap is only deleted when the access count for the bitmap decrements to zero.

Resize ( const TSize & )

IMPORT_C TIntResize(const TSize &aSizeInPixels)

Resets the pixel-size of the bitmap. If the new size is bigger than the old, the original bitmap is still situated at (0,0), but pixels outside the range of the old pixel-size are set to zero.

Parameters
aSizeInPixelsThe new size of the bitmap.
Return Value
KErrNone if successful; KErrArgument if the new size is illegal; KErrGeneral if the bitmap has not yet been created; KErrAccessDenied if the bitmap is in ROM or is an extended bitmap; otherwise another of the system-wide error codes.

Save ( const TDesC & )

IMPORT_C TIntSave(const TDesC &aFilename)

Saves the bitmap as a direct file store. The file store overwrites any existing file with the same name.

Parameters
aFilenameThe name of the file.
Return Value
KErrNone if successful, KErrNotSupported if this CFbsBitmap is an extended bitmap, otherwise another of the system-wide error codes.

Save ( RFile & )

IMPORT_C TIntSave(RFile &aFile)

Saves the bitmap as a direct file store using an opened file handle. The file store overwrites any existing file with the same name.

Parameters
aFileThe opened file handle
Return Value
KErrNone if successful, KErrNotSupported if this CFbsBitmap is an extended bitmap, otherwise another of the system-wide error codes.

ScanLineLength ( TInt, TDisplayMode )

IMPORT_C TIntScanLineLength(TIntaLength,
TDisplayModeaDispMode
)[static]

Gets the physical length in bytes of a scanline in memory. This is aligned to a 4 byte (DWORD) boundary for performance reasons.

Parameters
aLengthThe length of a scanline in pixels.
aDispModeThe display mode of the bitmap.
Return Value
Number of bytes in the scanline in memory.

SerialNumber ( )

IMPORT_C TInt64SerialNumber()const

Returns the serial number of the bitmap The serial number is unique to this bitmap. The serial number is a signed 64-bit integer, with only the positive values being assigned. As ROM bitmaps do not have serial numbers, the serial number will use the negative range of values so that ROM bitmap's serial number cannot be the same as a RAM bitmap's. ROM bitmap's address pointers are unique to the ROM bitmap, so the serial number will just be negative value of the address pointer.

Return Value
The unique serial number for the bitmap

SetDisplayMode ( TDisplayMode )

IMPORT_C TIntSetDisplayMode(TDisplayModeaDisplayMode)

Changes the display mode of the bitmap. The requested display mode cannot be greater (in bpp value) than the initial display mode. This method cannot leave, for instance because of an out of memory condition. No additional memory is allocated or leaving methods called. The bitmap's content is preserved when converting it to the requested display mode, but there may be some loss of quality.

See also: CFbsBitmap::InitialDisplayMode()

Parameters
aDisplayModeThe requested display mode.
Return Value
KErrArgument if the requested mode is invalid, or has a greater bpp value than the initial mode. KErrNotSupported if the bitmap is compressed, or is a ROM bitmap, an extended bitmap or a hardware bitmap. KErrGeneral if the bitmap handle is NULL. KErrNone if the method call is successful.

SetPalette ( CPalette * )

IMPORT_C voidSetPalette(CPalette *aPalette)

Sets the bitmap's palette. This is not currently supported.

Parameters
aPaletteNot used.

SetRomBitmapL ( CBitwiseBitmap *, TInt & )

IMPORT_C voidSetRomBitmapL(CBitwiseBitmap *aRomBitmapPointer,
TInt &aBitmapSizeInBytes
)
Sets the bitmap to use a bitmap image stored in ROM.
Parameters
aRomBitmapPointerPointer to a bitmap stored in ROM.
aBitmapSizeInBytesOn return, indicates the size of the bitmap in bytes.
Leave Codes
KErrUnknownaRomBitmapPointer is not in ROM, or has an invalid UID.

SetScanLine ( TDes8 &, TInt )

IMPORT_C voidSetScanLine(TDes8 &aBuf,
TIntaY
)const
Sets the bitmap's horizontal scanline at the specified y co-ordinate to the scanline contained in the buffer.
Parameters
aBufThe new scanline to be written to the bitmap.
aYThe y co-ordinate of the scanline.
Panic Codes
FBSCLI11 in debug builds if this is a compressed bitmap.
FBSCLI28 in debug builds if this is a read-only bitmap.

SetSizeInTwips ( const MGraphicsDeviceMap * )

IMPORT_C voidSetSizeInTwips(const MGraphicsDeviceMap *aMap)

Sets the twip-size of the bitmap by converting the bitmaps pixel-size from pixels to twips, using the conversion functions in the specified graphics device map.

Parameters
aMapThe graphics device map to be used for providing pixel to twip conversion.

SetSizeInTwips ( const TSize & )

IMPORT_C voidSetSizeInTwips(const TSize &aSizeInTwips)

Sets the twip-size of the bitmap directly to the specified size.

Parameters
aSizeInTwipsThe new size of the bitmap, in twips.

SizeInPixels ( )

IMPORT_C TSizeSizeInPixels()const

Gets the pixel-size of the bitmap.

Return Value
The size of the bitmap, in pixels.

SizeInTwips ( )

IMPORT_C TSizeSizeInTwips()const

Gets the twip-size of the bitmap.

Return Value
The size of the bitmap, in twips.

StoreL ( const TDesC &, TInt, const TDesC *, TInt32 )

IMPORT_C voidStoreL(const TDesC &aFilename,
TIntaNumSources,
const TDesC *aSources,
TInt32aSourceIds
)[static]

Constructs a multi-bitmap file.

Parameters
aFilenameThe name of the multi-bitmap file to be created.
aNumSourcesThe number of bitmaps to store in the file.
aSourcesAn array of pointers to bitmaps to be stored.
aSourceIdsAn array of identifiers for the bitmaps to be stored.

StoreL ( RFile &, TInt, const TDesC *, TInt32 )

IMPORT_C voidStoreL(RFile &aFile,
TIntaNumSources,
const TDesC *aSources,
TInt32aSourceIds
)[static]

Constructs a multi-bitmap file using an opened file handle.

Parameters
aFileThe opened file handle of multi-bitmap file
aNumSourcesThe number of bitmaps to store in the file.
aSourcesAn array of pointers to bitmaps to be stored.
aSourceIdsAn array of identifiers for the bitmaps to be stored.

SwapWidthAndHeight ( )

IMPORT_C TIntSwapWidthAndHeight()

Swaps the bitmap's width and height. For example, if the bitmap's size is (40, 20), the new size will be (20, 40). Bitmap content is not preserved.

Return Value
KErrNone if the call was successful, KErrGeneral if the bitmap handle is invalid, KErrAccessDenied if the bitmap is in ROM, KErrNotSupported if the bitmap is a hardware bitmap or an extended bitmap.

TouchCount ( )

IMPORT_C TIntTouchCount()const

Tests how many times the bitmap has been touched. A bitmap is touched whenever CFbsBitmap::EndDataAccess() is called with the parameter aReadOnly set to EFalse and also whenever a resizing is performed.

Return Value
The number of times the bitmap has been touched.

UnlockHeap ( TBool )

IMPORT_C voidUnlockHeap(TBoolaAlways = EFalse)const

Unlocks the global heap. This function is deprecated. See LockHeap() for more details. Calls to UnlockHeap() should be replaced by calls to EndDataAccess(). Calls to UnlockHeap() must correspond to prior calls to LockHeap() or LockHeapLC().

Deprecated

See also: CFbsBitmap::LockHeap() CFbsBitmap::EndDataAccess()

UnlockHeap ( TAny * )

IMPORT_C voidUnlockHeap(TAny *aFbsBitmap)[static]

VerticalPixelsToTwips ( TInt )

IMPORT_C TIntVerticalPixelsToTwips(TIntaPixels)const

Converts a vertical dimension on the graphics device from pixels to twips.

Parameters
aPixelsA vertical dimension on the graphics device in pixels.
Return Value
A vertical dimension on the graphics device in twips.

VerticalTwipsToPixels ( TInt )

IMPORT_C TIntVerticalTwipsToPixels(TIntaTwips)const

Converts a vertical dimension on the graphics device from twips to pixels.

Parameters
aTwipsA vertical dimension on the graphics device in twips.
Return Value
A vertical dimension on the graphics device in pixels.