VideoTools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
grcolourspaceranges.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2017 Graeme Walker
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program 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
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 // ===
17 ///
18 /// \file grcolourspaceranges.h
19 ///
20 
21 #ifndef GR_COLOURSPACE_RANGES__H
22 #define GR_COLOURSPACE_RANGES__H
23 
24 #include "gdef.h"
25 
26 namespace Gr
27 {
28 namespace ColourSpace
29 {
30 
31 /// \class Gr::ColourSpace::range_y
32 /// Defines the "digital" range for y component. This is [16..235],
33 /// so having a size of 219.
34 ///
35 struct range_y
36 {
37  typedef unsigned char value_type ;
38  static g__constexpr value_type min = 16 ; // black
39  static g__constexpr value_type max = 235 ; // white
40  static g__constexpr bool is_signed = 0 ;
41 } ;
42 
43 /// \class Gr::ColourSpace::range_uv
44 /// Defines the "digital" range for u/v components. This is [16..240],
45 /// so having a size of 224.
46 ///
47 struct range_uv
48 {
49  typedef unsigned char value_type ;
50  static g__constexpr value_type min = 16 ;
51  static g__constexpr value_type max = 240 ;
52  static g__constexpr bool is_signed = 1 ;
53 } ;
54 
55 /// \class Gr::ColourSpace::range_rgb
56 /// Defines the "digital" range for r/g/b components.
57 /// This is [0..255], so having a size of 255.
58 ///
59 /// range for rgb components (0..255)
60 struct range_rgb
61 {
62  typedef unsigned char value_type ;
63  static g__constexpr value_type min = 0 ;
64  static g__constexpr value_type max = 255 ;
65  static g__constexpr bool is_signed = 0 ;
66 } ;
67 
68 }
69 }
70 
71 #endif
Defines the "digital" range for y component.
Defines the "digital" range for u/v components.
Defines the "digital" range for r/g/b components.