core/vil/algo/vil_checker_board.h
Go to the documentation of this file.
00001 // This is core/vil/algo/vil_checker_board.h
00002 #ifndef vil_checker_board_h_
00003 #define vil_checker_board_h_
00004 //:
00005 // \file
00006 // \brief Build checker board image from two source
00007 // \author Gehua Yang
00008 
00009 #include <vil/vil_fwd.h>
00010 
00011 //: parameters for building checkboard
00012 class vil_checker_board_params
00013 {
00014  private:
00015   int xsize_, ysize_;
00016   int xnum_blks_, ynum_blks_;
00017   int xoff_, yoff_;
00018   bool use_alpha_plane_;
00019   bool not_use_color_flag_;
00020   int  not_use_color_;
00021  public:
00022   vil_checker_board_params()
00023   : xsize_(-1), ysize_(-1), xnum_blks_(0), ynum_blks_(0),
00024     xoff_(0), yoff_(0),
00025     use_alpha_plane_(false),
00026     not_use_color_flag_(false), not_use_color_(0)
00027   {
00028   }
00029 
00030   vil_checker_board_params( int xsize, int ysize )
00031   : xsize_(xsize), ysize_(ysize), xnum_blks_(0), ynum_blks_(0),
00032     xoff_(0), yoff_(0),
00033     use_alpha_plane_(false),
00034     not_use_color_flag_(false), not_use_color_(0)
00035   {
00036   }
00037 
00038   void set_offset( int xoff, int yoff )
00039   { xoff_=xoff;  yoff_=yoff; }
00040 
00041   void use_alpha_plane( bool use )
00042   { use_alpha_plane_ = use; }
00043 
00044   void not_use_color( int c )
00045   { not_use_color_ = c;  not_use_color_flag_ = true; }
00046 
00047   template< typename DEST, typename SRC >
00048   friend
00049   void
00050   vil_checker_board( vil_image_view< DEST >& des,
00051                      vil_image_view< SRC > const& src1,
00052                      vil_image_view< SRC > const& src2,
00053                      vil_checker_board_params const& params );
00054 };
00055 
00056 
00057 //: build a checker board image from two images
00058 //  \param params specify the block size/offset, transparency
00059 template< typename DEST, typename SRC >
00060 void
00061 vil_checker_board( vil_image_view< DEST >& des,
00062                    vil_image_view< SRC > const& src1,
00063                    vil_image_view< SRC > const& src2,
00064                    vil_checker_board_params const& params );
00065 
00066 
00067 #endif // vil_checker_board_h_