Merge "Unchecked GetCharacter func when index is over string length" into tizen_2.2
[platform/framework/native/uifw.git] / inc / FGrpBitmap.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file        FGrpBitmap.h
20  * @brief       This is the header file for the %Bitmap class.
21  *
22  * This header file contains the declarations of the %Bitmap class. @n
23  * The class encapsulates a bitmap, which consists of the pixel data
24  * for a graphics image and its attributes.
25  *
26  */
27
28 #ifndef _FGRP_BITMAP_H_
29 #define _FGRP_BITMAP_H_
30
31 #include <FBase.h>
32
33 #include <FBaseObject.h>
34 #include <FBaseByteBuffer.h>
35 #include <FGrpPoint.h>
36 #include <FGrpFloatPoint.h>
37 #include <FGrpDimension.h>
38 #include <FGrpFloatDimension.h>
39 #include <FGrpRectangle.h>
40 #include <FGrpFloatRectangle.h>
41 #include <FGrpColor.h>
42 #include <FGrpBufferInfo.h>
43 #include <FGrpBitmapCommon.h>
44
45 namespace Tizen { namespace Media
46 {
47 class Image;
48 } }
49
50 namespace Tizen { namespace Graphics
51 {
52 class Canvas;
53
54 /**
55  * @class       Bitmap
56  * @brief       This class encapsulates a bitmap.
57  *
58  * @since       2.0
59  *
60  * @final       This class is not intended for extension.
61  *
62  * The %Bitmap class encapsulates a bitmap, which consists of the pixel data
63  * for an image and its attributes.
64  * @n
65  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/graphics/bitmap.htm">Bitmaps</a>.
66  *
67  *
68  */
69 class _OSP_EXPORT_ Bitmap
70         : public Tizen::Base::Object
71 {
72 public:
73         /**
74          * This is the default constructor for this class.
75          *
76          * @since                       2.0
77          * @remarks             After creating an instance of this class, one of the
78          *              Construct() methods must be called explicitly to initialize this instance.
79          *
80          */
81         Bitmap(void);
82
83         /**
84          * This is the destructor for this class.
85          *
86          * @since       2.0
87          */
88         virtual ~Bitmap(void);
89
90         /**
91          * Initializes this instance of %Bitmap by copying a rectangular area of the Frame.
92          *
93          * @since                       2.0
94          *
95          * @return              An error code
96          * @param[in]   rect            The rectangular area of the Frame to copy into bitmap @n
97          *                                                      The width and height of the rectangle must be greater than @c 0. @n
98          *                                                      The area defined by @c rect is clipped to the edges of the Frame so that
99          *                                                      the rectangle does not fall outside the edges of the Frame. @n
100          *                                                      The rectangle must not fall outside the edges of the Frame entirely. @n
101          *                                                      If these conditions are not satisfied, an @c E_OUT_OF_RANGE exception is returned.
102          * @exception   E_SUCCESS                       The method is successful.
103          * @exception   E_OUT_OF_RANGE          The value of the argument is outside the valid range defined by the method.
104          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
105          *
106          */
107         result Construct(const Rectangle& rect);
108
109         /**
110          * Initializes this instance of %Bitmap with the specified dimensions and pixel format.
111          *
112          * @since                       2.0
113          *
114          * @return              An error code
115          * @param[in]   dim                     The dimensions of the bitmap @n
116          *                                                      The width and height must be greater than @c 0.
117          * @param[in]   format          The pixel format
118          * @exception   E_SUCCESS                       The method is successful.
119          * @exception   E_OUT_OF_RANGE          The value of the argument is outside the valid range defined by the method.
120          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
121          *
122          */
123         result Construct(const Dimension& dim, BitmapPixelFormat format);
124
125         /**
126          * Initializes this instance of %Bitmap by copying the specified rectangular area of the specified canvas.
127          *
128          * @since                       2.0
129          *
130          * @return              An error code
131          * @param[in]   canvas          The canvas to copy @n
132          *                                                      The canvas must be constructed successfully before it is passed into this method. @n
133          *                                                      If not, an @c E_INVALID_ARG exception is returned.
134          * @param[in]   rect            The rectangular area of the canvas to copy into a bitmap @n
135          *                                                      The width and height of the rectangle must be greater than @c 0. @n
136          *                                                      The rectangle defined by @c rect is clipped to the edges of the canvas so that
137          *                                                      the rectangle does not fall outside the edges of the canvas. @n
138          *                                                      The rectangle must not fall outside the edges of the canvas entirely. @n
139          *                                                      If these conditions are not satisfied, an @c E_OUT_OF_RANGE exception is returned.
140          * @exception   E_SUCCESS                       The method is successful.
141          * @exception   E_OUT_OF_RANGE          The value of the argument is outside the valid range defined by the method.
142          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
143          *
144          */
145         result Construct(const Canvas& canvas, const Tizen::Graphics::Rectangle& rect);
146
147         /**
148          * Initializes this instance of %Bitmap by copying a rectangular area of the specified bitmap.
149          *
150          * @since                       2.0
151          *
152          * @return              An error code
153          * @param[in]   bitmap          The source bitmap @n
154          *                                                      The bitmap must be constructed successfully before it is passed into this method. @n
155          *                                                      If not, an @c E_INVALID_ARG exception is returned.
156          * @param[in]   rect            The rectangular area of the source bitmap to copy into this bitmap @n
157          *                                                      The width and height of the rectangle must be greater than @c 0. @n
158          *                                                      The rectangle defined by @c rect is clipped to the edges of the source bitmap so that
159          *                                                      the rectangle does not fall outside the edges of the source bitmap. @n
160          *                                                      The rectangle must not fall outside the edges of the source bitmap entirely. @n
161          *                                                      If these conditions are not satisfied, an @c E_OUT_OF_RANGE exception is returned.
162          * @exception   E_SUCCESS                       The method is successful.
163          * @exception   E_OUT_OF_RANGE          The value of the argument is outside the valid range defined by the method.
164          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
165          *
166          */
167         result Construct(const Bitmap& bitmap, const Tizen::Graphics::Rectangle& rect);
168
169         /**
170          * Initializes this instance of %Bitmap by using a buffer that contains raw data.
171          *
172          * @since                       2.0
173          *
174          * @return              An error code
175          * @param[in]           buffer          The buffer containing raw data
176          * @param[in]   dim                     The dimensions of the bitmap @n
177          *                                                      The width and height must be greater than @c 0.
178          * @param[in]   pixelFormat     The pixel format of raw data
179          * @exception   E_SUCCESS               The method is successful.
180          * @exception   E_OUT_OF_RANGE  The value of the argument is outside the valid range defined by the method.
181          * @exception   E_INVALID_ARG   A specified input parameter is invalid.
182          * @remarks The position property of ByteBuffer can be changed.
183          *
184          */
185         result Construct(const Tizen::Base::ByteBuffer& buffer, const Dimension& dim, BitmapPixelFormat pixelFormat);
186
187         /**
188          * Initializes this instance of %Bitmap by using a buffer that contains raw data.
189          *
190          * @since       2.0
191          *
192          * @return     An error code
193          * @param[in]  buffer          The buffer containing raw data
194          * @param[in]  dim             The dimensions of the bitmap @n
195          *                             The width and height must be greater than @c 0.
196          * @param[in]  pixelFormat     The pixel format of raw data
197          * @param[in]  bufferScaling   The buffer scaling type
198          * @exception  E_SUCCESS       The method is successful.
199          * @exception  E_INVALID_ARG   The specified input parameter is invalid.
200          * @exception  E_UNSUPPORTED_FORMAT The specified format is not supported.
201          * @remarks The position property of %ByteBuffer can be changed.
202          *
203          */
204         result Construct(const Tizen::Base::ByteBuffer& buffer, const Dimension& dim, BitmapPixelFormat pixelFormat, BufferScaling bufferScaling);
205
206         /**
207          * Initializes this instance of %Bitmap by copying a rectangular area of the Frame.
208          *
209          * @since                       2.1
210          *
211          * @return      An error code
212          * @param[in]   rect            The rectangular area of the frame that is copied into bitmap @n
213          *                                                      The width and height of the rectangle must be greater than @c 0. @n
214          *                                                      The area defined by @c rect is clipped to the edges of the frame so that
215          *                                                      the rectangle does not fall outside the edges of the frame. @n
216          *                                                      The rectangle must not fall outside the edges of the frame entirely. @n
217          *                                                      If these conditions are not satisfied, an @c E_OUT_OF_RANGE exception is returned.
218          * @exception   E_SUCCESS                       The method is successful.
219          * @exception   E_OUT_OF_RANGE          The value of the argument is outside the valid range defined by the method.
220          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
221          *
222          */
223         result Construct(const FloatRectangle& rect);
224
225         /**
226          * Initializes this instance of %Bitmap with the specified dimensions and pixel format.
227          *
228          * @since                       2.1
229          *
230          * @return              An error code
231          * @param[in]   dim                     The dimensions of the bitmap @n
232          *                                                      The width and height must be greater than @c 0.
233          * @param[in]   format          The pixel format
234          * @exception   E_SUCCESS                       The method is successful.
235          * @exception   E_OUT_OF_RANGE          The value of the argument is outside the valid range defined by the method.
236          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
237          *
238          */
239         result Construct(const FloatDimension& dim, BitmapPixelFormat format);
240
241         /**
242          * Initializes this instance of %Bitmap by copying a specified rectangular area of a specified canvas.
243          *
244          * @since                       2.1
245          *
246          * @return              An error code
247          * @param[in]   canvas          The canvas to copy @n
248          *                                                      The canvas must be constructed successfully before it is passed into this method. @n
249          *                                                      If not, an @c E_INVALID_ARG exception is returned.
250          * @param[in]   rect            The rectangular area of the canvas that is copied into a bitmap @n
251          *                                                      The width and height of the rectangle must be greater than @c 0. @n
252          *                                                      The rectangle defined by @c rect is clipped to the edges of the canvas so that
253          *                                                      the rectangle does not fall outside the edges of the canvas. @n
254          *                                                      The rectangle must not fall outside the edges of the canvas entirely. @n
255          *                                                      If these conditions are not satisfied, an @c E_OUT_OF_RANGE exception is returned.
256          * @exception   E_SUCCESS                       The method is successful.
257          * @exception   E_OUT_OF_RANGE          The value of the argument is outside the valid range defined by the method.
258          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
259          *
260          */
261         result Construct(const Canvas& canvas, const FloatRectangle& rect);
262
263         /**
264          * Initializes this instance of %Bitmap by copying a rectangular area of a specified bitmap.
265          *
266          * @since                       2.1
267          *
268          * @return              An error code
269          * @param[in]   bitmap          The source bitmap @n
270          *                                                      The bitmap must be constructed successfully before it is passed into this method. @n
271          *                                                      If not, an @c E_INVALID_ARG exception is returned.
272          * @param[in]   rect            The rectangular area of the source bitmap that is copied into this bitmap @n
273          *                                                      The width and height of the rectangle must be greater than @c 0. @n
274          *                                                      The rectangle defined by @c rect is clipped to the edges of the source bitmap so that
275          *                                                      the rectangle does not fall outside the edges of the source bitmap. @n
276          *                                                      The rectangle must not fall outside the edges of the source bitmap entirely. @n
277          *                                                      If these conditions are not satisfied, an @c E_OUT_OF_RANGE exception is returned.
278          * @exception   E_SUCCESS                       The method is successful.
279          * @exception   E_OUT_OF_RANGE          The value of the argument is outside the valid range defined by the method.
280          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
281          *
282          */
283         result Construct(const Bitmap& bitmap, const FloatRectangle& rect);
284
285 public:
286         /**
287          * Scales the bitmap to the specified width and height.
288          *
289          * @since                       2.0
290          *
291          * @return              An error code
292          * @param[in]   dim         The dimensions of the specified rectangular area @n
293          *                                              The width and height must be greater than @c 0.
294          * @exception   E_SUCCESS                       The method is successful.
295          * @exception   E_OUT_OF_RANGE          The value of the argument is outside the valid range defined by the method.
296          *
297          */
298         result Scale(const Dimension& dim);
299
300         /**
301          * Scales the bitmap to a specified width and height.
302          *
303          * @since                       2.1
304          *
305          * @return              An error code
306          * @param[in]   dim         The dimensions of the specified rectangular area @n
307          *                                              The width and height must be greater than @c 0.
308          * @exception   E_SUCCESS                       The method is successful.
309          * @exception   E_OUT_OF_RANGE          The value of the argument is outside the valid range defined by the method.
310          *
311          */
312         result Scale(const FloatDimension& dim);
313
314         /**
315          * Merges the specified area of the source bitmap into the calling bitmap at the given Point.
316          *
317          * @since                       2.0
318          *
319          * @return              An error code
320          * @param[in]   destPoint               The X and Y coordinate of the top-left corner of the destination area in the calling bitmap instance
321          * @param[in]   srcBitmap               The source bitmap instance to copy from
322          * @param[in]   srcRect             The rectangular area to copy from the source bitmap @n
323                                         The width and height of the rectangle must be greater than or equal to @c 0.
324          * @exception   E_SUCCESS                       The method is successful.
325          * @exception   E_OUT_OF_RANGE          Either of the following conditions has occurred: @n
326          *                                                                      - The value of the argument is outside the valid range defined by the method. @n
327          *                                                                      - The destX, destY, srcX, or srcY has a negative value. @n
328          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
329          *
330          */
331         result Merge(const Point& destPoint, const Bitmap& srcBitmap, const Rectangle& srcRect);
332
333         /**
334          * Merges a specified area of the source bitmap into the calling bitmap at a given point.
335          *
336          * @since                       2.1
337          *
338          * @return              An error code
339          * @param[in]   destPoint               The X and Y coordinate of the top-left corner of the destination area in the calling bitmap instance
340          * @param[in]   srcBitmap               The source bitmap instance to copy from
341          * @param[in]   srcRect             The rectangular area to copy from the source bitmap @n
342          *                               The width and height of the rectangle must be greater than or equal to @c 0.
343          * @exception   E_SUCCESS                       The method is successful.
344          * @exception   E_OUT_OF_RANGE          Either of the following conditions has occurred: @n
345          *                                                                      - The value of the argument is outside the valid range defined by the method. @n
346          *                                                                      - The destX, destY, srcX, or srcY has a negative value. @n
347          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
348          *
349          */
350         result Merge(const FloatPoint& destPoint, const Bitmap& srcBitmap, const FloatRectangle& srcRect);
351
352         /**
353          * Gets the height of the bitmap.
354          *
355          * @since               2.0
356          *
357          * @return      The height of the bitmap, @n
358          *                      else @c -1 if the method fails
359          *
360          */
361         int GetHeight(void) const;
362
363         /**
364          * Gets the height of the bitmap.
365          *
366          * @since               2.1
367          *
368          * @return      The height of the bitmap, @n
369          *                      else @c -1 if the method fails
370          *
371          */
372         float GetHeightF(void) const;
373
374         /**
375          * Gets the actual height of the bitmap.
376          *
377          * @since               2.1
378          *
379          * @return      The actual height of the bitmap, @n
380          *                      else @c -1.0f if the method fails
381          *
382          */
383         float GetActualHeight(void) const;
384
385         /**
386          * Gets the width of the bitmap.
387          *
388          * @since               2.0
389          *
390          * @return      The width of the bitmap, @n
391          *                      else @c -1 if the method fails
392          *
393          */
394         int GetWidth(void) const;
395
396         /**
397          * Gets the width of the bitmap.
398          *
399          * @since               2.1
400          *
401          * @return      The width of the bitmap, @n
402          *                      else @c -1 if the method fails
403          *
404          */
405         float GetWidthF(void) const;
406
407         /**
408          * Gets the actual width of the bitmap.
409          *
410          * @since               2.1
411          *
412          * @return      The actual width of the bitmap, @n
413          *                      else @c -1.0f if the method fails
414          *
415          */
416         float GetActualWidth(void) const;
417
418         /**
419          * Gets the number of bits per pixel of the bitmap.
420          *
421          * @since               2.0
422          *
423          * @return      The bits per pixel, @n
424          *                      else @c -1 if the method fails
425          *
426          */
427         int GetBitsPerPixel(void) const;
428
429         /**
430          * Gets the pixel color format of the bitmap.
431          *
432          * @since               2.0
433          *
434          * @return      The pixel color format
435          *
436          */
437         BitmapPixelFormat GetPixelColorFormat(void) const;
438
439         /**
440          * Sets the scaling quality to be used for bitmap scaling.
441          *
442          * @since 2.0
443          *
444          * @return              An error code
445          * @param[in]   quality The scaling quality to use for bitmap scaling.
446          * @exception   E_SUCCESS               The method is successful.
447          * @exception   E_INVALID_ARG   A specified input parameter is invalid.
448          *
449          */
450         result SetScalingQuality(BitmapScalingQuality quality);
451
452         /**
453          * Gets the current scaling quality.
454          *
455          * @since 2.0
456          *
457          * @return      The scaling quality
458          * @remarks The default value is @c BITMAP_SCALING_QUALITY_LOW.
459          *
460          */
461         BitmapScalingQuality GetScalingQuality(void) const;
462
463         /**
464          * Sets the specified color as masking color. @n
465          * All pixels with this color are treated as transparent.
466          *
467          * @since                       2.0
468          *
469          * @return              An error code
470          * @param[in]   pColor  The color that is treated as transparent @n
471          *                                              If the parameter is set to @c null, the masking color is removed from this bitmap. @n
472          *                                              Only ::BITMAP_PIXEL_FORMAT_RGB565 is supported.
473          * @exception   E_SUCCESS               The method is successful.
474          * @exception   E_INVALID_ARG   A specified input parameter is invalid.
475          *
476          */
477         result SetMaskingColor(const Color* pColor);
478
479         /**
480          * Gets a masking color.
481          *
482          * @since                       2.0
483          *
484          * @return              An error code
485          * @param[out]  color   The color that is treated as transparent
486          * @exception   E_SUCCESS               The method is successful.
487          * @exception   E_INVALID_DATA  The masking color is not defined.
488          *
489          */
490         result GetMaskingColor(Color& color) const;
491
492         /**
493          * Sets the alpha constant.
494          *
495          * @since                       2.0
496          * @param[in]   opacity         The opacity of the bitmap @n
497          *                                          This value ranges from @c 0 to @c 255.
498          * @remarks The alpha constant is used for the Canvas::DrawBitmap() method.
499          */
500         void SetAlphaConstant(int opacity);
501
502         /**
503          * Gets the alpha constant.
504          *
505          * @since               2.0
506          *
507          * @return      The alpha constant, @n
508          *                      else @c -1 if the method fails
509          */
510         int GetAlphaConstant(void) const;
511
512         /**
513          * Checks whether the instance is nine patched bitmap.
514          *
515          * @since                       2.0
516          *
517          * @return    @c true if the instance is nine patched bitmap, @n
518          *                else @c false
519          */
520         bool IsNinePatchedBitmap(void) const;
521
522         /**
523          * Locks a bitmap for direct pixel access. @n
524          * It sets up a bitmap for accessing the pixels directly. Between the calls to Bitmap::Lock() and Bitmap::Unlock(),
525          * you can write to and read from the bitmap's pixels. After you are done accessing the bitmap's pixels,
526          * you must call %Bitmap::Unlock() to release the lock.
527          *
528          * @since                       2.0
529          *
530          * @return              An error code
531          * @param[out]  info            The extra information of the bitmap
532          * @param[in]   timeout         The time in milliseconds @n
533          *                          This value determines the time the caller waits for the lock to be obtained. @n
534          *                                                      If the lock attempt fails, @c E_TIMEOUT is returned. @n
535          *                                                      The default value is @c INFINITE, which means that the method does not return a value until the lock is acquired.
536          * @exception   E_SUCCESS               The method is successful.
537          * @exception   E_TIMEOUT               The operation is not completed within the specified time period.
538          * @exception   E_SYSTEM                An unknown operating system error has occurred.
539          *
540          */
541         result Lock(BufferInfo& info, long timeout = INFINITE);
542
543         /**
544          * Unlocks a bitmap. @n
545          * A bitmap that is locked using Bitmap::Lock() must be unlocked using Bitmap::Unlock().
546          * The bitmap buffer can be modified when the bitmap is locked, but is applied only when the bitmap is unlocked.
547          * Therefore, all locked bitmap operations can only be used after the bitmap is unlocked using %Bitmap::Unlock().
548          *
549          * @since                       2.0
550          *
551          * @return              An error code
552          * @exception   E_SUCCESS               The method is successful.
553          * @exception   E_SYSTEM                An unknown operating system error has occurred.
554          *
555          */
556         result Unlock(void);
557
558         /**
559          * Gets a non scaled bitmap.
560          *
561          * @since       2.0
562          *
563          * @return      The non scaled bitmap, @n
564          *          else @c null if an exception occurs
565          * @param[in]   buffer          The buffer containing raw data
566          * @param[in]   dim                     The dimensions of the bitmap @n
567          *                                                      The width and height must be greater than @c 0.
568          * @param[in]   pixelFormat     The pixel format of raw data
569          * @exception   E_SUCCESS            The method is successful.
570          * @exception   E_INVALID_ARG        The specified input parameter is invalid.
571          * @exception   E_UNSUPPORTED_FORMAT The specified format is not supported.
572          *
573          * @remarks     The specific error code can be accessed using the GetLastResult() method.
574          */
575         static Bitmap* GetNonScaledBitmapN(const Tizen::Base::ByteBuffer& buffer, const Dimension& dim, BitmapPixelFormat pixelFormat);
576
577 private:
578         //
579         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
580         //
581         Bitmap(const Bitmap& rhs);
582
583         //
584         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
585         //
586         Bitmap& operator =(const Bitmap& rhs);
587
588         //
589         // This method is for internal use only.
590         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
591         //
592         // Initializes this instance of %Bitmap by using a buffer that contains raw data.
593         //
594         // @since       2.0
595         //
596         // @return     An error code
597         // @param[in]  buffer          The buffer containing raw bitmap data
598         // @param[in]  dim             The dimensions of the bitmap @n
599         //                             The width and height must be greater than @c 0.
600         // @param[in]  pixelFormat     The pixel format of the raw bitmap buffer
601         // @param[in]  autoScaling     Set to @c true to automatically scale the bitmap, @n
602         //                                                                      else @c false
603         // @exception  E_SUCCESS       The method is successful.
604         // @exception  E_INVALID_ARG   A specified input parameter is invalid.
605         // @exception  E_UNSUPPORTED_FORMAT The specified format is not supported.
606         //
607         result Construct(const Tizen::Base::ByteBuffer& buffer, const Dimension& dim, BitmapPixelFormat pixelFormat, bool autoScaling);
608
609         //
610         // This method is for internal use only.
611         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
612         //
613         // Initializes this instance of %Bitmap by using a buffer that contains raw data.
614         //
615         // @since       2.0
616         //
617         // @return     An error code
618         // @param[in]  pBuffer         A pointer to the raw bitmap buffer
619         // @param[in]  bufferSize      The size of the raw bitmap buffer
620         // @param[in]  dim             The dimensions of the bitmap @n
621         //                             The width and height must be greater than @c 0.
622         // @param[in]  pixelFormat     The pixel format of the raw bitmap buffer
623         // @param[in]  autoScaling     Set to @c true to automatically scale the bitmap, @n
624         //                                                                      else @c false
625         // @exception  E_SUCCESS       The method is successful.
626         // @exception  E_INVALID_ARG   A specified input parameter is invalid.
627         // @exception  E_UNSUPPORTED_FORMAT The specified format is not supported
628         //
629         result Construct(const byte* pBuffer, int bufferSize, const Dimension& dim, BitmapPixelFormat pixelFormat, bool autoScaling);
630
631         friend class Canvas;
632         friend class Tizen::Media::Image;
633
634 private:
635         friend class _BitmapImpl;
636
637         //
638         // This variable is for internal use only.
639         // Using this variable can cause behavioral, security-related, and consistency-related issues in the application.
640         //
641         // @since 2.0
642         //
643         class _BitmapImpl* __pImpl;
644
645 }; // Bitmap
646
647 }} // Tizen::Graphics
648
649 #endif //_FGRP_BITMAP_H_