Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

vidl2_v4l_params.h

Go to the documentation of this file.
00001 // This is brl/bbas/vidl2/vidl2_v4l_params.h
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 // \file
00009 // \brief A parameters struct for v4l1 camera streams
00010 //
00011 // \author Brendan McCane
00012 // \date 15 Mar 2006
00013 //
00014 // These parameters are described by the v4l1 API specification
00015 // http://www.linuxtv.org/downloads/video4linux/API/V4L1_API.html
00016 
00017 
00018 // not used? #include <vcl_string.h>
00019 #include "vidl2_pixel_format.h"
00020 #include <linux/videodev.h>
00021 
00022 //: A parameters struct for v4l1 camera streams
00023 
00024 struct vidl2_v4l_params
00025 {
00026     //: convert from vidl2 pixel format to v4l pixel format
00027     static int vidl2pf_to_v4lpf(vidl2_pixel_format vid_pf);
00028 
00029     //: convert from v4l pixel format to vidl2 pixel format
00030     static vidl2_pixel_format v4lpf_to_vidl2pf(int v4l_pf);
00031 
00032     //: construct with default params
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     //: get the current resolution
00039     vidl2_v4l_params& resolution(unsigned int ni, unsigned int nj){
00040         ni_=ni;nj_=nj;
00041         return *this;
00042     };
00043 
00044     //: brightness
00045     vidl2_v4l_params& brightness(int brightness){
00046         brightness_=brightness;
00047         return *this;
00048     };
00049 
00050     //: hue
00051     vidl2_v4l_params& hue(int hue){
00052         hue_=hue;
00053         return *this;
00054     };
00055 
00056     //: colour
00057     vidl2_v4l_params& colour(int colour){
00058         colour_=colour;
00059         return *this;
00060     };
00061 
00062     //: contrast
00063     vidl2_v4l_params& contrast(int contrast){
00064         contrast_=contrast;
00065         return *this;
00066     };
00067 
00068     //: whiteness
00069     vidl2_v4l_params& whiteness(int whiteness){
00070         whiteness_=whiteness;
00071         return *this;
00072     };
00073 
00074     //: depth
00075     vidl2_v4l_params& depth(int depth){
00076         depth_=depth;
00077         return *this;
00078     };
00079 
00080     //: palette
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

Generated on Thu Jan 10 14:51:32 2008 for contrib/brl/bbas/vidl2 by  doxygen 1.4.4