vil_image_resource.cxx
Go to the documentation of this file.
1 // This is core/vil/vil_image_resource.cxx
2 //:
3 // \file
4 // \author Ian Scott ISBE Manchester
5 // \date 20 Sep 2002
6 //
7 //-----------------------------------------------------------------------------
8 
9 #include "vil_image_resource.h"
11 
12 //--------------------------------------------------------------------------------
13 
14 //: the reference count starts at 0.
15 vil_image_resource::vil_image_resource() : reference_count_(0) { }
16 
18 
19 
20 bool vil_image_resource::get_property(char const *, void *) const
21 {
22  return false;
23 }
24 
25 
26 //: Check that a view will fit into the data at the given offset.
27 // This includes checking that the pixel type is scalar.
28 bool vil_image_resource::view_fits(const vil_image_view_base& im, unsigned i0, unsigned j0)
29 {
30  return i0 + im.ni() <= ni() &&
31  j0 + im.nj() <= nj() &&
32  im.nplanes() == nplanes() &&
34 }
An abstract base class of smart pointers to actual image data in memory.
virtual bool view_fits(const vil_image_view_base &im, unsigned i0, unsigned j0)
Check that a view will fit into the data at the given offset.
A base class reference-counting view of some image data.
vil_image_resource()
the reference count starts at 0.
virtual unsigned ni() const =0
Dimensions: Planes x ni x nj.
virtual unsigned nj() const =0
Dimensions: Planes x ni x nj.
unsigned ni() const
Width.
unsigned nj() const
Height.
virtual enum vil_pixel_format pixel_format() const =0
Return a description of the concrete data pixel type.
virtual bool get_property(char const *tag, void *property_value=nullptr) const =0
Extra property information.
unsigned vil_pixel_format_num_components(enum vil_pixel_format f)
Return the number of components in pixel format f.
virtual unsigned nplanes() const =0
Dimensions: Planes x ni x nj.
virtual ~vil_image_resource()
unsigned nplanes() const
Number of planes.
Representation of a generic image source or destination.