2 * Copyright (C) Collabora Ltd.
3 * Author: Matthieu Bouron <matthieu.bouron@collabora.com>
4 * Copyright (C) 2015, Matthew Waters <matthew@centricular.com>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
22 #ifndef __GST_VIDEO_AFFINE_TRANSFORMATION_META_H__
23 #define __GST_VIDEO_AFFINE_TRANSFORMATION_META_H__
26 #include <gst/video/video.h>
30 #define GST_VIDEO_AFFINE_TRANSFORMATION_META_API_TYPE (gst_video_affine_transformation_meta_api_get_type())
31 #define GST_VIDEO_AFFINE_TRANSFORMATION_META_INFO (gst_video_affine_transformation_meta_get_info())
33 typedef struct _GstVideoAffineTransformationMeta GstVideoAffineTransformationMeta;
34 typedef gboolean (*GstVideoAffineTransformationGetMatrix) (GstVideoAffineTransformationMeta * meta, gfloat * matrix);
36 #define GST_CAPS_FEATURE_META_GST_VIDEO_AFFINE_TRANSFORMATION_META "meta:GstVideoAffineTransformation"
37 #define GST_BUFFER_POOL_OPTION_VIDEO_AFFINE_TRANSFORMATION_META "GstBufferPoolOptionVideoAffineTransformation"
40 * GstVideoAffineTransformationMeta:
41 * @meta: parent #GstMeta
42 * @matrix: the column-major 4x4 transformation matrix
44 * Extra buffer metadata for performing an affine transformation using a 4x4
45 * matrix. The transformation matrix can be composed with
46 * gst_video_affine_transformation_meta_apply_matrix().
48 * The vertices operated on are all in the range 0 to 1, not in
49 * Normalized Device Coordinates (-1 to +1). Transforming points in this space
50 * are assumed to have an origin at (0.5, 0.5, 0.5) in a left-handed coordinate
51 * system with the x-axis moving horizontally (positive values to the right),
52 * the y-axis moving vertically (positive values up the screen) and the z-axis
53 * perpendicular to the screen (positive values into the screen).
57 struct _GstVideoAffineTransformationMeta
65 GType gst_video_affine_transformation_meta_api_get_type (void);
68 const GstMetaInfo *gst_video_affine_transformation_meta_get_info (void);
70 #define gst_buffer_get_video_affine_transformation_meta(b) \
71 ((GstVideoAffineTransformationMeta *)gst_buffer_get_meta((b),GST_VIDEO_AFFINE_TRANSFORMATION_META_API_TYPE))
73 GstVideoAffineTransformationMeta *gst_buffer_add_video_affine_transformation_meta (GstBuffer * buffer);
76 void gst_video_affine_transformation_meta_apply_matrix (GstVideoAffineTransformationMeta * meta,
77 const gfloat matrix[16]);
81 #endif /* __GST_VIDEO_AFFINE_TRANSFORMATION_META_H__ */