00001
00002 #ifndef vidl2_v4l_params_h_
00003 #define vidl2_v4l_params_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "vidl2_pixel_format.h"
00020 #include <linux/videodev.h>
00021
00022
00023
00024 struct vidl2_v4l_params
00025 {
00026
00027 static int vidl2pf_to_v4lpf(vidl2_pixel_format vid_pf);
00028
00029
00030 static vidl2_pixel_format v4lpf_to_vidl2pf(int v4l_pf);
00031
00032
00033 vidl2_v4l_params(): ni_(320), nj_(240), brightness_(31744), hue_(65535),
00034 colour_(32768), contrast_(32768), whiteness_(49152),
00035 depth_(24), pixel_format_(VIDL2_PIXEL_FORMAT_YUV_420P)
00036 {};
00037
00038
00039 vidl2_v4l_params& resolution(unsigned int ni, unsigned int nj){
00040 ni_=ni;nj_=nj;
00041 return *this;
00042 };
00043
00044
00045 vidl2_v4l_params& brightness(int brightness){
00046 brightness_=brightness;
00047 return *this;
00048 };
00049
00050
00051 vidl2_v4l_params& hue(int hue){
00052 hue_=hue;
00053 return *this;
00054 };
00055
00056
00057 vidl2_v4l_params& colour(int colour){
00058 colour_=colour;
00059 return *this;
00060 };
00061
00062
00063 vidl2_v4l_params& contrast(int contrast){
00064 contrast_=contrast;
00065 return *this;
00066 };
00067
00068
00069 vidl2_v4l_params& whiteness(int whiteness){
00070 whiteness_=whiteness;
00071 return *this;
00072 };
00073
00074
00075 vidl2_v4l_params& depth(int depth){
00076 depth_=depth;
00077 return *this;
00078 };
00079
00080
00081 vidl2_v4l_params& pixel_format(vidl2_pixel_format pf){
00082 pixel_format_=pf;
00083 return *this;
00084 };
00085
00086 unsigned int ni_, nj_;
00087 int brightness_;
00088 int hue_;
00089 int colour_;
00090 int contrast_;
00091 int whiteness_;
00092 int depth_;
00093 vidl2_pixel_format pixel_format_;
00094 };
00095
00096 #endif