| 1 | // Generated by gmmproc 2.50.1 -- DO NOT MODIFY! |
| 2 | #ifndef _GSTREAMERMM_VIDEOCHROMA_H |
| 3 | #define _GSTREAMERMM_VIDEOCHROMA_H |
| 4 | |
| 5 | |
| 6 | #include <glibmm/ustring.h> |
| 7 | #include <sigc++/sigc++.h> |
| 8 | |
| 9 | /* gstreamermm - a C++ wrapper for gstreamer |
| 10 | * |
| 11 | * Copyright 2008-2015 The gstreamermm Development Team |
| 12 | * |
| 13 | * This library is free software; you can redistribute it and/or |
| 14 | * modify it under the terms of the GNU Lesser General Public |
| 15 | * License as published by the Free Software Foundation; either |
| 16 | * version 2.1 of the License, or (at your option) any later version. |
| 17 | * |
| 18 | * This library is distributed in the hope that it will be useful, |
| 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 21 | * Lesser General Public License for more details. |
| 22 | * |
| 23 | * You should have received a copy of the GNU Lesser General Public |
| 24 | * License along with this library; if not, write to the Free |
| 25 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 26 | */ |
| 27 | |
| 28 | #include <gst/video/video-chroma.h> |
| 29 | |
| 30 | |
| 31 | namespace Gst |
| 32 | { |
| 33 | /** @addtogroup gstreamermmEnums gstreamermm Enums and Flags */ |
| 34 | |
| 35 | /** |
| 36 | * @var VideoChromaSite VIDEO_CHROMA_SITE_UNKNOWN |
| 37 | * Unknown cositing. |
| 38 | * |
| 39 | * @var VideoChromaSite VIDEO_CHROMA_SITE_NONE |
| 40 | * No cositing. |
| 41 | * |
| 42 | * @var VideoChromaSite VIDEO_CHROMA_SITE_H_COSITED |
| 43 | * Chroma is horizontally cosited. |
| 44 | * |
| 45 | * @var VideoChromaSite VIDEO_CHROMA_SITE_V_COSITED |
| 46 | * Chroma is vertically cosited. |
| 47 | * |
| 48 | * @var VideoChromaSite VIDEO_CHROMA_SITE_ALT_LINE |
| 49 | * Choma samples are sited on alternate lines. |
| 50 | * |
| 51 | * @var VideoChromaSite VIDEO_CHROMA_SITE_COSITED |
| 52 | * Chroma samples cosited with luma samples. |
| 53 | * |
| 54 | * @var VideoChromaSite VIDEO_CHROMA_SITE_JPEG |
| 55 | * Jpeg style cositing, also for mpeg1 and mjpeg. |
| 56 | * |
| 57 | * @var VideoChromaSite VIDEO_CHROMA_SITE_MPEG2 |
| 58 | * Mpeg2 style cositing. |
| 59 | * |
| 60 | * @var VideoChromaSite VIDEO_CHROMA_SITE_DV |
| 61 | * DV style cositing. |
| 62 | * |
| 63 | * @enum VideoChromaSite |
| 64 | * |
| 65 | * Various Chroma sitings. |
| 66 | * |
| 67 | * @ingroup gstreamermmEnums |
| 68 | * @par Bitwise operators: |
| 69 | * <tt>%VideoChromaSite operator|(VideoChromaSite, VideoChromaSite)</tt><br> |
| 70 | * <tt>%VideoChromaSite operator&(VideoChromaSite, VideoChromaSite)</tt><br> |
| 71 | * <tt>%VideoChromaSite operator^(VideoChromaSite, VideoChromaSite)</tt><br> |
| 72 | * <tt>%VideoChromaSite operator~(VideoChromaSite)</tt><br> |
| 73 | * <tt>%VideoChromaSite& operator|=(VideoChromaSite&, VideoChromaSite)</tt><br> |
| 74 | * <tt>%VideoChromaSite& operator&=(VideoChromaSite&, VideoChromaSite)</tt><br> |
| 75 | * <tt>%VideoChromaSite& operator^=(VideoChromaSite&, VideoChromaSite)</tt><br> |
| 76 | */ |
| 77 | enum VideoChromaSite |
| 78 | { |
| 79 | VIDEO_CHROMA_SITE_UNKNOWN = 0x0, |
| 80 | VIDEO_CHROMA_SITE_NONE = (1 << 0), |
| 81 | VIDEO_CHROMA_SITE_H_COSITED = (1 << 1), |
| 82 | VIDEO_CHROMA_SITE_V_COSITED = (1 << 2), |
| 83 | VIDEO_CHROMA_SITE_ALT_LINE = (1 << 3), |
| 84 | VIDEO_CHROMA_SITE_COSITED = 0x6, |
| 85 | VIDEO_CHROMA_SITE_JPEG = 0x1, |
| 86 | VIDEO_CHROMA_SITE_MPEG2 = 0x2, |
| 87 | VIDEO_CHROMA_SITE_DV = 0xE |
| 88 | }; |
| 89 | |
| 90 | /** @ingroup gstreamermmEnums */ |
| 91 | inline VideoChromaSite operator|(VideoChromaSite lhs, VideoChromaSite rhs) |
| 92 | { return static_cast<VideoChromaSite>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); } |
| 93 | |
| 94 | /** @ingroup gstreamermmEnums */ |
| 95 | inline VideoChromaSite operator&(VideoChromaSite lhs, VideoChromaSite rhs) |
| 96 | { return static_cast<VideoChromaSite>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); } |
| 97 | |
| 98 | /** @ingroup gstreamermmEnums */ |
| 99 | inline VideoChromaSite operator^(VideoChromaSite lhs, VideoChromaSite rhs) |
| 100 | { return static_cast<VideoChromaSite>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); } |
| 101 | |
| 102 | /** @ingroup gstreamermmEnums */ |
| 103 | inline VideoChromaSite operator~(VideoChromaSite flags) |
| 104 | { return static_cast<VideoChromaSite>(~static_cast<unsigned>(flags)); } |
| 105 | |
| 106 | /** @ingroup gstreamermmEnums */ |
| 107 | inline VideoChromaSite& operator|=(VideoChromaSite& lhs, VideoChromaSite rhs) |
| 108 | { return (lhs = static_cast<VideoChromaSite>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); } |
| 109 | |
| 110 | /** @ingroup gstreamermmEnums */ |
| 111 | inline VideoChromaSite& operator&=(VideoChromaSite& lhs, VideoChromaSite rhs) |
| 112 | { return (lhs = static_cast<VideoChromaSite>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); } |
| 113 | |
| 114 | /** @ingroup gstreamermmEnums */ |
| 115 | inline VideoChromaSite& operator^=(VideoChromaSite& lhs, VideoChromaSite rhs) |
| 116 | { return (lhs = static_cast<VideoChromaSite>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); } |
| 117 | |
| 118 | } // namespace Gst |
| 119 | |
| 120 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 121 | namespace Glib |
| 122 | { |
| 123 | |
| 124 | template <> |
| 125 | class Value<Gst::VideoChromaSite> : public Glib::Value_Flags<Gst::VideoChromaSite> |
| 126 | { |
| 127 | public: |
| 128 | static GType value_type() G_GNUC_CONST; |
| 129 | }; |
| 130 | |
| 131 | } // namespace Glib |
| 132 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 133 | |
| 134 | namespace Gst |
| 135 | { |
| 136 | |
| 137 | /** |
| 138 | * @var VideoChromaMethod VIDEO_CHROMA_METHOD_NEAREST |
| 139 | * Duplicates the chroma samples when |
| 140 | * upsampling and drops when subsampling. |
| 141 | * |
| 142 | * @var VideoChromaMethod VIDEO_CHROMA_METHOD_LINEAR |
| 143 | * Uses linear interpolation to reconstruct |
| 144 | * missing chroma and averaging to subsample. |
| 145 | * |
| 146 | * @enum VideoChromaMethod |
| 147 | * |
| 148 | * Different subsampling and upsampling methods |
| 149 | * |
| 150 | * @ingroup gstreamermmEnums |
| 151 | */ |
| 152 | enum VideoChromaMethod |
| 153 | { |
| 154 | VIDEO_CHROMA_METHOD_NEAREST, |
| 155 | VIDEO_CHROMA_METHOD_LINEAR |
| 156 | }; |
| 157 | |
| 158 | } // namespace Gst |
| 159 | |
| 160 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 161 | namespace Glib |
| 162 | { |
| 163 | |
| 164 | template <> |
| 165 | class Value<Gst::VideoChromaMethod> : public Glib::Value_Enum<Gst::VideoChromaMethod> |
| 166 | { |
| 167 | public: |
| 168 | static GType value_type() G_GNUC_CONST; |
| 169 | }; |
| 170 | |
| 171 | } // namespace Glib |
| 172 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 173 | |
| 174 | namespace Gst |
| 175 | { |
| 176 | |
| 177 | /** |
| 178 | * @var VideoChromaFlags VIDEO_CHROMA_FLAG_NONE |
| 179 | * No flags. |
| 180 | * |
| 181 | * @var VideoChromaFlags VIDEO_CHROMA_FLAG_INTERLACED |
| 182 | * The input is interlaced. |
| 183 | * |
| 184 | * @enum VideoChromaFlags |
| 185 | * |
| 186 | * Extra flags that influence the result from gst_video_chroma_resample_new(). |
| 187 | * |
| 188 | * @ingroup gstreamermmEnums |
| 189 | * @par Bitwise operators: |
| 190 | * <tt>%VideoChromaFlags operator|(VideoChromaFlags, VideoChromaFlags)</tt><br> |
| 191 | * <tt>%VideoChromaFlags operator&(VideoChromaFlags, VideoChromaFlags)</tt><br> |
| 192 | * <tt>%VideoChromaFlags operator^(VideoChromaFlags, VideoChromaFlags)</tt><br> |
| 193 | * <tt>%VideoChromaFlags operator~(VideoChromaFlags)</tt><br> |
| 194 | * <tt>%VideoChromaFlags& operator|=(VideoChromaFlags&, VideoChromaFlags)</tt><br> |
| 195 | * <tt>%VideoChromaFlags& operator&=(VideoChromaFlags&, VideoChromaFlags)</tt><br> |
| 196 | * <tt>%VideoChromaFlags& operator^=(VideoChromaFlags&, VideoChromaFlags)</tt><br> |
| 197 | */ |
| 198 | enum VideoChromaFlags |
| 199 | { |
| 200 | VIDEO_CHROMA_FLAG_NONE = 0x0, |
| 201 | VIDEO_CHROMA_FLAG_INTERLACED = (1 << 0) |
| 202 | }; |
| 203 | |
| 204 | /** @ingroup gstreamermmEnums */ |
| 205 | inline VideoChromaFlags operator|(VideoChromaFlags lhs, VideoChromaFlags rhs) |
| 206 | { return static_cast<VideoChromaFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); } |
| 207 | |
| 208 | /** @ingroup gstreamermmEnums */ |
| 209 | inline VideoChromaFlags operator&(VideoChromaFlags lhs, VideoChromaFlags rhs) |
| 210 | { return static_cast<VideoChromaFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); } |
| 211 | |
| 212 | /** @ingroup gstreamermmEnums */ |
| 213 | inline VideoChromaFlags operator^(VideoChromaFlags lhs, VideoChromaFlags rhs) |
| 214 | { return static_cast<VideoChromaFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); } |
| 215 | |
| 216 | /** @ingroup gstreamermmEnums */ |
| 217 | inline VideoChromaFlags operator~(VideoChromaFlags flags) |
| 218 | { return static_cast<VideoChromaFlags>(~static_cast<unsigned>(flags)); } |
| 219 | |
| 220 | /** @ingroup gstreamermmEnums */ |
| 221 | inline VideoChromaFlags& operator|=(VideoChromaFlags& lhs, VideoChromaFlags rhs) |
| 222 | { return (lhs = static_cast<VideoChromaFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); } |
| 223 | |
| 224 | /** @ingroup gstreamermmEnums */ |
| 225 | inline VideoChromaFlags& operator&=(VideoChromaFlags& lhs, VideoChromaFlags rhs) |
| 226 | { return (lhs = static_cast<VideoChromaFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); } |
| 227 | |
| 228 | /** @ingroup gstreamermmEnums */ |
| 229 | inline VideoChromaFlags& operator^=(VideoChromaFlags& lhs, VideoChromaFlags rhs) |
| 230 | { return (lhs = static_cast<VideoChromaFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); } |
| 231 | |
| 232 | } // namespace Gst |
| 233 | |
| 234 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 235 | namespace Glib |
| 236 | { |
| 237 | |
| 238 | template <> |
| 239 | class Value<Gst::VideoChromaFlags> : public Glib::Value_Flags<Gst::VideoChromaFlags> |
| 240 | { |
| 241 | public: |
| 242 | static GType value_type() G_GNUC_CONST; |
| 243 | }; |
| 244 | |
| 245 | } // namespace Glib |
| 246 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 247 | |
| 248 | namespace Gst |
| 249 | { |
| 250 | |
| 251 | } |
| 252 | |
| 253 | #include <gstreamermm/videoformat.h> |
| 254 | |
| 255 | namespace Gst |
| 256 | { |
| 257 | |
| 258 | namespace Enums |
| 259 | { |
| 260 | /** Converts @a site to its string representation. |
| 261 | * @param site A Gst::VideoChromaSite. |
| 262 | * @return a string describing @a site. |
| 263 | */ |
| 264 | Glib::ustring get_name(VideoChromaSite site); |
| 265 | |
| 266 | /** Convert @a s to a Gst::VideoChromaSite. |
| 267 | * @param s A chromasite string. |
| 268 | * @return A Gst::VideoChromaSite or Gst::VIDEO_CHROMA_SITE_UNKNOWN when @a s does |
| 269 | * not contain a valid chroma description. |
| 270 | */ |
| 271 | VideoChromaSite video_chroma_site_from_string(const Glib::ustring& s); |
| 272 | } |
| 273 | |
| 274 | class VideoChromaResample |
| 275 | { |
| 276 | public: |
| 277 | #ifndef DOXYGEN_SHOULD_SKIP_THIS |
| 278 | using CppObjectType = VideoChromaResample; |
| 279 | using BaseObjectType = GstVideoChromaResample; |
| 280 | #endif /* DOXYGEN_SHOULD_SKIP_THIS */ |
| 281 | |
| 282 | private: |
| 283 | |
| 284 | public: |
| 285 | VideoChromaResample(Gst::VideoChromaMethod method, Gst::VideoChromaSite site, Gst::VideoChromaFlags flags, |
| 286 | Gst::VideoFormat format, gint h_factor, gint v_factor); |
| 287 | |
| 288 | // it takes ownership of castitem |
| 289 | explicit VideoChromaResample(GstVideoChromaResample* castitem); |
| 290 | |
| 291 | ~VideoChromaResample(); |
| 292 | |
| 293 | GstVideoChromaResample* gobj() { return gobject_; } |
| 294 | const GstVideoChromaResample* gobj() const { return gobject_; } |
| 295 | |
| 296 | |
| 297 | /** The resampler must be fed @a n_lines at a time. The first line should be |
| 298 | * at @a offset. |
| 299 | * |
| 300 | * @param n_lines The number of input lines. |
| 301 | * @param offset The first line. |
| 302 | */ |
| 303 | void get_info(guint& n_lines, gint& offset) const; |
| 304 | |
| 305 | protected: |
| 306 | GstVideoChromaResample* gobject_; |
| 307 | |
| 308 | |
| 309 | }; |
| 310 | |
| 311 | } |
| 312 | |
| 313 | |
| 314 | #endif /* _GSTREAMERMM_VIDEOCHROMA_H */ |
| 315 |