Urbi SDK Remote for C++  2.7.5
uconversion.hh
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2004, 2006, 2008, 2009, 2010, 2011, Gostai S.A.S.
00003  *
00004  * This software is provided "as is" without warranty of any kind,
00005  * either expressed or implied, including but not limited to the
00006  * implied warranties of fitness for a particular purpose.
00007  *
00008  * See the LICENSE file for more information.
00009  */
00010 
00013 
00014 #ifndef URBI_UCONVERSION_HH
00015 # define URBI_UCONVERSION_HH
00016 
00017 # include <urbi/export.hh>
00018 # include <urbi/uvalue.hh>
00019 
00020 namespace urbi
00021 {
00022   typedef unsigned char byte;
00023 
00025 
00033   URBI_SDK_API int
00034   convertYCrCbtoYCbCr(const byte* source, size_t sourcelen,
00035                       byte* dest);
00036 
00043   URBI_SDK_API int
00044   convertRGBtoYCbCr(const byte* source, size_t sourcelen,
00045                     byte* dest);
00046 
00052   URBI_SDK_API int
00053   convertYCbCrtoRGB(const byte* source, size_t sourcelen,
00054                     byte* dest);
00055   URBI_SDK_API int
00056   convertJPEGtoYCrCb(const byte* source, size_t sourcelen,
00057                      byte** dest, size_t& size,
00058                      size_t& w, size_t& h);
00059   URBI_SDK_API int
00060   convertJPEGtoRGB(const byte* source, size_t sourcelen,
00061                    byte** dest, size_t& size,
00062                    size_t& w, size_t& h);
00063 
00074   URBI_SDK_API int
00075   convertRGBtoJPEG(const byte* source,
00076                    size_t w, size_t h, byte* dest,
00077                    size_t& size, int quality);
00078 
00089   URBI_SDK_API int
00090   convertYCrCbtoJPEG(const byte* source,
00091                      size_t w, size_t h, byte* dest,
00092                      size_t& size, int quality);
00093 
00102   URBI_SDK_API int
00103   convertRGBtoGrey8_601(const byte* in, size_t bufferSize,
00104                         byte* out);
00105 
00106 
00107   struct wavheader
00108   {
00109     char riff[4];
00110     int length;
00111     char wave[4];
00112     char fmt[4];
00113     int lnginfo;
00114     short one;
00115     short channels;
00116     int freqechant;
00117     int bytespersec;
00118     short bytesperechant;
00119     short bitperchannel;
00120     char data[4];
00121     size_t datalength;
00122   };
00123 
00133   URBI_SDK_API int convert(const USound& source, USound& destination);
00134 
00135 
00146   URBI_SDK_API int convert(const UImage& source, UImage& destination);
00147 
00148 } // namespace urbi
00149 #endif