64 EThirtyTwoUBitRLECompression, |
59 EThirtyTwoUBitRLECompression, |
65 /** File is compressed using thirty two bit run-length encoding compression from 32-bit bitmap buffer. */ |
60 /** File is compressed using thirty two bit run-length encoding compression from 32-bit bitmap buffer. */ |
66 EThirtyTwoABitRLECompression, |
61 EThirtyTwoABitRLECompression, |
67 /** File is compressed as a palette plus reduced bit-per-pixel. Only applicable to bitmaps already loaded in RAM. */ |
62 /** File is compressed as a palette plus reduced bit-per-pixel. Only applicable to bitmaps already loaded in RAM. */ |
68 EGenericPaletteCompression, |
63 EGenericPaletteCompression, |
|
64 /** Extended bitmap. Data format is proprietary to licensee. */ |
|
65 EProprietaryCompression, |
69 //Insert new enum items here! |
66 //Insert new enum items here! |
70 ERLECompressionLast = 255 |
67 ERLECompressionLast = 255 |
71 }; |
68 }; |
72 |
69 |
73 /** |
70 /** |
157 TInt iPaletteEntries; |
146 TInt iPaletteEntries; |
158 /** The type of compression used to store the bitmap. */ |
147 /** The type of compression used to store the bitmap. */ |
159 TBitmapfileCompression iCompression; |
148 TBitmapfileCompression iCompression; |
160 }; |
149 }; |
161 |
150 |
|
151 /** |
|
152 WARNING: Class for internal use ONLY. Compatibility is not guaranteed in future releases. |
|
153 |
|
154 @publishedAll |
|
155 @released |
|
156 */ |
162 class TLineScanningPosition |
157 class TLineScanningPosition |
163 /** |
158 { |
164 @internalTechnology |
159 public: |
165 */ |
160 inline TLineScanningPosition(TUint32* aSrcDataPtr); |
166 { |
|
167 public: |
|
168 TLineScanningPosition(TUint32* aSrcDataPtr): iSrcDataPtr((TUint8*)aSrcDataPtr), iCursorPos(0), iScanLineBuffer(NULL) {} |
|
169 public: |
161 public: |
170 TUint8* iSrcDataPtr; |
162 TUint8* iSrcDataPtr; |
171 TInt iCursorPos; |
163 TInt iCursorPos; |
172 HBufC8* iScanLineBuffer; |
164 HBufC8* iScanLineBuffer; |
|
165 CFbsRasterizer* const iRasterizer; |
173 }; |
166 }; |
174 |
167 |
175 class CShiftedFileStore; |
168 class CShiftedFileStore; |
|
169 |
176 /** |
170 /** |
177 BitGdi bitmap class (pseudo-CXxx class). |
171 BitGdi bitmap class (pseudo-CXxx class). |
178 @internalComponent |
172 WARNING: Class for internal use ONLY. Compatibility is not guaranteed in future releases. |
179 @released |
173 @released |
180 */ |
174 */ |
181 class CBitwiseBitmap |
175 class CBitwiseBitmap |
182 { |
176 { |
183 friend class CFbTop; |
177 friend class CFbTop; |
198 IMPORT_C TDisplayMode DisplayMode() const; |
192 IMPORT_C TDisplayMode DisplayMode() const; |
199 IMPORT_C TInt HorizontalTwipsToPixels(TInt aTwips) const; |
193 IMPORT_C TInt HorizontalTwipsToPixels(TInt aTwips) const; |
200 IMPORT_C TInt VerticalTwipsToPixels(TInt aTwips) const; |
194 IMPORT_C TInt VerticalTwipsToPixels(TInt aTwips) const; |
201 IMPORT_C TInt HorizontalPixelsToTwips(TInt aPixels) const; |
195 IMPORT_C TInt HorizontalPixelsToTwips(TInt aPixels) const; |
202 IMPORT_C TInt VerticalPixelsToTwips(TInt aPixels) const; |
196 IMPORT_C TInt VerticalPixelsToTwips(TInt aPixels) const; |
203 IMPORT_C void GetPixel(TRgb& aColor,const TPoint& aPos,TUint32* aBase) const; |
197 IMPORT_C void GetPixel(TRgb& aColor,const TPoint& aPos,TUint32* aBase, CFbsRasterizer* aRasterizer) const; |
204 IMPORT_C TInt GetScanLinePtr(TUint32*& aSlptr, TPoint& aPixel,TInt aLength, TUint32* aBase, TLineScanningPosition& aLineScanningPosition) const; |
198 IMPORT_C TInt GetScanLinePtr(TUint32*& aSlptr, TPoint& aPixel,TInt aLength, TUint32* aBase, TLineScanningPosition& aLineScanningPosition) const; |
205 IMPORT_C TInt GetScanLinePtr(TUint32*& aSlptr, TInt& aLength, TPoint& aPixel,TUint32* aBase, TLineScanningPosition& aLineScanningPosition) const; |
199 IMPORT_C TInt GetScanLinePtr(TUint32*& aSlptr, TInt& aLength, TPoint& aPixel,TUint32* aBase, TLineScanningPosition& aLineScanningPosition) const; |
206 IMPORT_C void GetScanLine(TDes8& aBuf,const TPoint& aPixel,TInt aLength,TBool aDither,const TPoint& aDitherOffset,TDisplayMode aDispMode,TUint32* aBase, TLineScanningPosition& aLineScanningPosition) const; |
200 IMPORT_C void GetScanLine(TDes8& aBuf,const TPoint& aPixel,TInt aLength,TBool aDither,const TPoint& aDitherOffset,TDisplayMode aDispMode,TUint32* aBase, TLineScanningPosition& aLineScanningPosition) const; |
207 IMPORT_C void GetScanLine(TUint32*& aSlptr, TDes8& aBuf,const TPoint& aPixel,TInt aLength,TBool aDither,const TPoint& aDitherOffset,TDisplayMode aDispMode) const; |
201 IMPORT_C void GetScanLine(TUint32*& aSlptr, TDes8& aBuf,const TPoint& aPixel,TInt aLength,TBool aDither,const TPoint& aDitherOffset,TDisplayMode aDispMode) const; |
208 IMPORT_C void GetScanLine(TDes8& aBuf,const TPoint& aPixel,TInt aLength,TBool aDither,const TPoint& aDitherOffset,TDisplayMode aDispMode,TUint32* aBase) const; |
202 IMPORT_C void GetScanLine(TDes8& aBuf,const TPoint& aPixel,TInt aLength,TBool aDither,const TPoint& aDitherOffset,TDisplayMode aDispMode,TUint32* aBase) const; |
209 IMPORT_C void GetVerticalScanLine(TDes8& aBuf,TInt aX,TBool aDither,const TPoint& aDitherOffset,TDisplayMode aDispMode,TUint32* aBase) const; |
203 IMPORT_C void GetVerticalScanLine(TDes8& aBuf,TInt aX,TBool aDither,const TPoint& aDitherOffset,TDisplayMode aDispMode,TUint32* aBase, CFbsRasterizer* aRasterizer) const; |
210 IMPORT_C void StretchScanLine(TDes8& aBuf,const TPoint& aPixel,TInt aClipStrchX,TInt aClipStrchLen,TInt aStretchLength,TInt aOrgX,TInt aOrgLen,const TPoint& aDitherOffset,TDisplayMode aDispMode,TUint32* aBase) const; |
204 IMPORT_C void StretchScanLine(TDes8& aBuf,const TPoint& aPixel,TInt aClipStrchX,TInt aClipStrchLen,TInt aStretchLength,TInt aOrgX,TInt aOrgLen,const TPoint& aDitherOffset,TDisplayMode aDispMode,TUint32* aBase) const; |
211 IMPORT_C void StretchScanLine(TDes8& aBuf,const TPoint& aPixel,TInt aClipStrchX,TInt aClipStrchLen,TInt aStretchLength,TInt aOrgX,TInt aOrgLen,const TPoint& aDitherOffset,TDisplayMode aDispMode,TUint32* aBase, TLineScanningPosition& aLineScanningPosition) const; |
205 IMPORT_C void StretchScanLine(TDes8& aBuf,const TPoint& aPixel,TInt aClipStrchX,TInt aClipStrchLen,TInt aStretchLength,TInt aOrgX,TInt aOrgLen,const TPoint& aDitherOffset,TDisplayMode aDispMode,TUint32* aBase, TLineScanningPosition& aLineScanningPosition) const; |
212 IMPORT_C TUint32* ScanLineAddress(TUint32* aBase,TUint aY) const; |
206 IMPORT_C TUint32* ScanLineAddress(TUint32* aBase,TUint aY) const; |
213 IMPORT_C TBool IsMonochrome(TUint32* aBase) const; |
207 IMPORT_C TBool IsMonochrome(TUint32* aBase) const; |
214 IMPORT_C TBool IsLargeBitmap() const; |
208 IMPORT_C TBool IsLargeBitmap() const; |
226 void operator delete(TAny*, TAny*) {} // This function exists only to prevent a compiler warning |
220 void operator delete(TAny*, TAny*) {} // This function exists only to prevent a compiler warning |
227 IMPORT_C CBitwiseBitmap(RHeap* aHeap,CChunkPile* aPile); |
221 IMPORT_C CBitwiseBitmap(RHeap* aHeap,CChunkPile* aPile); |
228 IMPORT_C ~CBitwiseBitmap(); |
222 IMPORT_C ~CBitwiseBitmap(); |
229 IMPORT_C void Reset(); |
223 IMPORT_C void Reset(); |
230 IMPORT_C TInt Construct(const TSize& aSize,TDisplayMode aDispMode,TUid aCreatorUid); |
224 IMPORT_C TInt Construct(const TSize& aSize,TDisplayMode aDispMode,TUid aCreatorUid); |
|
225 IMPORT_C TInt ConstructExtended(const TSize& aSize, TDisplayMode aDispMode, TUid aType, TInt aDataSize); |
231 IMPORT_C void ConstructL(RFs& aFs,const TDesC& aFilename,TInt32 aId,TUint aFileOffset); |
226 IMPORT_C void ConstructL(RFs& aFs,const TDesC& aFilename,TInt32 aId,TUint aFileOffset); |
232 IMPORT_C void ConstructL(RFile& aFile,TInt32 aId,TUint aFileOffset); |
227 IMPORT_C void ConstructL(RFile& aFile,TInt32 aId,TUint aFileOffset); |
233 IMPORT_C void ConstructL(CShiftedFileStore* aFileStore,TStreamId aStreamId); |
228 IMPORT_C void ConstructL(CShiftedFileStore* aFileStore,TStreamId aStreamId); |
234 IMPORT_C TInt CopyData(const CBitwiseBitmap& aSourceBitmap); |
229 IMPORT_C TInt CopyData(const CBitwiseBitmap& aSourceBitmap); |
235 private: |
230 private: |
338 static void CheckHeaderIsValidL(const SEpocBitmapHeader& aHeader); |
333 static void CheckHeaderIsValidL(const SEpocBitmapHeader& aHeader); |
339 static TInt CompressedFormatInfo(TDisplayMode aDispMode, TInt& aBytesPerPack, TInt& aBytesPerCompressed); |
334 static TInt CompressedFormatInfo(TDisplayMode aDispMode, TInt& aBytesPerPack, TInt& aBytesPerCompressed); |
340 static void BitmapFill32(TUint32* aDestPtr32, TInt aCount, TUint32 aValue32); |
335 static void BitmapFill32(TUint32* aDestPtr32, TInt aCount, TUint32 aValue32); |
341 static inline void BitmapFill16(TUint16* aDestPtr16, TInt aCount, TUint16 aValue16); |
336 static inline void BitmapFill16(TUint16* aDestPtr16, TInt aCount, TUint16 aValue16); |
342 private: |
337 private: |
|
338 struct TExtra |
|
339 { |
|
340 #ifdef SYMBIAN_DEBUG_FBS_LOCKHEAP |
|
341 TInt iLockCount; // number of calls to CFbsBitmap::LockHeap() not balanced by calls to CFbsBitmap::UnlockHeap() |
|
342 TThreadId iThreadId; // id of thread that called CFbsBitmap::LockHeap() if any |
|
343 #endif |
|
344 TInt64 iSerialNumber; // serial number of bitmap which is unique to the whole FBServ |
|
345 TInt iTouchCount; // number of calls to TouchBitmap()i.e. number of times bitmap has been changed |
|
346 }; |
|
347 inline TExtra* Extra() const; // only for bitmaps created in RAM |
|
348 private: |
343 TUid iUid; |
349 TUid iUid; |
344 struct TSettings |
350 struct TSettings |
345 { |
351 { |
346 TSettings(TDisplayMode aDisplayMode); |
352 TSettings(TDisplayMode aDisplayMode); |
347 void SetDisplayModes(TDisplayMode aDisplayMode); |
353 void SetDisplayModes(TDisplayMode aDisplayMode); |
348 void SetCurrentDisplayMode(TDisplayMode aDisplayMode); |
354 void SetCurrentDisplayMode(TDisplayMode aDisplayMode); |
349 TDisplayMode CurrentDisplayMode() const; |
355 TDisplayMode CurrentDisplayMode() const; |
350 TDisplayMode InitialDisplayMode() const; |
356 TDisplayMode InitialDisplayMode() const; |
351 inline void SetDirtyBitmap(); |
357 inline void SetDirtyBitmap(); |
352 inline TBool IsDirtyBitmap() const; |
358 inline TBool IsDirtyBitmap() const; |
|
359 inline void SetVolatileBitmap(); |
|
360 inline TBool IsVolatileBitmap() const; |
353 enum |
361 enum |
354 { |
362 { |
355 EBitmapFlagDirty = 0x10000 // set in the old bitmap when a re-allocating operation has created a new bitmap |
363 EBitmapFlagDirty = 0x00010000, // set in the old bitmap when a re-allocating operation has created a new bitmap |
|
364 EBitmapFlagVolatile = 0x00020000, // set when DataAddress() has been called but BeginDataAccess() has not |
356 }; |
365 }; |
357 TUint32 iData; |
366 TUint32 iData; |
358 } iSettings; |
367 } iSettings; |
359 RHeap* iHeap; |
368 RHeap* iHeap; |
360 CChunkPile* iPile; |
369 CChunkPile* iPile; |
361 TInt iByteWidth; |
370 TInt iByteWidth; |
362 SEpocBitmapHeader iHeader; |
371 SEpocBitmapHeader iHeader; |
363 struct TExtra // used only in builds with SYMBIAN_DEBUG_FBS_LOCKHEAP defined |
372 TInt iSpare; |
364 { |
|
365 TInt iLockCount; // number of calls to CFbsBitmap::LockHeap() not balanced by calls to CFbsBitmap::UnlockHeap() |
|
366 TThreadId iThreadId; // id of thread that called CFbsBitmap::LockHeap() if any |
|
367 } |
|
368 *iExtra; // only for bitmaps created in RAM, set to 0xFFFFFFFF for ROM bitmaps by the tool chain |
|
369 TInt iDataOffset; // offset in bytes from "this" or from base of bitmap chunk, or hardware bitmap handle |
373 TInt iDataOffset; // offset in bytes from "this" or from base of bitmap chunk, or hardware bitmap handle |
370 TBool iIsCompressedInRAM; //flag indicating whether CompressData has been called |
374 TBool iIsCompressedInRAM; //flag indicating whether CompressData has been called |
371 }; |
375 }; |
372 |
376 |
373 #endif |
377 #endif |