Urbi SDK Remote for C++  2.7.5
uimage.hh
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2007-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 
00012 #ifndef URBI_UIMAGE_HH
00013 # define URBI_UIMAGE_HH
00014 
00015 # include <libport/cstdlib>
00016 # include <urbi/export.hh>
00017 
00018 namespace urbi
00019 {
00020 
00021   /*---------------.
00022   | UImageFormat.  |
00023   `---------------*/
00024 
00025   enum UImageFormat
00026   {
00027     IMAGE_UNKNOWN = 0,
00028     IMAGE_RGB = 1,     
00029     IMAGE_YCbCr = 2,   
00030     IMAGE_YUV = 2,     
00031     IMAGE_JPEG = 3,    
00032     IMAGE_PPM = 4,     
00033     IMAGE_YUV422 = 5,  
00034     IMAGE_GREY8 = 6,   
00035     IMAGE_GREY4 = 7,   
00036     IMAGE_YUV411_PLANAR=8, 
00037     IMAGE_NV12=9,      
00038     IMAGE_YUV420_PLANAR=10, 
00039   };
00040 
00041 
00042   // Parse an image format string.
00043   URBI_SDK_API UImageFormat parse_image_format(const std::string&);
00044 
00045   // Conversion to string.
00046   URBI_SDK_API const char* format_string(UImageFormat f);
00047 
00048 
00049 
00050   /*---------.
00051   | UImage.  |
00052   `---------*/
00053 
00058   class URBI_SDK_API UImage
00059   {
00060   public:
00063     static UImage make();
00064 
00067     void init();
00068 
00070     const char* format_string() const;
00071 
00073     unsigned char* data;
00075     size_t size;
00077     size_t width, height;
00078 
00079     UImageFormat imageFormat;
00080 
00081   private:
00082     friend class UBinary;
00083     // The UBinary headers.
00084     std::string headers_() const;
00085   };
00086 
00087 } // end namespace urbi
00088 
00089 #endif // ! URBI_UIMAGE_HH