2 * Copyright (C) <2013> Wim Taymans <wim.taymans@gmail.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
20 #ifndef __GST_VIDEO_TILE_H__
21 #define __GST_VIDEO_TILE_H__
25 #include <gst/video/video-format.h>
31 * @GST_VIDEO_TILE_TYPE_INDEXED: Tiles are indexed. Use
32 * gst_video_tile_get_index () to retrieve the tile at the requested
35 * Enum value describing the most common tiling types.
39 GST_VIDEO_TILE_TYPE_INDEXED = 0
42 #define GST_VIDEO_TILE_TYPE_SHIFT (16)
43 #define GST_VIDEO_TILE_TYPE_MASK ((1 << GST_VIDEO_TILE_TYPE_SHIFT) - 1)
46 * GST_VIDEO_TILE_MAKE_MODE:
47 * @num: the mode number to create
48 * @type: the tile mode type
50 * use this macro to create new tile modes.
52 #define GST_VIDEO_TILE_MAKE_MODE(num, type) \
53 (((num) << GST_VIDEO_TILE_TYPE_SHIFT) | (GST_VIDEO_TILE_TYPE_ ##type))
56 * GST_VIDEO_TILE_MODE_TYPE:
57 * @mode: the tile mode
59 * Get the tile mode type of @mode
61 #define GST_VIDEO_TILE_MODE_TYPE(mode) ((mode) & GST_VIDEO_TILE_TYPE_MASK)
64 * GST_VIDEO_TILE_MODE_IS_INDEXED:
67 * Check if @mode is an indexed tile type
69 #define GST_VIDEO_TILE_MODE_IS_INDEXED(mode) (GST_VIDEO_TILE_MODE_TYPE(mode) == GST_VIDEO_TILE_TYPE_INDEXED)
73 * @GST_VIDEO_TILE_MODE_UNKNOWN: Unknown or unset tile mode
74 * @GST_VIDEO_TILE_MODE_ZFLIPZ_2X2: Every four adjacent blocks - two
75 * horizontally and two vertically are grouped together and are located
76 * in memory in Z or flipped Z order. In case of odd rows, the last row
77 * of blocks is arranged in linear order.
79 * Enum value describing the available tiling modes.
83 GST_VIDEO_TILE_MODE_UNKNOWN = 0,
84 GST_VIDEO_TILE_MODE_ZFLIPZ_2X2 = GST_VIDEO_TILE_MAKE_MODE (1, INDEXED),
87 guint gst_video_tile_get_index (GstVideoTileMode mode, gint x, gint y,
88 gint x_tiles, gint y_tiles);
93 #endif /* __GST_VIDEO_TILE_H__ */