00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef CVD_COLOURSPACES_H
00022 #define CVD_COLOURSPACES_H
00023
00024 #include <cvd/internal/is_pod.h>
00025 #include <cvd/internal/builtin_components.h>
00026 #include <cvd/internal/pixel_traits.h>
00027
00028 namespace CVD
00029 {
00030
00034 struct bayer
00035 {
00036 unsigned char val;
00037 operator unsigned char() const {
00038 return val;
00039 }
00040 template <typename T> bayer( T in ) : val((unsigned char) in)
00041 {}
00042 bayer(void) : val(0)
00043 {}
00044 };
00045
00049 struct yuv411
00050 {
00051 unsigned char val;
00052 };
00053
00056 struct yuv422
00057 {
00058 unsigned short val;
00059 };
00060
00063 struct yuv420p
00064 {
00065 unsigned short val;
00066 };
00067
00072 struct vuy422
00073 {
00074 unsigned short val;
00075 };
00076
00077 namespace Pixel {
00078
00079
00080
00081
00082
00083 template<int LIFT> struct traits<bayer, LIFT>
00084 {
00085 typedef int wider_type;
00086 typedef float float_type;
00087 static const bool integral = true;
00088 static const bool is_signed = false;
00089 static const int bits_used = 8;
00090 static const unsigned char max_intensity=(1 << bits_used) - 1;
00091 };
00092 }
00093
00094
00095 #ifndef DOXYGEN_IGNORE_INTERNAL
00096 namespace Internal
00097 {
00098 template<> struct is_POD<bayer>
00099 {
00100 enum { is_pod = 1 };
00101 };
00102 template<> struct is_POD<yuv411>
00103 {
00104 enum { is_pod = 1 };
00105 };
00106 }
00107 #endif
00108 }
00109
00110 #endif