INTRODUCTION
Overview
Download and Install
Quick Start
Documentation
Publications

NONFRAMEWORK CODE
Driver Interfaces
Drivers
Libraries
Utilities

FRAMEWORK CODE
Interfaces
Components
Libraries
Utilities

Full Software Listings

DEVELOPER
Tutorials
Examples
Dev Guide
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

formats.h

00001 /*
00002  * Orca-Robotics Project: Components for robotics 
00003  *               http://orca-robotics.sf.net/
00004  * Copyright (c) 2004-2009 Tom Burdick, Alex Brooks, Alexei Makarenko, Tobias Kaupp
00005  *
00006  * This distribution is licensed to you under the terms described in
00007  * the LICENSE file included in this distribution.
00008  *
00009  */
00010 
00011 #ifndef HYDRO_IMAGE_FORMATS_H
00012 #define HYDRO_IMAGE_FORMATS_H
00013 
00014 #include <string>
00015 #include <iostream>
00016 #include <map>
00017 
00018 namespace hydroimage
00019 {
00020     
00036     class ImageFormat
00037     {
00038         public:
00039             ImageFormat();
00040             virtual ~ImageFormat() {}
00041             
00043             static ImageFormat find( const std::string& format );
00044 
00045             const std::string getFormatString();
00046             unsigned int getNumberOfChannels();
00047             unsigned int getBitsPerPixel();
00048             unsigned int getBytesPerPixel();
00049         
00050         protected:
00054             static void initialize();
00055 
00062             ImageFormat( std::string formatString, unsigned int channels, unsigned int bits, unsigned int bytes);
00064             static void add( ImageFormat formatObject );
00065 
00066         private:
00067             std::string formatString_;
00068             unsigned int channels_;
00069             unsigned int bitsPerPixel_;
00070             unsigned int bytesPerPixel_;
00072             static std::map<std::string, ImageFormat> formats_;
00073     };
00074 
00075     class BayerRG8 : public ImageFormat
00076     {
00077         public:
00078             BayerRG8() : ImageFormat("BayerRG8", 1, 8, 1) {}
00079     };
00080 
00081     class BayerGR8 : public ImageFormat
00082     {
00083         public:
00084             BayerGR8() : ImageFormat("BayerGR8", 1, 8, 1) {}
00085     };
00086 
00087     class BayerGB8 : public ImageFormat
00088     {
00089         public:
00090             BayerGB8() : ImageFormat("BayerGB8", 1, 8, 1) {}
00091     };
00092 
00093     class BayerBG8 : public ImageFormat
00094     {
00095         public:
00096             BayerBG8() : ImageFormat("BayerBG8", 1, 8, 1) {}
00097     };
00098 
00099     class RGB8 : public ImageFormat
00100     {
00101         public:
00102             RGB8() : ImageFormat("RGB8", 3, 24, 3) {}
00103     };
00104 
00105     class BGR8 : public ImageFormat
00106     {
00107         public:
00108             BGR8() : ImageFormat("BGR8", 3, 24, 3) {}
00109     };
00110 
00111     class RGBA8 : public ImageFormat
00112     {
00113         public:
00114             RGBA8() : ImageFormat("RGBA8", 4, 32, 4) {}
00115     };
00116 
00117     class BGRA8 : public ImageFormat
00118     {
00119         public:
00120             BGRA8() : ImageFormat("BGRA8", 4, 32, 4) {}
00121     };
00122 
00123     class GRAY8 : public ImageFormat
00124     {
00125         public:
00126             GRAY8() : ImageFormat("GRAY8", 1, 8, 1) {}
00127     };
00128 
00129     class RAW8 : public ImageFormat
00130     {
00131         public:
00132             RAW8() : ImageFormat("RAW8", 1, 8, 1) {}
00133     };
00134 
00135 }
00136 
00137 #endif
00138 
 

Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)


Generated for Orca Robotics by  doxygen 1.4.5