]> git.sesse.net Git - casparcg/blob - core/frame/pixel_format.h
[linux] Don't overwrite thread name if it is already set.
[casparcg] / core / frame / pixel_format.h
1 /*
2 * Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
3 *
4 * This file is part of CasparCG (www.casparcg.com).
5 *
6 * CasparCG is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * CasparCG 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
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
18 *
19 * Author: Robert Nagy, ronag89@gmail.com
20 */
21
22 #pragma once
23
24 #include "../video_format.h"
25
26 #include <cstddef>
27 #include <vector>
28
29 namespace caspar { namespace core {
30                 
31 enum class pixel_format
32 {
33         gray = 0,
34         bgra,
35         rgba,
36         argb,
37         abgr,
38         ycbcr,
39         ycbcra,
40         luma,
41         bgr,
42         rgb,
43         count,
44         invalid,
45 };
46
47 struct pixel_format_desc final
48 {
49         struct plane
50         {
51                 int linesize;
52                 int width;
53                 int height;
54                 int size;
55                 int stride;
56
57                 plane() 
58                         : linesize(0)
59                         , width(0)
60                         , height(0)
61                         , size(0)
62                         , stride(0)
63                 {
64                 }
65
66                 plane(int width, int height, int stride)
67                         : linesize(width*stride)
68                         , width(width)
69                         , height(height)
70                         , size(width*height*stride)
71                         , stride(stride)
72                 {
73                 }
74         };
75
76         pixel_format_desc(pixel_format format = core::pixel_format::invalid) 
77                 : format(format)
78         {
79         }
80         
81         pixel_format            format;
82         std::vector<plane>      planes;
83 };
84
85 }}