|
1 /* |
|
2 * Copyright (c) 2004 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: Static utility class for synchronous CFbsBitmap operations. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef IHLBITMAPUTIL_H |
|
20 #define IHLBITMAPUTIL_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32std.h> |
|
24 |
|
25 // FORWARD DECLARATION |
|
26 class CFbsBitmap; |
|
27 |
|
28 // CLASS DECLARATION |
|
29 /** |
|
30 * IHLBitmapUtil |
|
31 * |
|
32 * Static utility class for synchronous CFbsBitmap operations. |
|
33 * @lib IHL.lib |
|
34 * @since 3.0 |
|
35 */ |
|
36 class IHLBitmapUtil |
|
37 { |
|
38 public: |
|
39 |
|
40 /** |
|
41 * Create new bitmap instance using |
|
42 * same server handle as in given bitmap. |
|
43 * Note that modifying bitmap content will also change |
|
44 * all other bitmap content that has same server handle. |
|
45 * @since 3.0 |
|
46 * @param aBitmap Duplicated bitmap reference. |
|
47 * @return Duplicated CFbsBitmap instance. |
|
48 */ |
|
49 IMPORT_C static CFbsBitmap* DuplicateBitmapL( const CFbsBitmap& aBitmap ); |
|
50 |
|
51 /** |
|
52 * Create new bitmap instance using |
|
53 * same server handle as in given bitmap. |
|
54 * Note that modifying bitmap content will also change |
|
55 * all other bitmap content that has same server handle. |
|
56 * New instance is pushed into CleanupStack. |
|
57 * @since 3.0 |
|
58 * @param aBitmap Duplicated bitmap reference. |
|
59 * @return Duplicated CFbsBitmap instance. |
|
60 */ |
|
61 IMPORT_C static CFbsBitmap* DuplicateBitmapLC( const CFbsBitmap& aBitmap ); |
|
62 |
|
63 /** |
|
64 * Copy bitmap into new same sized bitmap. |
|
65 * New bitmap has unique server handle and it can be |
|
66 * modified without risk of changes in given source bitmap. |
|
67 * @since 3.0 |
|
68 * @param aBitmap Copied bitmap reference. |
|
69 * @return Copied CFbsBitmap instance. |
|
70 */ |
|
71 IMPORT_C static CFbsBitmap* CopyBitmapL( const CFbsBitmap& aBitmap ); |
|
72 |
|
73 /** |
|
74 * Copy bitmap into new same sized bitmap. |
|
75 * New bitmap has unique server handle and it can be |
|
76 * modified without risk of changes in given source bitmap. |
|
77 * New instance is pushed into CleanupStack. |
|
78 * @since 3.0 |
|
79 * @param aBitmap Copied bitmap reference. |
|
80 * @return Copied CFbsBitmap instance. |
|
81 */ |
|
82 IMPORT_C static CFbsBitmap* CopyBitmapLC( const CFbsBitmap& aBitmap ); |
|
83 |
|
84 /** |
|
85 * Copy user defined area from source bitmap into new bitmap. |
|
86 * New bitmap has unique server handle and it can be |
|
87 * modified without risk of changes in given source bitmap. |
|
88 * @since 3.0 |
|
89 * @param aBitmap Source bitmap reference. |
|
90 * @param aRect Copied rectangle from source bitmap. |
|
91 * @return Copied CFbsBitmap instance, size of given rect. |
|
92 */ |
|
93 IMPORT_C static CFbsBitmap* CopyBitmapL( const CFbsBitmap& aBitmap, const TRect& aRect ); |
|
94 |
|
95 /** |
|
96 * Copy user defined area from source bitmap into new bitmap. |
|
97 * New bitmap has unique server handle and it can be |
|
98 * modified without risk of changes in given source bitmap. |
|
99 * New instance is pushed into CleanupStack. |
|
100 * @since 3.0 |
|
101 * @param aBitmap Source bitmap reference. |
|
102 * @param aRect Copied rectangle from source bitmap. |
|
103 * @return Copied CFbsBitmap instance, size of given rect. |
|
104 */ |
|
105 IMPORT_C static CFbsBitmap* CopyBitmapLC( const CFbsBitmap& aBitmap, const TRect& aRect ); |
|
106 |
|
107 /** |
|
108 * Synchronous bitmap scaler. Use only with small bitmaps! |
|
109 * Prefer asynchronous MIHLScaler instead. |
|
110 * |
|
111 * Scale source bitmap into destination bitmap. |
|
112 * @since 3.0 |
|
113 * @param aSrcBitmap Source bitmap reference. |
|
114 * @param aDstBitmap Destination bitmap reference. |
|
115 * If destination bitmap has null handle, |
|
116 * processor will create new bitmap using size of |
|
117 * destination rectangle. |
|
118 * @param aOptions Reserved for future use. |
|
119 * @return Return system wide error codes: |
|
120 * KerrArgument - source bitmap is empty (handle is null). |
|
121 * - destination bitmap displaymode differs |
|
122 * from source bitmap displaymode. |
|
123 */ |
|
124 IMPORT_C static TInt ScaleBitmap( const CFbsBitmap& aSrcBitmap, CFbsBitmap& aDstBitmap, |
|
125 TUint32 aOptions = 0 ); |
|
126 |
|
127 /** |
|
128 * Synchronous bitmap scaler. Use only with small bitmaps! |
|
129 * Prefer asynchronous MIHLScaler instead. |
|
130 * |
|
131 * Scale rectangle from source bitmap to a rectangle |
|
132 * in destination bitmap. Scaled area can be also |
|
133 * rotated and/or mirrored during process. |
|
134 * See full usage description from MIHLScaler header. |
|
135 * @since 3.0 |
|
136 * @param aSrcBitmap Source bitmap reference. |
|
137 * @param aSrcRect Rectangle that is processed from source bitmap. |
|
138 * @param aDstBitmap Destination bitmap reference. |
|
139 * If destination bitmap has null handle, |
|
140 * processor will create new bitmap using size of |
|
141 * destination rectangle. |
|
142 * @param aDstRect Rectangle that is filled in destination bitmap. |
|
143 * @param aOptions Reserved for future use. |
|
144 * @return Return system wide error codes: |
|
145 * KerrArgument - rectangles are outside of bitmap area. |
|
146 * - source bitmap is empty (handle is null). |
|
147 * - destination bitmap displaymode differs |
|
148 * from source bitmap displaymode. |
|
149 */ |
|
150 IMPORT_C static TInt ScaleBitmap( const CFbsBitmap& aSrcBitmap, const TRect& aSrcRect, |
|
151 CFbsBitmap& aDstBitmap, const TRect& aDstRect, |
|
152 TUint32 aOptions = 0 ); |
|
153 }; |
|
154 |
|
155 #endif // IHLBITMAPUTIL_H |
|
156 |
|
157 // End of File |