camera_image.cc
Go to the documentation of this file.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 #include "claraty/camera_image.h"
00026 #include <iostream>
00027 #include <sstream>
00028
00029 #include "claraty/fdm_parse_tree.h"
00030
00031
00032 using namespace std;
00033
00034 namespace claraty {
00035
00036 class Camera_Model {
00037 Camera_Model() {};
00038 Camera_Model(Camera_Model * m) {};
00039 int model;
00040 };
00041
00042
00043
00044 Camera_Image_Properties::Property::
00045 Property(float val, float min_val, float max_val, Mode m) :
00046 value(val),
00047 min_value(min_val),
00048 max_value(max_val),
00049 mode(m)
00050 {
00051 }
00052
00053
00054 bool Camera_Image_Properties::Property::
00055 io(FDM_Map map)
00056 {
00057 bool ok = true;
00058 ok &= map.field("value", value);
00059 ok &= map.field("min_value", min_value);
00060 ok &= map.field("max_value", max_value);
00061
00062
00063
00064
00065
00066
00067
00068
00069 return ok;
00070 }
00071
00072
00073
00074
00075
00076 Camera_Image_Properties::
00077 Camera_Image_Properties() :
00078 brightness ( Property () ),
00079 contrast ( Property () ),
00080 exposure ( Property () ),
00081 iris ( Property (0.0, 0.0, 1.0 ) ),
00082 focus ( Property (0.0, 0.0, 0.016) ),
00083 temperature (0.0),
00084 frame_num (0),
00085 camera_name ("def_camera"),
00086 filter_color("clear")
00087 {}
00088
00089
00090
00091 bool Camera_Image_Properties::
00092 io(FDM_Map map)
00093 {
00094 bool ok = true;
00095 ok &= map.field("brightness", brightness);
00096 ok &= map.field("contrast", contrast);
00097 ok &= map.field("exposure", exposure);
00098 ok &= map.field("iris", iris);
00099 ok &= map.field("focus", focus);
00100 ok &= map.field("temperature", temperature);
00101 ok &= map.field("frame_num", frame_num);
00102 ok &= map.field("camera_name", camera_name);
00103 ok &= map.field("filter_color",filter_color);
00104 return ok;
00105 }
00106
00107
00108
00109
00110 ostream &
00111 operator << (ostream & os, const Camera_Image_Properties & rhs)
00112 {
00113 FDM_Parse_Tree::write_object(rhs, os);
00114 return os;
00115 }
00116
00117
00118
00119 istream &
00120 operator >> (istream & is, Camera_Image_Properties & rhs)
00121 {
00122 FDM_Parse_Tree::read_object(rhs, is);
00123 return is;
00124 }
00125
00126
00127
00128 }
00129