1 /**************************************************************************
5 Copyright 2014 Samsung Electronics co., Ltd. All Rights Reserved.
7 Contact: SooChan Lim <sc1.lim@samsung.com>, Sangjin Lee <lsj119@samsung.com>
8 Inpyo Kang <mantiger@samsung.com>, Dongyeon Kim <dy5.kim@samsung.com>
9 Boram Park <boram1288.park@samsung.com>, Changyeon Lee <cyeon.lee@samsung.com>
11 Permission is hereby granted, free of charge, to any person obtaining a
12 copy of this software and associated documentation files (the
13 "Software"), to deal in the Software without restriction, including
14 without limitation the rights to use, copy, modify, merge, publish,
15 distribute, sub license, and/or sell copies of the Software, and to
16 permit persons to whom the Software is furnished to do so, subject to
17 the following conditions:
19 The above copyright notice and this permission notice (including the
20 next paragraph) shall be included in all copies or substantial portions
23 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
26 IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
27 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
28 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
29 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 **************************************************************************/
33 #ifndef _TBM_SURFACE_H_
34 #define _TBM_SURFACE_H_
37 * @addtogroup CAPI_UI_TBM_SURFACE_MODULE
50 * @brief Enumeration for tbm_surface error type.
55 TBM_SURFACE_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
56 TBM_SURFACE_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
57 TBM_SURFACE_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION, /**< Invalid Operation */
58 } tbm_surface_error_e;
61 * @brief Definition for the max number of TBM surface plane.
64 #define TBM_SURF_PLANE_MAX 4
66 /* option to map the tbm_surface */
68 * @brief Definition for the access option to read.
71 #define TBM_SURF_OPTION_READ (1 << 0)
73 * @brief Definition for the access option to write.
76 #define TBM_SURF_OPTION_WRITE (1 << 1)
79 * @brief Definition for the TBM plane struct.
82 typedef struct _tbm_surface_plane
84 unsigned char *ptr; /**< Plane pointer */
85 uint32_t size; /**< Plane size */
86 uint32_t offset; /**< Plane offset */
87 uint32_t stride; /**< Plane stride */
89 void *reserved1; /**< Reserved pointer1 */
90 void *reserved2; /**< Reserved pointer2 */
91 void *reserved3; /**< Reserved pointer3 */
92 } tbm_surface_plane_s;
95 * @brief Definition for the TBM surface information struct.
98 typedef struct _tbm_surface_info
100 uint32_t width; /**< TBM surface width */
101 uint32_t height; /**< TBM surface height */
102 tbm_format format; /**< TBM surface format*/
103 uint32_t bpp; /**< TBM surface bbp */
104 uint32_t size; /**< TBM surface size */
106 uint32_t num_planes; /**< The number of planes */
107 tbm_surface_plane_s planes[TBM_SURF_PLANE_MAX]; /**< Array of planes */
109 void *reserved4; /**< Reserved pointer4 */
110 void *reserved5; /**< Reserved pointer5 */
111 void *reserved6; /**< Reserved pointer6 */
112 } tbm_surface_info_s;
114 #define __tbm_fourcc_code(a,b,c,d) ((uint32_t)(a) | ((uint32_t)(b) << 8) | \
115 ((uint32_t)(c) << 16) | ((uint32_t)(d) << 24))
119 * @brief Definition for the TBM surface format C8 ([7:0] C).
122 #define TBM_FORMAT_C8 __tbm_fourcc_code('C', '8', ' ', ' ')
126 * @brief Definition for the TBM surface format RGB322 ([7:0] R:G:B 3:3:2).
129 #define TBM_FORMAT_RGB332 __tbm_fourcc_code('R', 'G', 'B', '8')
131 * @brief Definition for the TBM surface format RGB233 ([7:0] B:G:R 2:3:3).
134 #define TBM_FORMAT_BGR233 __tbm_fourcc_code('B', 'G', 'R', '8')
138 * @brief Definition for the TBM surface format XRGB4444 ([15:0] x:R:G:B 4:4:4:4 little endian).
141 #define TBM_FORMAT_XRGB4444 __tbm_fourcc_code('X', 'R', '1', '2')
143 * @brief Definition for the TBM surface format XBRG4444 ([15:0] x:B:G:R 4:4:4:4 little endian).
146 #define TBM_FORMAT_XBGR4444 __tbm_fourcc_code('X', 'B', '1', '2')
148 * @brief Definition for the TBM surface format RGBX4444 ([15:0] R:G:B:x 4:4:4:4 little endian).
151 #define TBM_FORMAT_RGBX4444 __tbm_fourcc_code('R', 'X', '1', '2')
153 * @brief Definition for the TBM surface format BGRX4444 ([15:0] B:G:R:x 4:4:4:4 little endian).
156 #define TBM_FORMAT_BGRX4444 __tbm_fourcc_code('B', 'X', '1', '2')
159 * @brief Definition for the TBM surface format ARGB4444 ([15:0] A:R:G:B 4:4:4:4 little endian).
162 #define TBM_FORMAT_ARGB4444 __tbm_fourcc_code('A', 'R', '1', '2')
164 * @brief Definition for the TBM surface format ABGR4444 ([15:0] A:B:G:R 4:4:4:4 little endian).
167 #define TBM_FORMAT_ABGR4444 __tbm_fourcc_code('A', 'B', '1', '2')
169 * @brief Definition for the TBM surface format RGBA4444 ([15:0] R:G:B:A 4:4:4:4 little endian).
172 #define TBM_FORMAT_RGBA4444 __tbm_fourcc_code('R', 'A', '1', '2')
174 * @brief Definition for the TBM surface format BGRA4444 ([15:0] B:G:R:A 4:4:4:4 little endian).
177 #define TBM_FORMAT_BGRA4444 __tbm_fourcc_code('B', 'A', '1', '2')
180 * @brief Definition for the TBM surface format XRGB1555 ([15:0] x:R:G:B 1:5:5:5 little endian).
183 #define TBM_FORMAT_XRGB1555 __tbm_fourcc_code('X', 'R', '1', '5')
185 * @brief Definition for the TBM surface format XBGR1555 ([15:0] x:B:G:R 1:5:5:5 little endian).
188 #define TBM_FORMAT_XBGR1555 __tbm_fourcc_code('X', 'B', '1', '5')
190 * @brief Definition for the TBM surface format RGBX5551 ([15:0] R:G:B:x 5:5:5:1 little endian).
193 #define TBM_FORMAT_RGBX5551 __tbm_fourcc_code('R', 'X', '1', '5')
195 * @brief Definition for the TBM surface format BGRX5551 ([15:0] B:G:R:x 5:5:5:1 little endian).
198 #define TBM_FORMAT_BGRX5551 __tbm_fourcc_code('B', 'X', '1', '5')
201 * @brief Definition for the TBM surface format ARGB1555 ([15:0] A:R:G:B 1:5:5:5 little endian).
204 #define TBM_FORMAT_ARGB1555 __tbm_fourcc_code('A', 'R', '1', '5')
206 * @brief Definition for the TBM surface format ABGR1555 ([15:0] A:B:G:R 1:5:5:5 little endian).
209 #define TBM_FORMAT_ABGR1555 __tbm_fourcc_code('A', 'B', '1', '5')
211 * @brief Definition for the TBM surface format RGBA5551 ([15:0] R:G:B:A 5:5:5:1 little endian).
214 #define TBM_FORMAT_RGBA5551 __tbm_fourcc_code('R', 'A', '1', '5')
216 * @brief Definition for the TBM surface format BGRA5551 ([15:0] B:G:R:A 5:5:5:1 little endian).
219 #define TBM_FORMAT_BGRA5551 __tbm_fourcc_code('B', 'A', '1', '5')
222 * @brief Definition for the TBM surface format RGB565 ([15:0] R:G:B 5:6:5 little endian).
225 #define TBM_FORMAT_RGB565 __tbm_fourcc_code('R', 'G', '1', '6')
227 * @brief Definition for the TBM surface format BGR565 ([15:0] B:G:R 5:6:5 little endian).
230 #define TBM_FORMAT_BGR565 __tbm_fourcc_code('B', 'G', '1', '6')
234 * @brief Definition for the TBM surface format RGB888 ([23:0] R:G:B little endian).
237 #define TBM_FORMAT_RGB888 __tbm_fourcc_code('R', 'G', '2', '4')
239 * @brief Definition for the TBM surface format BGR888 ([23:0] B:G:R little endian).
242 #define TBM_FORMAT_BGR888 __tbm_fourcc_code('B', 'G', '2', '4')
246 * @brief Definition for the TBM surface format XRGB8888 ([31:0] x:R:G:B 8:8:8:8 little endian).
249 #define TBM_FORMAT_XRGB8888 __tbm_fourcc_code('X', 'R', '2', '4')
251 * @brief Definition for the TBM surface format XBGR8888 ([31:0] x:B:G:R 8:8:8:8 little endian).
254 #define TBM_FORMAT_XBGR8888 __tbm_fourcc_code('X', 'B', '2', '4')
256 * @brief Definition for the TBM surface format RGBX8888 ([31:0] R:G:B:x 8:8:8:8 little endian).
259 #define TBM_FORMAT_RGBX8888 __tbm_fourcc_code('R', 'X', '2', '4')
261 * @brief Definition for the TBM surface format BGRX8888 ([31:0] B:G:R:x 8:8:8:8 little endian).
264 #define TBM_FORMAT_BGRX8888 __tbm_fourcc_code('B', 'X', '2', '4')
267 * @brief Definition for the TBM surface format ARGB8888 ([31:0] A:R:G:B 8:8:8:8 little endian).
270 #define TBM_FORMAT_ARGB8888 __tbm_fourcc_code('A', 'R', '2', '4')
272 * @brief Definition for the TBM surface format ABGR8888 ([31:0] [31:0] A:B:G:R 8:8:8:8 little endian).
275 #define TBM_FORMAT_ABGR8888 __tbm_fourcc_code('A', 'B', '2', '4')
277 * @brief Definition for the TBM surface format RGBA8888 ([31:0] R:G:B:A 8:8:8:8 little endian).
280 #define TBM_FORMAT_RGBA8888 __tbm_fourcc_code('R', 'A', '2', '4')
282 * @brief Definition for the TBM surface format BGRA8888 ([31:0] B:G:R:A 8:8:8:8 little endian).
285 #define TBM_FORMAT_BGRA8888 __tbm_fourcc_code('B', 'A', '2', '4')
288 * @brief Definition for the TBM surface format XRGB2101010 ([31:0] x:R:G:B 2:10:10:10 little endian).
291 #define TBM_FORMAT_XRGB2101010 __tbm_fourcc_code('X', 'R', '3', '0')
293 * @brief Definition for the TBM surface format XBGR2101010 ([31:0] x:B:G:R 2:10:10:10 little endian).
296 #define TBM_FORMAT_XBGR2101010 __tbm_fourcc_code('X', 'B', '3', '0')
298 * @brief Definition for the TBM surface format RGBX1010102 ([31:0] R:G:B:x 10:10:10:2 little endian).
301 #define TBM_FORMAT_RGBX1010102 __tbm_fourcc_code('R', 'X', '3', '0')
303 * @brief Definition for the TBM surface format BGRX1010102 ([31:0] B:G:R:x 10:10:10:2 little endian).
306 #define TBM_FORMAT_BGRX1010102 __tbm_fourcc_code('B', 'X', '3', '0')
309 * @brief Definition for the TBM surface format ARGB2101010 ([31:0] A:R:G:B 2:10:10:10 little endian).
312 #define TBM_FORMAT_ARGB2101010 __tbm_fourcc_code('A', 'R', '3', '0')
314 * @brief Definition for the TBM surface format ABGR2101010 ([31:0] A:B:G:R 2:10:10:10 little endian).
317 #define TBM_FORMAT_ABGR2101010 __tbm_fourcc_code('A', 'B', '3', '0')
319 * @brief Definition for the TBM surface format RGBA1010102 ([31:0] R:G:B:A 10:10:10:2 little endian).
322 #define TBM_FORMAT_RGBA1010102 __tbm_fourcc_code('R', 'A', '3', '0')
324 * @brief Definition for the TBM surface format BGRA1010102 ([31:0] B:G:R:A 10:10:10:2 little endian).
327 #define TBM_FORMAT_BGRA1010102 __tbm_fourcc_code('B', 'A', '3', '0') /* */
331 * @brief Definition for the TBM surface format YUYV ([31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian).
334 #define TBM_FORMAT_YUYV __tbm_fourcc_code('Y', 'U', 'Y', 'V')
336 * @brief Definition for the TBM surface format YVYU ([31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian).
339 #define TBM_FORMAT_YVYU __tbm_fourcc_code('Y', 'V', 'Y', 'U') /* */
341 * @brief Definition for the TBM surface format UYVY ([31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian).
344 #define TBM_FORMAT_UYVY __tbm_fourcc_code('U', 'Y', 'V', 'Y')
346 * @brief Definition for the TBM surface format VYUY ([31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian).
349 #define TBM_FORMAT_VYUY __tbm_fourcc_code('V', 'Y', 'U', 'Y')
352 * @brief Definition for the TBM surface format AYUV ([31:0] A:Y:Cb:Cr 8:8:8:8 little endian).
355 #define TBM_FORMAT_AYUV __tbm_fourcc_code('A', 'Y', 'U', 'V')
359 * index 0 = Y plane, [7:0] Y
360 * index 1 = Cr:Cb plane, [15:0] Cr:Cb little endian
362 * index 1 = Cb:Cr plane, [15:0] Cb:Cr little endian
365 * @brief Definition for the TBM surface format NV12 (2x2 subsampled Cr:Cb plane).
368 #define TBM_FORMAT_NV12 __tbm_fourcc_code('N', 'V', '1', '2')
370 * @brief Definition for the TBM surface format NV21 (2x2 subsampled Cb:Cr plane).
373 #define TBM_FORMAT_NV21 __tbm_fourcc_code('N', 'V', '2', '1') /* */
375 * @brief Definition for the TBM surface format NV16 (2x1 subsampled Cr:Cb plane).
378 #define TBM_FORMAT_NV16 __tbm_fourcc_code('N', 'V', '1', '6')
380 * @brief Definition for the TBM surface format NV61 (2x1 subsampled Cb:Cr plane).
383 #define TBM_FORMAT_NV61 __tbm_fourcc_code('N', 'V', '6', '1')
387 * index 0: Y plane, [7:0] Y
388 * index 1: Cb plane, [7:0] Cb
389 * index 2: Cr plane, [7:0] Cr
391 * index 1: Cr plane, [7:0] Cr
392 * index 2: Cb plane, [7:0] Cb
395 * @brief Definition for the TBM surface format YUV410 (4x4 subsampled Cb (1) and Cr (2) planes).
397 #define TBM_FORMAT_YUV410 __tbm_fourcc_code('Y', 'U', 'V', '9')
399 * @brief Definition for the TBM surface format YVU410 (4x4 subsampled Cr (1) and Cb (2) planes).
402 #define TBM_FORMAT_YVU410 __tbm_fourcc_code('Y', 'V', 'U', '9')
404 * @brief Definition for the TBM surface format YUV411 (4x1 subsampled Cb (1) and Cr (2) planes).
407 #define TBM_FORMAT_YUV411 __tbm_fourcc_code('Y', 'U', '1', '1')
409 * @brief Definition for the TBM surface format YVU411 (4x1 subsampled Cr (1) and Cb (2) planes).
412 #define TBM_FORMAT_YVU411 __tbm_fourcc_code('Y', 'V', '1', '1')
414 * @brief Definition for the TBM surface format YUV420 (2x2 subsampled Cb (1) and Cr (2) planes).
417 #define TBM_FORMAT_YUV420 __tbm_fourcc_code('Y', 'U', '1', '2')
419 * @brief Definition for the TBM surface format YVU420 (2x2 subsampled Cr (1) and Cb (2) planes).
422 #define TBM_FORMAT_YVU420 __tbm_fourcc_code('Y', 'V', '1', '2')
424 * @brief Definition for the TBM surface format YUV422 (2x1 subsampled Cb (1) and Cr (2) planes).
427 #define TBM_FORMAT_YUV422 __tbm_fourcc_code('Y', 'U', '1', '6')
429 * @brief Definition for the TBM surface format YVU422 (2x1 subsampled Cr (1) and Cb (2) planes).
432 #define TBM_FORMAT_YVU422 __tbm_fourcc_code('Y', 'V', '1', '6')
434 * @brief Definition for the TBM surface format YUV444 (non-subsampled Cb (1) and Cr (2) planes).
437 #define TBM_FORMAT_YUV444 __tbm_fourcc_code('Y', 'U', '2', '4')
439 * @brief Definition for the TBM surface format YVU444 (non-subsampled Cr (1) and Cb (2) planes).
442 #define TBM_FORMAT_YVU444 __tbm_fourcc_code('Y', 'V', '2', '4')
449 * @brief Queries surface format list and number of format supported by the system.
452 * @remarks You must release the formats using free().
454 * @param[out] formats The format array which the system can support \n
455 * This pointer has to be freed by user.
456 * @param[out] num The number of formats
458 * @return #TBM_SURFACE_ERROR_NONE if this function succeeds,
459 * otherwise an error status value
461 * @retval #TBM_SURFACE_ERROR_NONE Success
462 * @retval #TBM_SURFACE_ERROR_INVALID_OPERATION Invalid operation
466 #include <tbm_surface.h>
472 if (tbm_surface_query_formats (&formats, &format_num))
474 for( i = 0 ; i < format_num ; i++)
476 if (formats[i] == TBM_FORMAT_RGB332)
484 int tbm_surface_query_formats (uint32_t **formats, uint32_t *num);
487 * @brief Creates the tbm_surface.
488 * @details This function creates the tbm_surface with the given width, height, and format.
492 * @remark The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
494 * @param[in] width The width of surface
495 * @param[in] height The height of surface
496 * @param[in] format The format of surface
498 * @return #tbm_surface_h on success,
501 * @retval #tbm_surface_h The TBM surface handle
503 * @exception #TBM_SURFACE_ERROR_NONE Success
504 * @exception #TBM_SURFACE_ERROR_INVALID_PARAMETER Invalid parameter
505 * @exception #TBM_SURFACE_ERROR_INVALID_OPERATION Invalid operation
507 * @see tbm_surface_destroy()
511 #include <tbm_surface.h>
513 tbm_surface_h surface;
515 surface = tbm_surface_create (128, 128, TBM_FORMAT_RGB332);
519 tbm_surface_destroy (surface);
522 tbm_surface_h tbm_surface_create (int width, int height, tbm_format format);
525 * @brief Destroys the tbm_surface.
528 * @param[in] surface The #tbm_surface_h
530 * @return #TBM_SURFACE_ERROR_NONE on success,
531 * otherwise an error status value
533 * @retval #TBM_SURFACE_ERROR_NONE Success
534 * @retval #TBM_SURFACE_ERROR_INVALID_PARAMETER Invalid parameter
536 * @see tbm_surface_create()
540 #include <tbm_surface.h>
542 tbm_surface_h surface;
544 surface = tbm_surface_create (128, 128, TBM_FORMAT_RGB332);
548 tbm_surface_destroy (surface);
551 int tbm_surface_destroy (tbm_surface_h surface);
554 * @brief Maps the tbm_surface according to the access option.
555 * @details After mapping tbm_surface, the information of tbm_surface is assigned in #tbm_surface_info_s struct. \n
556 * The information of tbm_surface has width, height, format, bpp, size, number of planes and information of planes. \n
557 * The information of planes has stride, offset, size and pointer of plane. \n
558 * #TBM_SURF_OPTION_READ indicates access option to read. \n
559 * #TBM_SURF_OPTION_WRITE indicates access option to write.
563 * @param[in] surface The #tbm_surface_h
564 * @param[in] opt The option to access the tbm_surface
565 * @param[out] info The information of the tbm_surface
567 * @return #TBM_SURFACE_ERROR_NONE on success,
568 * otherwise an error status value
570 * @retval #TBM_SURFACE_ERROR_NONE Success
571 * @retval #TBM_SURFACE_ERROR_INVALID_PARAMETER Invalid parameter
572 * @retval #TBM_SURFACE_ERROR_INVALID_OPERATION Invalid operation
574 * @see tbm_surface_unmap();
578 #include <tbm_surface.h>
580 tbm_surface_h surface;
581 tbm_surface_info_s info;
584 surface = tbm_surface_create (128, 128, TBM_FORMAT_RGB332);
585 ret = tbm_surface_map (surface, TBM_SURF_OPTION_WRITE|TBM_SURF_OPTION_READ, &info);
589 tbm_surface_unmap (surface);
590 tbm_surface_destroy (surface);
593 int tbm_surface_map (tbm_surface_h surface, int opt, tbm_surface_info_s *info);
596 * @brief Unmaps the tbm_surface.
599 * @param[in] surface The #tbm_surface_h
601 * @return #TBM_SURFACE_ERROR_NONE on success,
602 * otherwise an error status value
604 * @retval #TBM_SURFACE_ERROR_NONE Success
605 * @retval #TBM_SURFACE_ERROR_INVALID_PARAMETER Invalid parameter
607 * @see tbm_surface_map()
611 #include <tbm_surface.h>
613 tbm_surface_h surface;
614 tbm_surface_info_s info;
617 surface = tbm_surface_create (128, 128, TBM_FORMAT_RGB332);
618 ret = tbm_surface_map (surface, TBM_SURF_OPTION_WRITE|TBM_SURF_OPTION_READ, &info);
622 tbm_surface_unmap (surface);
623 tbm_surface_destroy (surface);
626 int tbm_surface_unmap (tbm_surface_h surface);
629 * @brief Gets the information of the tbm_surface.
630 * @details The information of tbm_surface is assigned in #tbm_surface_info_s struct. \n
631 * The information of tbm_surface has width, height, format, bpp, size, number of planes and information of planes. \n
632 * The information of planes has stride, offset, size and pointer of plane.
636 * @param[in] surface The #tbm_surface_h
637 * @param[out] info The information of the tbm_surface
639 * @return #TBM_SURFACE_ERROR_NONE on success,
640 * otherwise an error status value
642 * @retval #TBM_SURFACE_ERROR_NONE Success
643 * @retval #TBM_SURFACE_ERROR_INVALID_PARAMETER Invalid parameter
644 * @retval #TBM_SURFACE_ERROR_INVALID_OPERATION Invalid operation
646 * @see tbm_surface_map()
650 #include <tbm_surface.h>
652 tbm_surface_h surface;
653 tbm_surface_info_s info;
656 surface = tbm_surface_create (128, 128, TBM_FORMAT_RGB332);
657 ret = tbm_surface_get_info (surface, &info);
661 tbm_surface_destroy (surface);
664 int tbm_surface_get_info (tbm_surface_h surface, tbm_surface_info_s *info);
667 * @brief Gets the width of the tbm_surface.
670 * @param[in] surface The #tbm_surface_h
672 * @return The width of the tbm_surface on success,
673 * otherwise an error status value
675 * @retval #TBM_SURFACE_ERROR_INVALID_PARAMETER Invalid parameter
679 #include <tbm_surface.h>
681 tbm_surface_h surface;
684 surface = tbm_surface_create (128, 128, TBM_FORMAT_RGB332);
688 width = tbm_surface_get_width (surface);
692 tbm_surface_destroy (surface);
695 int tbm_surface_get_width (tbm_surface_h surface);
698 * @brief Gets the height of the tbm_surface.
701 * @param[in] surface The #tbm_surface_h
703 * @return The height of the tbm_surface if this function succeeds,
704 * otherwise an error status value
706 * @retval #TBM_SURFACE_ERROR_INVALID_PARAMETER Invalid parameter
710 #include <tbm_surface.h>
712 tbm_surface_h surface;
715 surface = tbm_surface_create (128, 128, TBM_FORMAT_RGB332);
719 height = tbm_surface_get_height (surface);
723 tbm_surface_destroy (surface);
726 int tbm_surface_get_height (tbm_surface_h surface);
729 * @brief Gets the format of the tbm_surface.
732 * @remark The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
734 * @param[in] surface The #tbm_surface_h
736 * @return The format of the tbm_surface on success,
737 * otherwise @c 0 on failure
739 * @retval #tbm_format The format of surface
741 * @exception #TBM_SURFACE_ERROR_NONE Success
742 * @exception #TBM_SURFACE_ERROR_INVALID_PARAMETER Invalid parameter
746 #include <tbm_surface.h>
748 tbm_surface_s surface;
751 surface = tbm_surface_create (128, 128, TBM_FORMAT_RGB332);
755 format = tbm_surface_get_format (surface);
759 tbm_surface_destroy (surface);
762 tbm_format tbm_surface_get_format (tbm_surface_h surface);
772 #endif /* _TBM_SURFACE_H_ */