|
1 /* |
|
2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef LCDFBSIMAGE_H |
|
19 #define LCDFBSIMAGE_H |
|
20 |
|
21 #include <fbs.h> |
|
22 #include <lcdgr.h> |
|
23 #include <lcdgdrv.h> |
|
24 |
|
25 /** |
|
26 * Image represented by SymbianOS color bitmap + mask/alpha bitmap where |
|
27 * transparency is present. |
|
28 * |
|
29 */ |
|
30 NONSHARABLE_CLASS(CLcdFbsImage) : public CBase |
|
31 { |
|
32 public: |
|
33 /** |
|
34 * Construct a new image of size aSize and color bitmap of mode aColorMode with optional mask/alpha |
|
35 * bitmap of mode aAlphaMode. An alpha bitmap mode of ENone indicates no alpha bitmap should be |
|
36 * created. |
|
37 */ |
|
38 static CLcdFbsImage* NewL(const TSize& aSize, TDisplayMode aColorMode, TDisplayMode aAlphaMode); |
|
39 |
|
40 /** |
|
41 * Construct a new image, duplicating the bitmap handles aColorBitmap and optional aAlphaBitmap. |
|
42 */ |
|
43 static CLcdFbsImage* NewL(CFbsBitmap* aColorBitmap, CFbsBitmap* aAlphaBitmap); |
|
44 |
|
45 /** |
|
46 * Dup a bitmap handle. Allocates a new CFbsBitmap instance to hold the handle. Requires an FBSERV ipc. |
|
47 */ |
|
48 static CFbsBitmap* DuplicateBitmapL(CFbsBitmap*); |
|
49 |
|
50 /** |
|
51 * Create a new bitmap in a given mode and copy the data, optionally inverted. |
|
52 */ |
|
53 static CFbsBitmap* CopyBitmapL(CFbsBitmap*, TDisplayMode, TBool); |
|
54 |
|
55 /** |
|
56 * Copies pixel data from aSource to aTarget, optionally inverting. Uses BITGDI |
|
57 * for closest match. |
|
58 */ |
|
59 static void CopyBitmapL(CFbsBitmap* aTarget, CFbsBitmap* aSource, TBool aInvert); |
|
60 |
|
61 ~CLcdFbsImage(); |
|
62 |
|
63 /** |
|
64 * |
|
65 */ |
|
66 TSize Size() const; |
|
67 |
|
68 /** |
|
69 * Increment ref count |
|
70 */ |
|
71 void AddRef(); |
|
72 |
|
73 /** |
|
74 * Decrement ref count |
|
75 */ |
|
76 void RemoveRef(); |
|
77 |
|
78 /** |
|
79 *@return the color bitmap |
|
80 */ |
|
81 CFbsBitmap* ColorBitmap() const; |
|
82 |
|
83 /** |
|
84 *@return the alpha bitmap if any |
|
85 */ |
|
86 CFbsBitmap* AlphaBitmap() const; |
|
87 |
|
88 /** |
|
89 * Create an alpha bitmap for this image. |
|
90 * |
|
91 * Temporarily required to support setTransparencyType. |
|
92 */ |
|
93 void CreateAlphaBitmapL(); |
|
94 |
|
95 private: |
|
96 CFbsBitmap* iColorBitmap; |
|
97 CFbsBitmap* iAlphaBitmap; |
|
98 TInt iRefCount; |
|
99 }; |
|
100 |
|
101 #endif // LCDFBSIMAGE_H |