2 #ifndef vil_tile_images_h_ 3 #define vil_tile_images_h_ 13 # include <vcl_msvc_warnings.h> 27 unsigned n = patches.size();
28 unsigned nj = unsigned(std::sqrt(
float(n)));
29 unsigned ni = 1+(n-1)/nj;
31 unsigned pi = patches[0].ni();
32 unsigned pj = patches[0].nj();
33 unsigned np = patches[0].nplanes();
36 big_image.
fill(vxl_byte(0));
37 for (
unsigned k=0;k<n;++k)
39 assert(patches[k].ni()==pi && patches[k].nj()== pj &&
40 patches[k].nplanes()== np);
44 for (
unsigned y=0;y<pj;++y)
45 for (
unsigned x=0;x<pi;++x)
46 for (
unsigned p=0;p<np;++p)
47 big_image(i*pi+x,j*pj+y,p) = patches[k](x,y,p);
51 #endif // vil_tile_images_h_ void vil_tile_images(vil_image_view< T > &big_image, const std::vector< vil_image_view< T > > &patches)
Create a big image by tiling images in patches (must be of same size).
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.
A base class reference-counting view of some image data.