00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef CVD_INCLUDE_COLOURSPACE_CONVERT_H
00022 #define CVD_INCLUDE_COLOURSPACE_CONVERT_H
00023 #include <cvd/image_convert_fwd.h>
00024 #include <cvd/colourspaces.h>
00025 #include <cvd/byte.h>
00026 #include <cvd/rgb.h>
00027 #include <cvd/image_convert.h>
00028
00029
00030 namespace CVD
00031 {
00032
00037 template<> void convert_image(const BasicImage<bayer_bggr>& from, BasicImage<byte>& to);
00038 template<> void convert_image(const BasicImage<bayer_grbg>& from, BasicImage<byte>& to);
00039 template<> void convert_image(const BasicImage<bayer_gbrg>& from, BasicImage<byte>& to);
00040 template<> void convert_image(const BasicImage<bayer_rggb>& from, BasicImage<byte>& to);
00041
00046 template<> void convert_image(const BasicImage<bayer_bggr>& from, BasicImage<Rgb<byte> >& to);
00047 template<> void convert_image(const BasicImage<bayer_grbg>& from, BasicImage<Rgb<byte> >& to);
00048 template<> void convert_image(const BasicImage<bayer_gbrg>& from, BasicImage<Rgb<byte> >& to);
00049 template<> void convert_image(const BasicImage<bayer_rggb>& from, BasicImage<Rgb<byte> >& to);
00050
00055 template<> void convert_image(const BasicImage<bayer_bggr16>& from, BasicImage<unsigned short>& to);
00056 template<> void convert_image(const BasicImage<bayer_grbg16>& from, BasicImage<unsigned short>& to);
00057 template<> void convert_image(const BasicImage<bayer_gbrg16>& from, BasicImage<unsigned short>& to);
00058 template<> void convert_image(const BasicImage<bayer_rggb16>& from, BasicImage<unsigned short>& to);
00059
00064 template<> void convert_image(const BasicImage<bayer_bggr16>& from, BasicImage<Rgb<unsigned short> >& to);
00065 template<> void convert_image(const BasicImage<bayer_grbg16>& from, BasicImage<Rgb<unsigned short> >& to);
00066 template<> void convert_image(const BasicImage<bayer_gbrg16>& from, BasicImage<Rgb<unsigned short> >& to);
00067 template<> void convert_image(const BasicImage<bayer_rggb16>& from, BasicImage<Rgb<unsigned short> >& to);
00068
00073 template<> void convert_image(const BasicImage<bayer_bggr16be>& from, BasicImage<unsigned short>& to);
00074 template<> void convert_image(const BasicImage<bayer_grbg16be>& from, BasicImage<unsigned short>& to);
00075 template<> void convert_image(const BasicImage<bayer_gbrg16be>& from, BasicImage<unsigned short>& to);
00076 template<> void convert_image(const BasicImage<bayer_rggb16be>& from, BasicImage<unsigned short>& to);
00077
00082 template<> void convert_image(const BasicImage<bayer_bggr16be>& from, BasicImage<Rgb<unsigned short> >& to);
00083 template<> void convert_image(const BasicImage<bayer_grbg16be>& from, BasicImage<Rgb<unsigned short> >& to);
00084 template<> void convert_image(const BasicImage<bayer_gbrg16be>& from, BasicImage<Rgb<unsigned short> >& to);
00085 template<> void convert_image(const BasicImage<bayer_rggb16be>& from, BasicImage<Rgb<unsigned short> >& to);
00086
00091 template<> void convert_image(const BasicImage<yuv411>& from, BasicImage<Rgb<byte> >& to);
00092
00093
00098 template<> void convert_image(const BasicImage<yuv411>& from, BasicImage<byte>& to);
00099
00104 template<> void convert_image(const BasicImage<yuv422>& from, BasicImage<Rgb<byte> >& to);
00105
00106
00111 template<> void convert_image(const BasicImage<yuv422>& from, BasicImage<byte>& to);
00112
00113
00114
00115
00119 template<> std::pair<Image<byte>,Image<Rgb<byte> > > convert_image_pair(const BasicImage<yuv411>& from);
00120
00121
00126 template<> void convert_image(const BasicImage<vuy422>& from, BasicImage<Rgb<byte> >& to);
00127
00132 template<> void convert_image(const BasicImage<vuy422>& from, BasicImage<byte>& to);
00133
00134
00135 template<> struct IsConvertible<yuv411, Rgb<byte> > { static const bool is=1; };
00136 template<> struct IsConvertible<yuv411, byte> { static const bool is=1; };
00137 template<> struct IsConvertible<yuv422, Rgb<byte> > { static const bool is=1; };
00138 template<> struct IsConvertible<yuv422, byte> { static const bool is=1; };
00139 template<> struct IsConvertible<bayer_bggr, byte> { static const bool is=1; };
00140 template<> struct IsConvertible<bayer_grbg, byte> { static const bool is=1; };
00141 template<> struct IsConvertible<bayer_gbrg, byte> { static const bool is=1; };
00142 template<> struct IsConvertible<bayer_rggb, byte> { static const bool is=1; };
00143 template<> struct IsConvertible<bayer_bggr, Rgb<byte> > { static const bool is=1; };
00144 template<> struct IsConvertible<bayer_grbg, Rgb<byte> > { static const bool is=1; };
00145 template<> struct IsConvertible<bayer_gbrg, Rgb<byte> > { static const bool is=1; };
00146 template<> struct IsConvertible<bayer_rggb, Rgb<byte> > { static const bool is=1; };
00147 template<> struct IsConvertible<bayer_bggr16 ,unsigned short> { static const bool is=1; };
00148 template<> struct IsConvertible<bayer_grbg16 ,unsigned short> { static const bool is=1; };
00149 template<> struct IsConvertible<bayer_gbrg16 ,unsigned short> { static const bool is=1; };
00150 template<> struct IsConvertible<bayer_rggb16 ,unsigned short> { static const bool is=1; };
00151 template<> struct IsConvertible<bayer_bggr16 ,Rgb<unsigned short> > { static const bool is=1; };
00152 template<> struct IsConvertible<bayer_grbg16 ,Rgb<unsigned short> > { static const bool is=1; };
00153 template<> struct IsConvertible<bayer_gbrg16 ,Rgb<unsigned short> > { static const bool is=1; };
00154 template<> struct IsConvertible<bayer_rggb16 ,Rgb<unsigned short> > { static const bool is=1; };
00155 template<> struct IsConvertible<bayer_bggr16be,unsigned short> { static const bool is=1; };
00156 template<> struct IsConvertible<bayer_grbg16be,unsigned short> { static const bool is=1; };
00157 template<> struct IsConvertible<bayer_gbrg16be,unsigned short> { static const bool is=1; };
00158 template<> struct IsConvertible<bayer_rggb16be,unsigned short> { static const bool is=1; };
00159 template<> struct IsConvertible<bayer_bggr16be,Rgb<unsigned short> > { static const bool is=1; };
00160 template<> struct IsConvertible<bayer_grbg16be,Rgb<unsigned short> > { static const bool is=1; };
00161 template<> struct IsConvertible<bayer_gbrg16be,Rgb<unsigned short> > { static const bool is=1; };
00162 template<> struct IsConvertible<bayer_rggb16be,Rgb<unsigned short> > { static const bool is=1; };
00163 }
00164
00165 #endif