2 #ifndef vil_checker_board_hxx_ 3 #define vil_checker_board_hxx_ 14 # include <vcl_msvc_warnings.h> 17 template<
typename DEST,
typename SRC >
24 assert( src1.
ni() == src2.
ni() && src1.
nj() == src2.
nj() &&
28 const int ni=(signed)src1.
ni();
29 const int nj=(signed)src1.
nj();
30 const int np=(signed)src1.
nplanes();
37 assert( des.
ni() == src1.
ni() && des.
nj() == src1.
nj() &&
42 if ( xsize<0 || ysize<0 )
53 for (
int i=0; i<ni; ++i )
56 int iblock = ( (i+params.
xoff_) / xsize ) % 2;
58 for (
int j=0; j<nj; ++j )
61 int jblock = ( (j+params.
yoff_) / ysize + iblock ) % 2;
64 bool p1 =
true, p2 =
true;
68 p1 =
false; p2 =
false;
69 for (
int p=0; p<np; ++p ){
77 p1 = p1 && ( src1(i, j, np-1) );
78 p2 = p2 && ( src2(i, j, np-1) );
94 for (
int p=0; p<np; ++p )
95 des(i, j, p) = src1(i, j, p);
97 for (
int p=0; p<np; ++p )
98 des(i, j, p) = src2(i, j, p);
103 #undef VIL_CHECKER_BOARD_INSTANTIATE 104 #define VIL_CHECKER_BOARD_INSTANTIATE(srcT, desT) \ 106 vil_checker_board( vil_image_view< desT >& des, \ 107 vil_image_view< srcT > const& src1, \ 108 vil_image_view< srcT > const& src2, \ 109 vil_checker_board_params const& params ) 111 #endif // vil_checker_board_hxx_
void vil_checker_board(vil_image_view< DEST > &des, vil_image_view< SRC > const &src1, vil_image_view< SRC > const &src2, vil_checker_board_params const ¶ms)
build a checker board image from two images.
Concrete view of image data of type T held in memory.
void fill(T value)
Fill view with given value.
void set_size(unsigned ni, unsigned nj) override
resize current planes to ni x nj.
unsigned ni() const
Width.
unsigned nj() const
Height.
parameters for building checkboard.
A base class reference-counting view of some image data.
unsigned nplanes() const
Number of planes.
Build checker board image from two source.