2 #ifndef vil_decimate_h_ 3 #define vil_decimate_h_ 23 if (j_factor==0) j_factor=i_factor;
27 std::cerr <<
"ERROR: Division by 0 in " << __FILE__ << __LINE__ << std::endl;
31 (im.
ni()+i_factor-1u)/i_factor, (im.
nj()+j_factor-1u)/j_factor, im.
nplanes(),
41 unsigned i_factor,
unsigned j_factor=0);
48 unsigned i_factor,
unsigned j_factor);
58 unsigned j0,
unsigned n_j)
const override;
61 unsigned j0,
unsigned n_j)
const override;
67 bool get_property(
char const* tag,
void* property_value =
nullptr)
const override 69 return src_->get_property(tag, property_value);
78 #endif // vil_decimate_h_ An abstract base class of smart pointers to actual image data in memory.
A templated smart pointer class.
Concrete view of image data of type T held in memory.
unsigned nj() const override
Dimensions: Planes x ni x nj.
enum vil_pixel_format pixel_format() const override
Pixel Format.
bool get_property(char const *tag, void *property_value=nullptr) const override
Extra property information.
std::ptrdiff_t jstep() const
Add this to your pixel pointer to get next j pixel.
unsigned ni() const
Width.
unsigned nj() const
Height.
std::ptrdiff_t planestep() const
Add this to your pixel pointer to get pixel on next plane.
bool put_view(const vil_image_view_base &im, unsigned i0, unsigned j0) override
Put the data in this view back into the image source.
Abstract representation of an image source or image destination.
vil_image_view_base_sptr get_copy_view() const
Create a read/write view of a copy of all the data.
A base class reference-counting view of some image data.
T * top_left_ptr()
Pointer to the first (top left in plane 0) pixel.
A generic_image adaptor that behaves like a decimated version of its input.
unsigned nplanes() const
Number of planes.
unsigned nplanes() const override
Dimensions: Planes x ni x nj.
const vil_memory_chunk_sptr & memory_chunk() const
Smart pointer to the object holding the data for this view.
Representation of a generic image source or destination.
vil_decimate_image_resource(vil_image_resource_sptr const &, unsigned i_factor, unsigned j_factor)
vil_image_view< T > vil_decimate(const vil_image_view< T > &im, unsigned i_factor, unsigned j_factor=0)
Create a view which is a decimated version of src.
unsigned ni() const override
Dimensions: Planes x ni x nj.
std::ptrdiff_t istep() const
Add this to your pixel pointer to get next i pixel.
vil_image_resource_sptr src_
vil_image_view_base_sptr get_view() const
Create a read/write view of all the data.