2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
17 #ifndef HERE_GRAPHIC_BUFFERINFO_H
18 #define HERE_GRAPHIC_BUFFERINFO_H
20 #include "common/HereMaps_global.h"
21 #include "base/BaseObject.h"
22 #include "graphic/Rectangle.h"
27 PIXEL_FORMAT_RGB565 = 1, /**< The RGB565 pixel format */
28 PIXEL_FORMAT_ARGB8888, /**< The ARGB8888 pixel format */
29 PIXEL_FORMAT_R8G8B8A8, /**< The R8G8B8A8 pixel format @n
30 The order of color component is guaranteed by the byte unit. */
31 PIXEL_FORMAT_YCbCr420_PLANAR, /**< The 8-bit Y-plane followed by 8-bit 2x2 sub sampled U-plane and V-plane */
32 PIXEL_FORMAT_JPEG, /**< The encoded format */
33 PIXEL_FORMAT_NV12, /**< The NV12 pixel format */
34 PIXEL_FORMAT_UYVY, /**< The UYVY pixel format */
35 PIXEL_FORMAT_MAX, // This enum value is for internal use only. Using this enum value can cause behavioral, security-related, and consistency-related issues in the application.
36 PIXEL_FORMAT_MIN = 0 // This enum value is for internal use only. Using this enum value can cause behavioral, security-related, and consistency-related issues in the application.
40 TIZEN_MAPS_BEGIN_NAMESPACE
49 INVALID_BUFFER_HANDLE = 0
55 ORIENTATION_LANDSCAPE,
56 ORIENTATION_PORTRAIT_REVERSE,
57 ORIENTATION_LANDSCAPE_REVERSE
63 HANDLE_TYPE_OVERLAY_REGION,
64 HANDLE_TYPE_VE_SURFACE,
65 HANDLE_TYPE_CANVAS_TEXTURE,
66 HANDLE_TYPE_NATIVE_PIXMAP
78 * This is the default constructor for this class.
83 * This is the destructor for this class.
85 virtual ~_BufferInfoImpl();
88 * Gets the handle of the current instance of _BufferInfoImpl.
90 * @return The runtime handle
93 int GetHandle(HandleType handleType) const;
95 void* GetUserData(HandleType handleType) const;
98 * Sets the handle of the current instance of _BufferInfoImpl.
101 void SetHandle(HandleType handleType, int handle, void* pUserData = null);
104 * Gets the orientation of the current instance of _BufferInfoImpl.
107 Orientation GetOrientation(void) const;
110 * Sets the orientation of the current instance of _BufferInfoImpl.
113 void SetOrientation(Orientation orientation);
116 * Gets the bounds of the current instance of _BufferInfoImpl.
119 Rectangle GetBounds(void) const;
122 * Sets the bounds of the current instance of _BufferInfoImpl.
125 void SetBounds(const Rectangle& rect);
128 * Gets the rotation of the current instance of _BufferInfoImpl.
131 Rotation GetRotation(void) const;
134 * Sets the rotation of the current instance of _BufferInfoImpl.
137 void SetRotation(Rotation rotation);
139 static _BufferInfoImpl* GetInstance(BufferInfo& bufferInfo);
140 static const _BufferInfoImpl* GetInstance(const BufferInfo& bufferInfo);
144 * This is the default copy constructor for this class.
146 _BufferInfoImpl(const _BufferInfoImpl& src);
149 * This is the default assignment operator for this class.
151 _BufferInfoImpl& operator =(const _BufferInfoImpl& rhs);
153 friend class BufferInfo;
155 HandleType __handleType;
158 Orientation __orientation;
162 }; // _BufferInfoImpl
164 class BufferInfo : public Object
168 * This is the default constructor for this class.
175 * This is the copy constructor for the %BufferInfo class.
179 * @param[in] rhs An instance of %BufferInfo
181 BufferInfo(const BufferInfo& rhs);
184 * This is the destructor for this class.
188 virtual ~BufferInfo(void);
191 * This is the default assignment operator for this class.
195 * @param[in] rhs An instance of %BufferInfo
197 BufferInfo& operator =(const BufferInfo& rhs);
200 * Checks whether the value of the specified instance equals the value of the current instance.
204 * @return @c true if the value of the current instance equals the value of the specified instance, @n
206 * @param[in] rhs The object to compare with the current instance
208 virtual bool Equals(const Object& rhs) const;
211 * Gets the hash value of the current instance.
215 * @return An integer value indicating the hash value of the current instance
217 virtual long GetHashCode(void) const;
221 * The width of the buffer's logical dimensions in pixels.
228 * The height of the buffer's logical dimensions in pixels.
235 * The length of the buffer scan-line in bytes.
242 * The bits per pixel of the buffer.
249 * The color format of the buffer.
255 PIXEL_FORMAT_RGB565 = 1, /**< The RGB565 pixel format */
256 PIXEL_FORMAT_ARGB8888, /**< The ARGB8888 pixel format */
257 PIXEL_FORMAT_R8G8B8A8, /**< The R8G8B8A8 pixel format @n
258 The order of color component is guaranteed by the byte unit. */
259 PIXEL_FORMAT_YCbCr420_PLANAR, /**< The 8-bit Y-plane followed by 8-bit 2x2 sub sampled U-plane and V-plane */
260 PIXEL_FORMAT_JPEG, /**< The encoded format */
261 PIXEL_FORMAT_NV12, /**< The NV12 pixel format */
262 PIXEL_FORMAT_UYVY, /**< The UYVY pixel format */
263 PIXEL_FORMAT_MAX, // This enum value is for internal use only. Using this enum value can cause behavioral, security-related, and consistency-related issues in the application.
264 PIXEL_FORMAT_MIN = 0 // This enum value is for internal use only. Using this enum value can cause behavioral, security-related, and consistency-related issues in the application.
267 PixelFormat pixelFormat;
270 * A pointer to the actual locked pixel bits.
277 friend class _BufferInfoImpl;
280 // This variable is for internal use only.
281 // Using this variable can cause behavioral, security-related, and consistency-related issues in the application.
285 class _BufferInfoImpl * __pImpl;
289 TIZEN_MAPS_END_NAMESPACE
291 #endif /* HERE_GRAPHIC_BUFFERINFO_H */