00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef __FOREARM_CAM__MT9V_H__
00036 #define __FOREARM_CAM__MT9V_H__
00037
00038 #include <stdlib.h>
00039 #include <stdint.h>
00040 #include <boost/shared_ptr.hpp>
00041 #include <wge100_camera/wge100lib.h>
00042
00043 #define MT9V_REG_WINDOW_WIDTH 0x04
00044 #define MT9V_REG_HORIZONTAL_BLANKING 0x05
00045 #define MT9V_REG_VERTICAL_BLANKING 0x06
00046 #define MT9V_REG_TOTAL_SHUTTER_WIDTH 0x0B
00047 #define MT9V_REG_ANALOG_GAIN 0x35
00048 #define MT9V_REG_AGC_AEC_ENABLE 0xAF
00049 #define MT9V_COMPANDING_MODE 0x1C
00050
00051 #define MT9V_CK_FREQ 16e6
00052
00053
00054
00055
00056 #define MT9VMODE_752x480x15b1 0
00057 #define MT9VMODE_752x480x12_5b1 1
00058 #define MT9VMODE_640x480x30b1 2
00059 #define MT9VMODE_640x480x25b1 3
00060 #define MT9VMODE_640x480x15b1 4
00061 #define MT9VMODE_640x480x12_5b1 5
00062 #define MT9VMODE_320x240x60b2 6
00063 #define MT9VMODE_320x240x50b2 7
00064 #define MT9VMODE_320x240x30b2 8
00065 #define MT9VMODE_320x240x25b2 9
00066 #define MT9V_NUM_MODES 10
00067
00068 struct MT9VMode {
00069 const char *name;
00070 size_t width;
00071 size_t height;
00072 double fps;
00073 uint16_t hblank;
00074 uint16_t vblank;
00075 };
00076
00077 extern const struct MT9VMode MT9VModes[MT9V_NUM_MODES];
00078
00079 class MT9VImager;
00080 typedef boost::shared_ptr<MT9VImager> MT9VImagerPtr;
00081
00082
00083 class MT9VImager
00084 {
00085 public:
00086 virtual bool setBrightness(int brightness) = 0;
00087 virtual bool setAgcAec(bool agc_on, bool aec_on) = 0;
00088 virtual bool setGain(int gain) = 0;
00089 virtual bool setExposure(double exposure) = 0;
00090 virtual bool setMaxExposure(double exposure) = 0;
00091 virtual bool setMirror(bool mirrorx, bool mirrory) = 0;
00092 virtual bool setMode(int x, int y, int binx, int biny, double rate, int xoffset, int yoffset) = 0;
00093 virtual bool setCompanding(bool activated) = 0;
00094 virtual MT9VImagerPtr getAlternateContext() = 0;
00095 virtual bool setBlackLevel(bool manual_override, int calibration_value, int step_size, int filter_length) = 0;
00096 virtual std::string getModel() = 0;
00097 virtual uint16_t getVersion() = 0;
00098
00099 static MT9VImagerPtr getInstance(IpCamList &cam);
00100 };
00101
00102 #endif