CFbsBitmap Class Reference

class CFbsBitmap : public CBase

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() . CFbsBitmap::Duplicate()

Inherits from

Public Member Functions
CFbsBitmap ()
~CFbsBitmap ()
IMPORT_C void BeginDataAccess ()
IMPORT_C TInt Compress ()
IMPORT_C TInt Compress ( TBitmapfileCompressionScheme )
IMPORT_C void CompressInBackground ( TRequestStatus &)
IMPORT_C TInt CompressInBackground ()
IMPORT_C void CompressInBackground ( TRequestStatus &, TBitmapfileCompressionScheme )
IMPORT_C TInt CompressInBackground ( TBitmapfileCompressionScheme )
IMPORT_C TInt Create (const TSize &, TDisplayMode )
IMPORT_C TInt CreateExtendedBitmap (const TSize &, TDisplayMode , TUid , const TAny *, TInt )
IMPORT_C TInt CreateExtendedBitmap (const TSize &, TDisplayMode , TUid , TInt , MFbsExtendedBitmapInitializer &)
IMPORT_C TInt CreateHardwareBitmap (const TSize &, TDisplayMode , TUid )
IMPORT_C TUint32 * DataAddress ()
IMPORT_C TInt DataSize ()
IMPORT_C TInt DataStride ()
IMPORT_C TDisplayMode DisplayMode ()
IMPORT_C TInt Duplicate ( TInt )
IMPORT_C void EndDataAccess ( TBool )
IMPORT_C TUid ExtendedBitmapType ()
IMPORT_C void ExternalizeL ( RWriteStream &)
IMPORT_C void ExternalizeRectangleL ( RWriteStream &, const TRect &)
IMPORT_C TInt GetAllBitmapHandles ( RArray < TInt > &)
IMPORT_C HBufC8 * GetDecompressionBuffer ( TInt )
IMPORT_C HBufC8 * GetExtraBuffer ( TInt )
IMPORT_C TInt GetPalette ( CPalette *&)
IMPORT_C void GetPixel ( TRgb &, const TPoint &)
IMPORT_C void GetScanLine ( TDes8 &, const TPoint &, TInt , TDisplayMode )
IMPORT_C void GetVerticalScanLine ( TDes8 &, TInt , TDisplayMode )
IMPORT_C void GetVerticalScanLine ( TDes8 &, TInt , const TPoint &, TDisplayMode )
IMPORT_C TInt Handle ()
IMPORT_C TInt HardwareBitmapHandle ()
IMPORT_C SEpocBitmapHeader Header ()
IMPORT_C TInt HorizontalPixelsToTwips ( TInt )
IMPORT_C TInt HorizontalTwipsToPixels ( TInt )
IMPORT_C TDisplayMode InitialDisplayMode ()
IMPORT_C void InternalizeL ( RReadStream &)
IMPORT_C TBool IsCompressedInRAM ()
IMPORT_C TBool IsFileInRom (const TDesC &, TUint32 *&)
IMPORT_C TBool IsFileInRom ( RFile &, TUint32 *&)
IMPORT_C TBool IsLargeBitmap ()
IMPORT_C TBool IsMonochrome ()
IMPORT_C TBool IsRomBitmap ()
IMPORT_C TBool IsVolatile ()
IMPORT_C TInt Load (const TDesC &, TInt32 , TBool )
IMPORT_C TInt Load (const TDesC &, TInt32 , TBool , TUint )
IMPORT_C TInt Load ( RFile &, TInt32 , TBool )
IMPORT_C TInt Load ( RFile &, TInt32 , TBool , TUint )
IMPORT_C TInt LoadAndCompress (const TDesC &, TInt32 , TBool )
IMPORT_C TInt LoadAndCompress (const TDesC &, TInt32 , TBool , TUint )
IMPORT_C TInt LoadAndCompress ( RFile &, TInt32 , TBool )
IMPORT_C TInt LoadAndCompress ( RFile &, TInt32 , TBool , TUint )
IMPORT_C void LockHeap ( TBool )
IMPORT_C void LockHeapLC ( TBool )
IMPORT_C void PaletteAttributes ( TBool &, TInt &)
IMPORT_C CFbsRasterizer * Rasterizer ()
IMPORT_C void Reset ()
IMPORT_C TInt Resize (const TSize &)
IMPORT_C TInt Save (const TDesC &)
IMPORT_C TInt Save ( RFile &)
IMPORT_C TInt ScanLineLength ( TInt , TDisplayMode )
IMPORT_C TInt64 SerialNumber ()
IMPORT_C TInt SetDisplayMode ( TDisplayMode )
IMPORT_C void SetPalette ( CPalette *)
IMPORT_C void SetRomBitmapL ( CBitwiseBitmap *, TInt &)
IMPORT_C void SetScanLine ( TDes8 &, TInt )
IMPORT_C void SetSizeInTwips (const MGraphicsDeviceMap *)
IMPORT_C void SetSizeInTwips (const TSize &)
IMPORT_C TSize SizeInPixels ()
IMPORT_C TSize SizeInTwips ()
IMPORT_C void StoreL (const TDesC &, TInt , const TDesC *, TInt32 )
IMPORT_C void StoreL ( RFile &, TInt , const TDesC *, TInt32 )
IMPORT_C TInt SwapWidthAndHeight ()
IMPORT_C TInt TouchCount ()
IMPORT_C void UnlockHeap ( TBool )
IMPORT_C void UnlockHeap ( TAny *)
IMPORT_C TInt VerticalPixelsToTwips ( TInt )
IMPORT_C TInt VerticalTwipsToPixels ( TInt )
Protected Member Functions
CBitwiseBitmap * Address ()
CBitwiseBitmap * BeginDataAccessAndGetCleanAddress ( TUint32 *&)
IMPORT_C CBitwiseBitmap * CleanAddress ()
TInt DoCreate (const TSize &, TDisplayMode , TUid , TInt )
void DoSaveL ( RFile &)
IMPORT_C void GetScanLine ( TDes8 &, const TPoint &, TInt , const TPoint &, TDisplayMode )
Private Member Functions
TInt DoLoad ( RFile &, TInt32 , TBool , TUint )
TInt DoLoad (const TDesC &, TInt32 , TBool , TUint )
TInt DoLoadFromRom ( TUint32 *, TInt32 , TUint , TBool &)
void DoStoreL ( CDirectFileStore *, CFbsBitmap *, TInt , const TDesC *, TInt32 )
TBool LoadShiftedRomBmpL (const TDesC &, TInt32 , TUint )
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()
Protected Member Enumerations
enum anonymous { EIsRomBitmap  = 0x0001, EIsExtendedBitmap  = 0x0002, EIsReadOnlyBitmapMask  = EIsRomBitmap | EIsExtendedBitmap }
Protected Attributes
CBitwiseBitmap * iAddressPointer
RFbsSession * iFbs
TUint16 iFlags
TInt iHandle
TInt iServerHandle
TInt16 iUseCount

Constructor & Destructor Documentation

CFbsBitmap()

IMPORT_C CFbsBitmap ( )

~CFbsBitmap()

IMPORT_C ~CFbsBitmap ( )

Destructor. Calls Reset() . Reset()

Member Functions Documentation

Address()

CBitwiseBitmap * Address ( ) const [protected]

BeginDataAccess()

IMPORT_C void BeginDataAccess ( ) 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() .

CFbsBitmap::DataAddress() CFbsBitmap::EndDataAccess()

BeginDataAccessAndGetCleanAddress(TUint32 *&)

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

Parameters

TUint32 *& aDataAddress

CleanAddress()

IMPORT_C CBitwiseBitmap * CleanAddress ( ) const [protected]

Compress()

IMPORT_C TInt Compress ( )

Compress(TBitmapfileCompressionScheme)

IMPORT_C TInt Compress ( TBitmapfileCompressionScheme aScheme )

Compresses bitmap in RAM.

Parameters

TBitmapfileCompressionScheme aScheme specifies preferred compression type ERLECompression or EPaletteCompression

CompressInBackground(TRequestStatus &)

IMPORT_C void CompressInBackground ( TRequestStatus & aRequestStatus )

Submits the bitmap for asynchronous background compression.

Parameters

TRequestStatus & aRequestStatus The 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 TInt CompressInBackground ( )

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

CompressInBackground(TRequestStatus &, TBitmapfileCompressionScheme)

IMPORT_C void CompressInBackground ( TRequestStatus & aRequestStatus,
TBitmapfileCompressionScheme aScheme
)

Submits the bitmap for asynchronous background compression.

Parameters

TRequestStatus & aRequestStatus The 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.
TBitmapfileCompressionScheme aScheme Specifies preferred compression type: ERLECompression or EPaletteCompression

CompressInBackground(TBitmapfileCompressionScheme)

IMPORT_C TInt CompressInBackground ( TBitmapfileCompressionScheme aScheme )

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

Create(const TSize &, TDisplayMode)

IMPORT_C TInt Create ( const TSize & aSizeInPixels,
TDisplayMode aDispMode
)

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

Parameters

const TSize & aSizeInPixels The size of the bitmap to be created.
TDisplayMode aDispMode The display mode of the bitmap to be created.

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

IMPORT_C TInt CreateExtendedBitmap ( const TSize & aSizeInPixels,
TDisplayMode aDispMode,
TUid aType,
const TAny * aData,
TInt aDataSize
)

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.

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

Parameters

const TSize & aSizeInPixels The conceptual width and height of the new bitmap in pixels.
TDisplayMode aDispMode The conceptual display mode of the new bitmap.
TUid aType The UID identifying the data format of the new bitmap. Used by the extended bitmap rasterizer to distinguish between different data types.
const TAny * aData A pointer to the raw data to be stored in the new bitmap.
TInt aDataSize The size in bytes of the raw data to be stored in the new bitmap.

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

IMPORT_C TInt CreateExtendedBitmap ( const TSize & aSizeInPixels,
TDisplayMode aDispMode,
TUid aType,
TInt aDataSize,
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.

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

Parameters

const TSize & aSizeInPixels The conceptual width and height of the new bitmap in pixels.
TDisplayMode aDispMode The conceptual display mode of the new bitmap.
TUid aType The UID identifying the data format of the new bitmap. Used by the extended bitmap rasterizer to distinguish between different data types.
TInt aDataSize The size in bytes of the raw data to be stored in the new bitmap.
MFbsExtendedBitmapInitializer & aInitializer A reference to the initializer of the raw data to be stored in the new bitmap.

CreateHardwareBitmap(const TSize &, TDisplayMode, TUid)

IMPORT_C TInt CreateHardwareBitmap ( const TSize & aSizeInPixels,
TDisplayMode aDispMode,
TUid aCreatorUid
)

Creates a hardware bitmap with a size and display mode.

Parameters

const TSize & aSizeInPixels The bitmap's width and height in pixels.
TDisplayMode aDispMode The bitmap's display mode.
TUid aCreatorUid The 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.

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. CFbsBitmap::BeginDataAccess() CFbsBitmap::EndDataAccess()

DataSize()

IMPORT_C TInt DataSize ( ) const

Gets the size in bytes of the bitmap data.

DataStride()

IMPORT_C TInt DataStride ( ) const

Gets the length in bytes between scanlines in memory.

DisplayMode()

IMPORT_C TDisplayMode DisplayMode ( ) const

Gets the display mode of the bitmap.

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

TInt DoCreate ( const TSize & aSizeInPixels,
TDisplayMode aDispMode,
TUid aUid,
TInt aDataSize = 0
) [protected]

Parameters

const TSize & aSizeInPixels
TDisplayMode aDispMode
TUid aUid
TInt aDataSize = 0

DoLoad(RFile &, TInt32, TBool, TUint)

TInt DoLoad ( RFile & aFile,
TInt32 aId,
TBool aShareIfLoaded,
TUint aFileOffset
) [private]

This method loads a bitmap from an opened file handle.

Parameters

RFile & aFile mbm or rsc file handle (rsc file format: header + rsc data section + mbm file section).
TInt32 aId Bitmap ID - should be less than mbm file bitmaps count.
TBool aShareIfLoaded Specifies whether or not the loaded bitmap will be made available for sharing between FBSERV clients.
TUint aFileOffset mbm file section offset into rsc file.

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

TInt DoLoad ( const TDesC & aFileName,
TInt32 aId,
TBool aShareIfLoaded,
TUint aFileOffset
) [private]

This method loads a bitmap from the mbm or rsc file specified by the filename.

Parameters

const TDesC & aFileName mbm or rsc file name (rsc file format: header + rsc data section + mbm file section).
TInt32 aId Bitmap ID - should be less than mbm file bitmaps count.
TBool aShareIfLoaded Specifies whether or not the loaded bitmap will be made available for sharing between FBSERV clients.
TUint aFileOffset mbm file section offset into rsc file.

DoLoadFromRom(TUint32 *, TInt32, TUint, TBool &)

TInt DoLoadFromRom ( TUint32 * aRomPointer,
TInt32 aId,
TUint aFileOffset,
TBool & aRomPointerValid
) [private]

This method tries to load a bitmap if mbm or rsc file is in ROM.

Parameters

TUint32 * aRomPointer the address of the file in ROM
TInt32 aId a Bitmap ID which should be less than mbm file bitmaps count.
TUint aFileOffset mbm file section offset into rsc file.
TBool & aRomPointerValid on output it is set to ETrue if aRomPointer points to a valid ROM file or EFalse otherwise.

DoSaveL(RFile &)

void DoSaveL ( RFile & aFile ) [protected]

Parameters

RFile & aFile

DoStoreL(CDirectFileStore *, CFbsBitmap *, TInt, const TDesC *, TInt32)

void DoStoreL ( CDirectFileStore * aFileStore,
CFbsBitmap * aBitmap,
TInt aNumSources,
const TDesC * aSources,
TInt32 aSourceIds
) [private, static]

Parameters

CDirectFileStore * aFileStore
CFbsBitmap * aBitmap
TInt aNumSources
const TDesC * aSources
TInt32 aSourceIds

Duplicate(TInt)

IMPORT_C TInt Duplicate ( TInt aHandle )

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. CFbsBitmap::Handle()

Parameters

TInt aHandle The handle to an existing bitmap.

EndDataAccess(TBool)

IMPORT_C void EndDataAccess ( TBool aReadOnly = 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.

CFbsBitmap::BeginDataAccess()

Parameters

TBool aReadOnly = EFalse True if the bitmap data had only been read. False if the data has been modified.

ExtendedBitmapType()

IMPORT_C TUid ExtendedBitmapType ( ) const

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

ExternalizeL(RWriteStream &)

IMPORT_C void ExternalizeL ( RWriteStream & aStream ) const

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

Parameters

RWriteStream & aStream The write stream.

ExternalizeRectangleL(RWriteStream &, const TRect &)

IMPORT_C void ExternalizeRectangleL ( RWriteStream & aStream,
const TRect & aRect
) const

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

Parameters

RWriteStream & aStream The write stream
const TRect & aRect The rectangular area of the bitmap to externalise. The bitmap that is externalized will be of this size.

GetAllBitmapHandles(RArray< TInt > &)

IMPORT_C TInt GetAllBitmapHandles ( 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.
capability
ReadDeviceData

Parameters

RArray < TInt > & aBitmapIdArray returns an array of all the bitmap handles

GetDecompressionBuffer(TInt)

IMPORT_C HBufC8 * GetDecompressionBuffer ( TInt aSize ) [static]

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

Parameters

TInt aSize The size in bytes of the scan lines to decompress.

GetExtraBuffer(TInt)

IMPORT_C HBufC8 * GetExtraBuffer ( TInt aSize ) [static]

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

Parameters

TInt aSize The size of the buffer in bytes

GetPalette(CPalette *&)

IMPORT_C TInt GetPalette ( CPalette *& aPalette ) const

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

Parameters

CPalette *& aPalette Not used.

GetPixel(TRgb &, const TPoint &)

IMPORT_C void GetPixel ( 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.
panic
FBSCLI 11 in debug builds if this is a compressed bitmap.

Parameters

TRgb & aColor On return, the RGB value of the specified pixel.
const TPoint & aPixel The pixel whose colour is to be determined.

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

IMPORT_C void GetScanLine ( TDes8 & aBuf,
const TPoint & aPixel,
TInt aLength,
TDisplayMode aDispMode
) 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

TDes8 & aBuf The buffer in which the scanline is returned.
const TPoint & aPixel The start pixel.
TInt aLength The number of pixels to get.
TDisplayMode aDispMode Format to be used to write the data to the buffer.

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

IMPORT_C void GetScanLine ( TDes8 & aBuf,
const TPoint & aPixel,
TInt aLength,
const TPoint & aDitherOffset,
TDisplayMode aDispMode
) const [protected]

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

Parameters

TDes8 & aBuf The buffer in which the scanline is returned.
const TPoint & aPixel The start pixel.
TInt aLength The number of pixels to get.
const TPoint & aDitherOffset The dither offset of the bitmap.
TDisplayMode aDispMode Format to be used to write the data to the buffer.

GetVerticalScanLine(TDes8 &, TInt, TDisplayMode)

IMPORT_C void GetVerticalScanLine ( TDes8 & aBuf,
TInt aX,
TDisplayMode aDispMode
) 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).
panic
FBSCLI 11 in debug builds if this is not an ucompressed bitmap or an extended bitmap.

Parameters

TDes8 & aBuf The buffer in which the vertical scanline is returned.
TInt aX The x co-ordinate of the vertical scanline.
TDisplayMode aDispMode Format to be used to write the data to the buffer.

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

IMPORT_C void GetVerticalScanLine ( TDes8 & aBuf,
TInt aX,
const TPoint & aDitherOffset,
TDisplayMode aDispMode
) 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.
panic
FBSCLI 11 in debug builds if this is not an ucompressed bitmap or an extended bitmap.

Parameters

TDes8 & aBuf The buffer in which the vertical scanline will be returned.
TInt aX The x co-ordinate of the vertical scanline to get.
const TPoint & aDitherOffset The dither offset of the bitmap.
TDisplayMode aDispMode Format to be used to write the data to the buffer.

Handle()

IMPORT_C TInt Handle ( ) const

Gets the handle number of the bitmap. The returned value can be used to give another thread access to the bitmap. CFbsBitmap::Duplicate()

HardwareBitmapHandle()

IMPORT_C TInt HardwareBitmapHandle ( ) const

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

Header()

IMPORT_C SEpocBitmapHeader Header ( ) const

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

HorizontalPixelsToTwips(TInt)

IMPORT_C TInt HorizontalPixelsToTwips ( TInt aPixels ) const

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

Parameters

TInt aPixels A horizontal dimension on the graphics device in pixels.

HorizontalTwipsToPixels(TInt)

IMPORT_C TInt HorizontalTwipsToPixels ( TInt aTwips ) const

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

Parameters

TInt aTwips A horizontal dimension on the graphics device in twips.

InitialDisplayMode()

IMPORT_C TDisplayMode InitialDisplayMode ( ) const

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

InternalizeL(RReadStream &)

IMPORT_C void InternalizeL ( RReadStream & aStream )

Internalises a CFbsBitmap from a stream.

Parameters

RReadStream & aStream The read stream.

IsCompressedInRAM()

IMPORT_C TBool IsCompressedInRAM ( ) const

Tests whether the bitmap located in RAM has been compressed.

IsFileInRom(const TDesC &, TUint32 *&)

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

Tests whether or not the specified file is in ROM.

Parameters

const TDesC & aFilename The name of the file.
TUint32 *& aWord On return, contains the address of the file in ROM.

IsFileInRom(RFile &, TUint32 *&)

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

Tests whether or not the specified file is in ROM.

Parameters

RFile & aFile The file handle
TUint32 *& aWord On return, contains the address of the file in ROM.

IsLargeBitmap()

IMPORT_C TBool IsLargeBitmap ( ) const

Tests whether the bitmap is large.

IsMonochrome()

IMPORT_C TBool IsMonochrome ( ) const

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

IsRomBitmap()

IMPORT_C TBool IsRomBitmap ( ) const

Tests whether or not the bitmap is read-only.

IsVolatile()

IMPORT_C TBool IsVolatile ( ) 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 TInt Load ( const TDesC & aFileName,
TInt32 aId = 0,
TBool aShareIfLoaded = ETrue
)

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

Parameters

const TDesC & aFileName The filename of the multi-bitmap (.mbm) file.
TInt32 aId = 0 The bitmap identifier.
TBool aShareIfLoaded = ETrue Specifies whether or not the loaded bitmap will be made available for sharing between font and bitmap server clients.

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

IMPORT_C TInt Load ( const TDesC & aFileName,
TInt32 aId,
TBool aShareIfLoaded,
TUint aFileOffset
)

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

Parameters

const TDesC & aFileName The filename of the multi-bitmap (.mbm) file.
TInt32 aId The bitmap identifier.
TBool aShareIfLoaded Specifies whether or not the loaded bitmap will be made available for sharing between FBSERV clients.
TUint aFileOffset Bitmap file section offset within the file.

Load(RFile &, TInt32, TBool)

IMPORT_C TInt Load ( RFile & aFile,
TInt32 aId = 0,
TBool aShareIfLoaded = 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

RFile & aFile The handle of the multi-bitmap (.mbm) file.
TInt32 aId = 0 The bitmap identifier.
TBool aShareIfLoaded = ETrue Specifies whether or not the loaded bitmap will be made available for sharing between font and bitmap server clients.

Load(RFile &, TInt32, TBool, TUint)

IMPORT_C TInt Load ( RFile & aFile,
TInt32 aId,
TBool aShareIfLoaded,
TUint aFileOffset
)

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

Parameters

RFile & aFile The handle of the multi-bitmap (.mbm) file.
TInt32 aId The bitmap identifier.
TBool aShareIfLoaded Specifies whether or not the loaded bitmap will be made available for sharing between FBSERV clients.
TUint aFileOffset Bitmap file section offset within the file.

LoadAndCompress(const TDesC &, TInt32, TBool)

IMPORT_C TInt LoadAndCompress ( const TDesC & aFileName,
TInt32 aId = 0,
TBool aShareIfLoaded = 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

const TDesC & aFileName The filename of the multi-bitmap (.mbm) file.
TInt32 aId = 0 The bitmap identifier.
TBool aShareIfLoaded = ETrue Specifies whether or not the loaded bitmap will be made available for sharing between FBSERV clients.

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

IMPORT_C TInt LoadAndCompress ( const TDesC & aFileName,
TInt32 aId,
TBool aShareIfLoaded,
TUint aFileOffset
)

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

const TDesC & aFileName The filename of the multi-bitmap (.mbm) file.
TInt32 aId The bitmap identifier.
TBool aShareIfLoaded Specifies whether or not the loaded bitmap will be made available for sharing between FBSERV clients.
TUint aFileOffset Bitmap file section offset within the file.

LoadAndCompress(RFile &, TInt32, TBool)

IMPORT_C TInt LoadAndCompress ( RFile & aFile,
TInt32 aId = 0,
TBool aShareIfLoaded = 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

RFile & aFile The handle of the multi-bitmap (.mbm) file.
TInt32 aId = 0 The bitmap identifier.
TBool aShareIfLoaded = ETrue Specifies whether or not the loaded bitmap will be made available for sharing between FBSERV clients.

LoadAndCompress(RFile &, TInt32, TBool, TUint)

IMPORT_C TInt LoadAndCompress ( RFile & aFile,
TInt32 aId,
TBool aShareIfLoaded,
TUint aFileOffset
)

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

RFile & aFile The handle of the multi-bitmap (.mbm) file.
TInt32 aId The bitmap identifier.
TBool aShareIfLoaded Specifies whether or not the loaded bitmap will be made available for sharing between FBSERV clients.
TUint aFileOffset Bitmap file section offset within the file.

LoadShiftedRomBmpL(const TDesC &, TInt32, TUint)

TBool LoadShiftedRomBmpL ( const TDesC & aFileName,
TInt32 aId,
TUint aFileOffset
) [private]

This method handles very special case when the rsc file is in RAM, but it contains ROM mbm file. ROM mbm file format is different than RAM mbm file format and ROM mbm file cannot be loaded into RAM using standard techniques (used by CFbsBitmap::DoLoad() ). We have to check it is really a ROM mbm file. If it is - we have to allocate the right amount of RAM, read and copy requested ROM bitmap to the allocated RAM.

leave
KErrNotSupported if this is a RAM rsc file with ROM mbm file section, or any of the RFile related error codes.

Parameters

const TDesC & aFileName rsc file name (rsc file format: header + rsc data section + mbm file section).
TInt32 aId Bitmap ID - should be less than mbm file bitmaps count.
TUint aFileOffset mbm file section offset into rsc file.

LockHeap(TBool)

IMPORT_C void LockHeap ( TBool aAlways = 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 LockHeap() 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.

CFbsBitmap::UnlockHeap() CFbsBitmap::BeginDataAccess()

Parameters

TBool aAlways = EFalse

LockHeapLC(TBool)

IMPORT_C void LockHeapLC ( TBool aAlways = 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.

CFbsBitmap::LockHeap()

Parameters

TBool aAlways = EFalse

PaletteAttributes(TBool &, TInt &)

IMPORT_C void PaletteAttributes ( TBool & aModifiable,
TInt & aNumEntries
) const

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

Parameters

TBool & aModifiable On return, whether or not the palette is modifiable.
TInt & aNumEntries On 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.

Reset()

IMPORT_C void Reset ( )

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 TInt Resize ( 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

const TSize & aSizeInPixels The new size of the bitmap.

Save(const TDesC &)

IMPORT_C TInt Save ( const TDesC & aFilename )

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

Parameters

const TDesC & aFilename The name of the file.

Save(RFile &)

IMPORT_C TInt Save ( 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

RFile & aFile The opened file handle

ScanLineLength(TInt, TDisplayMode)

IMPORT_C TInt ScanLineLength ( TInt aLength,
TDisplayMode aDispMode
) [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

TInt aLength The length of a scanline in pixels.
TDisplayMode aDispMode The display mode of the bitmap.

SerialNumber()

IMPORT_C TInt64 SerialNumber ( ) 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.

SetDisplayMode(TDisplayMode)

IMPORT_C TInt SetDisplayMode ( TDisplayMode aDisplayMode )

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. CFbsBitmap::InitialDisplayMode()

Parameters

TDisplayMode aDisplayMode The requested display mode.

SetPalette(CPalette *)

IMPORT_C void SetPalette ( CPalette * aPalette )

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

Parameters

CPalette * aPalette Not used.

SetRomBitmapL(CBitwiseBitmap *, TInt &)

IMPORT_C void SetRomBitmapL ( CBitwiseBitmap * aRomBitmapPointer,
TInt & aBitmapSizeInBytes
)
Sets the bitmap to use a bitmap image stored in ROM.
leave
KErrUnknown aRomBitmapPointer is not in ROM, or has an invalid UID.

Parameters

CBitwiseBitmap * aRomBitmapPointer Pointer to a bitmap stored in ROM.
TInt & aBitmapSizeInBytes On return, indicates the size of the bitmap in bytes.

SetScanLine(TDes8 &, TInt)

IMPORT_C void SetScanLine ( TDes8 & aBuf,
TInt aY
) const
Sets the bitmap's horizontal scanline at the specified y co-ordinate to the scanline contained in the buffer.
panic
FBSCLI 11 in debug builds if this is a compressed bitmap.
panic
FBSCLI 28 in debug builds if this is a read-only bitmap.

Parameters

TDes8 & aBuf The new scanline to be written to the bitmap.
TInt aY The y co-ordinate of the scanline.

SetSizeInTwips(const MGraphicsDeviceMap *)

IMPORT_C void SetSizeInTwips ( 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

const MGraphicsDeviceMap * aMap The graphics device map to be used for providing pixel to twip conversion.

SetSizeInTwips(const TSize &)

IMPORT_C void SetSizeInTwips ( const TSize & aSizeInTwips )

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

Parameters

const TSize & aSizeInTwips The new size of the bitmap, in twips.

SizeInPixels()

IMPORT_C TSize SizeInPixels ( ) const

Gets the pixel-size of the bitmap.

SizeInTwips()

IMPORT_C TSize SizeInTwips ( ) const

Gets the twip-size of the bitmap.

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

IMPORT_C void StoreL ( const TDesC & aFilename,
TInt aNumSources,
const TDesC * aSources,
TInt32 aSourceIds
) [static]

Constructs a multi-bitmap file.

Parameters

const TDesC & aFilename The name of the multi-bitmap file to be created.
TInt aNumSources The number of bitmaps to store in the file.
const TDesC * aSources An array of pointers to bitmaps to be stored.
TInt32 aSourceIds An array of identifiers for the bitmaps to be stored.

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

IMPORT_C void StoreL ( RFile & aFile,
TInt aNumSources,
const TDesC * aSources,
TInt32 aSourceIds
) [static]

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

Parameters

RFile & aFile The opened file handle of multi-bitmap file
TInt aNumSources The number of bitmaps to store in the file.
const TDesC * aSources An array of pointers to bitmaps to be stored.
TInt32 aSourceIds An array of identifiers for the bitmaps to be stored.

SwapWidthAndHeight()

IMPORT_C TInt SwapWidthAndHeight ( )

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.

TouchCount()

IMPORT_C TInt TouchCount ( ) 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 or compression is performed.

UnlockHeap(TBool)

IMPORT_C void UnlockHeap ( TBool aAlways = 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() .

CFbsBitmap::LockHeap() CFbsBitmap::EndDataAccess()

Parameters

TBool aAlways = EFalse

UnlockHeap(TAny *)

IMPORT_C void UnlockHeap ( TAny * aFbsBitmap ) [static]

Parameters

TAny * aFbsBitmap

VerticalPixelsToTwips(TInt)

IMPORT_C TInt VerticalPixelsToTwips ( TInt aPixels ) const

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

Parameters

TInt aPixels A vertical dimension on the graphics device in pixels.

VerticalTwipsToPixels(TInt)

IMPORT_C TInt VerticalTwipsToPixels ( TInt aTwips ) const

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

Parameters

TInt aTwips A vertical dimension on the graphics device in twips.

Member Enumerations Documentation

Enum anonymous

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

Enumerators

EIsRomBitmap = 0x0001
EIsExtendedBitmap = 0x0002
EIsReadOnlyBitmapMask = EIsRomBitmap | EIsExtendedBitmap

Member Data Documentation

CBitwiseBitmap * 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.

RFbsSession * 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.

TUint16 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.

TInt 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.

TInt 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.

TInt16 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.