fbs/fontandbitmapserver/sfbs/BMPUTIL.CPP
changeset 36 01a6848ebfd7
parent 0 5d03bc08d59c
equal deleted inserted replaced
0:5d03bc08d59c 36:01a6848ebfd7
    32 #define iSTART_OF_SCAN_LINE iWordPos
    32 #define iSTART_OF_SCAN_LINE iWordPos
    33 #define iPIXEL_BYTE_OFFSET  iPixelShift
    33 #define iPIXEL_BYTE_OFFSET  iPixelShift
    34 #define iPIXEL_ADDRESS      UINT2PTR(PTR2UINT(iWordPos)+iPixelShift)
    34 #define iPIXEL_ADDRESS      UINT2PTR(PTR2UINT(iWordPos)+iPixelShift)
    35 
    35 
    36 
    36 
    37 /** Constructs a TBitmapUtil object for the specified bitmap.
    37 /** Constructs a TBitmapUtil object for the specified bitmap. 
       
    38 
       
    39 @note The use of extended or compressed bitmaps is not supported by TBitmapUtil.
    38 
    40 
    39 @param aBitmap The bitmap on which this TBitmapUtil will operate. */
    41 @param aBitmap The bitmap on which this TBitmapUtil will operate. */
    40 EXPORT_C TBitmapUtil::TBitmapUtil(CFbsBitmap* aBitmap):
    42 EXPORT_C TBitmapUtil::TBitmapUtil(CFbsBitmap* aBitmap):
    41     iFbsBitmap(aBitmap),	// Address of bitmap to navigate and modify.
    43     iFbsBitmap(aBitmap),	// Address of bitmap to navigate and modify.
    42 	iWordPos(NULL),			// Non16M: Address of the word containing the bits
    44 	iWordPos(NULL),			// Non16M: Address of the word containing the bits
    59 							// 16M: Redefined to iNUM_WASTE_BYTES - number of
    61 							// 16M: Redefined to iNUM_WASTE_BYTES - number of
    60 							//      padding bytes at end of scan line 0,3,6,9 as 16M
    62 							//      padding bytes at end of scan line 0,3,6,9 as 16M
    61 							//      scanlines are always multiples of 12 bytes.
    63 							//      scanlines are always multiples of 12 bytes.
    62 	iScanlineWordLength(0), // Number of 4-byte words in bitmap scan line
    64 	iScanlineWordLength(0), // Number of 4-byte words in bitmap scan line
    63 	iWritten(EFalse)
    65 	iWritten(EFalse)
    64 	{}
    66 	{
       
    67 	ASSERT(iFbsBitmap);
       
    68 	__ASSERT_DEBUG(iFbsBitmap->Header().iCompression == ENoBitmapCompression, Panic(EFbsPanicInvalidBitmapType));
       
    69 	}
    65 
    70 
    66 /** Sets the current pixel position to the specified position and prepares
    71 /** Sets the current pixel position to the specified position and prepares
    67 the bitmap for access to its pixel data.
    72 the bitmap for access to its pixel data.
    68 
    73 
    69 This function must be called before using any of the other functions provided
    74 This function must be called before using any of the other functions provided
    74 	a valid handle.
    79 	a valid handle.
    75 @param aPosition The position to which the current pixel position should be
    80 @param aPosition The position to which the current pixel position should be
    76 set. */
    81 set. */
    77 EXPORT_C void TBitmapUtil::Begin(const TPoint& aPosition)
    82 EXPORT_C void TBitmapUtil::Begin(const TPoint& aPosition)
    78 	{
    83 	{
    79 	ASSERT(iFbsBitmap);
       
    80 	iFbsBitmap->BeginDataAccess();
    84 	iFbsBitmap->BeginDataAccess();
    81 	TSize bmpsize(iFbsBitmap->SizeInPixels());
    85 	TSize bmpsize(iFbsBitmap->SizeInPixels());
    82 	ASSERT(bmpsize.iWidth > 0 && bmpsize.iHeight > 0);
    86 	ASSERT(bmpsize.iWidth > 0 && bmpsize.iHeight > 0);
    83 
    87 
    84 	iWritten = EFalse;
    88 	iWritten = EFalse;