orca-robotics INTRODUCTION Overview Download and Install Documentation REPOSITORY Interfaces Drivers Libraries Utilities Software Map DEVELOPER Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
imageutils.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2008 Alex Brooks, Ben Upcroft 00005 * 00006 * This copy of Orca is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 00011 #ifndef ORCA_IMAGE_IMAGEUTILS_H 00012 #define ORCA_IMAGE_IMAGEUTILS_H 00013 00014 #include <hydroimage/imageformats.h> 00015 00016 namespace hydroimage { 00017 00018 // enumerations taken from libdc1394/dc1394_control.h 00019 00020 /* Enumeration of camera framerates */ 00021 enum 00022 { 00023 FRAMERATE_1_875= 32, 00024 FRAMERATE_3_75, 00025 FRAMERATE_7_5, 00026 FRAMERATE_15, 00027 FRAMERATE_30, 00028 FRAMERATE_60, 00029 FRAMERATE_120, 00030 FRAMERATE_240 00031 }; 00032 #define FRAMERATE_MIN FRAMERATE_1_875 00033 #define FRAMERATE_MAX FRAMERATE_240 00034 #define NUM_FRAMERATES (FRAMERATE_MAX - FRAMERATE_MIN + 1) 00035 00036 /* Enumeration of camera modes for Format_0 */ 00037 enum 00038 { 00039 MODE_160x120_YUV444= 64, 00040 MODE_320x240_YUV422, 00041 MODE_640x480_YUV411, 00042 MODE_640x480_YUV422, 00043 MODE_640x480_RGB, 00044 MODE_640x480_MONO, 00045 MODE_640x480_MONO16 00046 }; 00047 #define MODE_FORMAT0_MIN MODE_160x120_YUV444 00048 #define MODE_FORMAT0_MAX MODE_640x480_MONO16 00049 #define NUM_FORMAT0_MODES (MODE_FORMAT0_MAX - MODE_FORMAT0_MIN + 1) 00050 00051 /* Enumeration of camera modes for Format_1 */ 00052 enum 00053 { 00054 MODE_800x600_YUV422= 96, 00055 MODE_800x600_RGB, 00056 MODE_800x600_MONO, 00057 MODE_1024x768_YUV422, 00058 MODE_1024x768_RGB, 00059 MODE_1024x768_MONO, 00060 MODE_800x600_MONO16, 00061 MODE_1024x768_MONO16 00062 }; 00063 #define MODE_FORMAT1_MIN MODE_800x600_YUV422 00064 #define MODE_FORMAT1_MAX MODE_1024x768_MONO16 00065 #define NUM_FORMAT1_MODES (MODE_FORMAT1_MAX - MODE_FORMAT1_MIN + 1) 00066 00067 00068 /* Enumeration of camera modes for Format_2 */ 00069 enum 00070 { 00071 MODE_1280x960_YUV422= 128, 00072 MODE_1280x960_RGB, 00073 MODE_1280x960_MONO, 00074 MODE_1600x1200_YUV422, 00075 MODE_1600x1200_RGB, 00076 MODE_1600x1200_MONO, 00077 MODE_1280x960_MONO16, 00078 MODE_1600x1200_MONO16 00079 }; 00080 #define MODE_FORMAT2_MIN MODE_1280x960_YUV422 00081 #define MODE_FORMAT2_MAX MODE_1600x1200_MONO16 00082 #define NUM_FORMAT2_MODES (MODE_FORMAT2_MAX - MODE_FORMAT2_MIN + 1) 00083 00084 /* Enumeration of camera modes for Format_6 */ 00085 enum 00086 { 00087 MODE_EXIF= 256 00088 }; 00089 #define MODE_FORMAT6_MIN MODE_EXIF 00090 #define MODE_FORMAT6_MAX MODE_EXIF 00091 #define NUM_FORMAT6_MODES (MODE_FORMAT6_MAX - MODE_FORMAT6_MIN + 1) 00092 00093 /* Enumeration of camera modes for Format_7 */ 00094 enum { 00095 MODE_FORMAT7_0= 288, 00096 MODE_FORMAT7_1, 00097 MODE_FORMAT7_2, 00098 MODE_FORMAT7_3, 00099 MODE_FORMAT7_4, 00100 MODE_FORMAT7_5, 00101 MODE_FORMAT7_6, 00102 MODE_FORMAT7_7 00103 }; 00104 #define MODE_FORMAT7_MIN MODE_FORMAT7_0 00105 #define MODE_FORMAT7_MAX MODE_FORMAT7_7 00106 #define NUM_MODE_FORMAT7 (MODE_FORMAT7_MAX - MODE_FORMAT7_MIN + 1) 00107 00108 /* Enumeration of Format_7 color modes */ 00109 enum { 00110 COLOR_FORMAT7_MONO8= 320, 00111 COLOR_FORMAT7_YUV411, 00112 COLOR_FORMAT7_YUV422, 00113 COLOR_FORMAT7_YUV444, 00114 COLOR_FORMAT7_RGB8, 00115 COLOR_FORMAT7_MONO16, 00116 COLOR_FORMAT7_RGB16, 00117 COLOR_FORMAT7_MONO16S, 00118 COLOR_FORMAT7_RGB16S, 00119 COLOR_FORMAT7_RAW8, 00120 COLOR_FORMAT7_RAW16 00121 }; 00122 #define COLOR_FORMAT7_MIN COLOR_FORMAT7_MONO8 00123 #define COLOR_FORMAT7_MAX COLOR_FORMAT7_RAW16 00124 #define NUM_COLOR_FORMAT7 (COLOR_FORMAT7_MAX - COLOR_FORMAT7_MIN + 1) 00125 00126 00127 00128 // convert from dc_1394 colour mode to orca colour mode 00129 ImageFormat hydroImageMode( int mode ); 00130 // convert from orca colour mode to dc_1394 colour mode 00131 int dc1394ImageMode( ImageFormat mode, int width, int height ); 00132 00133 // number of channels used to store the image 00134 int numChannels( const ImageFormat& format ); 00135 00136 } // namespace 00137 00138 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)