6 # include <vcl_msvc_warnings.h> 16 static const unsigned vil_size_block_i = 256, vil_size_block_j = 256;
29 sbi_ = vil_size_block_i;
sbj_ = vil_size_block_j;
38 #define FILL_BLOCK_CASE(FORMAT, T) \ 40 vil_image_view<T>* dest = new vil_image_view<T>(sbi_, sbj_, nplanes()); \ 41 vil_image_view_base_sptr ptr = dest; \ 42 vil_image_view<T>* src = reinterpret_cast<vil_image_view<T>* >(view.ptr()); \ 43 vil_copy_to_window<T>(*src, *dest, 0, 0); \ 55 #undef FILL_BLOCK_CASE 57 assert(!
"Unknown vil data type.");
67 unsigned block_index_j )
const 70 unsigned i0 = block_index_i*
sbi_, j0 = block_index_j*
sbj_;
71 if (i0>
ni-1||j0>
nj-1)
return nullptr;
73 unsigned icrop =
ni-i0, jcrop =
nj-j0;
74 bool needs_fill =
false;
91 unsigned block_index_j,
95 unsigned i0 = block_index_i*
sbi_, j0 = block_index_j*
sbj_;
97 unsigned imax = i0 +
sbi_, jmax = j0 +
sbj_;
99 bool needs_trim =
false;
102 icrop =
src_->ni()-i0;
107 jcrop =
src_->nj()-j0;
114 #define TRIM_BLOCK_CASE(FORMAT, T) \ 116 const vil_image_view<T>& curr_view = \ 117 static_cast<const vil_image_view< T >& >(view); \ 118 vil_image_view< T > cview = \ 119 vil_crop(curr_view, 0, icrop, 0, jcrop); \ 120 return src_->put_view(cview, i0, j0); \ 131 #undef TRIM_BLOCK_CASE 133 assert(!
"Unknown vil data type.");
137 return src_->put_view(view, i0, j0);
144 return src_->get_property(tag, value);
An abstract base class of smart pointers to actual image data in memory.
vil_image_view_base_sptr get_block(unsigned block_index_i, unsigned block_index_j) const override
Block access.
unsigned ni() const override
Dimensions: Planes x ni x nj.
bool get_property(char const *tag, void *property_value=nullptr) const override
Extra property information.
#define vil_property_quantisation_depth
The quantisation depth of pixel components.
vil_image_resource_sptr src_
the image resource masquerading as a blocked resource.
bool put_block(unsigned block_index_i, unsigned block_index_j, const vil_image_view_base &view) override
put the block into the resource at the indicated location.
unsigned size_block_i() const override
Block size in columns.
#define TRIM_BLOCK_CASE(FORMAT, T)
A blocked image facade for any image resource.
#define vil_property_size_block_i
For unblocked images, the following properties are not implemented.
Various image copying functions.
#define FILL_BLOCK_CASE(FORMAT, T)
unsigned size_block_j() const override
Block size in rows.
vil_image_view_base_sptr fill_block(vil_image_view_base_sptr &view) const
A base class reference-counting view of some image data.
There is no class or function called vil_property.
enum vil_pixel_format pixel_format() const override
Pixel Format.
#define vil_property_size_block_j
Block size in rows.
unsigned sbj_
block size in j.
unsigned sbi_
block size in i.
vil_blocked_image_facade()
unsigned nj() const override
Dimensions: Planes x ni x nj.