A base class for images of any dimension and type. More...
#include <vimt_image.h>
Public Member Functions | |
vimt_image () | |
Dflt ctor. | |
virtual | ~vimt_image () |
Destructor. | |
virtual unsigned | n_dims () const =0 |
Return dimensionality of image. | |
virtual unsigned | n_planes () const =0 |
Return number of planes in images. | |
virtual vcl_vector< unsigned > | image_size () const =0 |
Return vector indicating size of image in pixels. | |
virtual void | world_bounds (vcl_vector< double > &b_lo, vcl_vector< double > &b_hi) const =0 |
Return vectors defining bounding box containing image in world co-ords. | |
virtual vcl_vector< double > | pixel_size () const =0 |
Return vector indicating the size of a pixel. | |
short | version_no () const |
Version number for I/O. | |
virtual vcl_string | is_a () const =0 |
Name of the class. | |
virtual bool | is_class (vcl_string const &) const =0 |
Does the name of the class match the argument?. | |
virtual vimt_image * | clone () const =0 |
Create a copy on the heap and return base class pointer. | |
virtual vimt_image * | deep_clone () const =0 |
Create a deep copy on the heap and return base class pointer. | |
bool | operator== (const vimt_image &) const |
Shallow equality. | |
virtual void | print_summary (vcl_ostream &os) const =0 |
Print class to os. | |
virtual void | print_all (vcl_ostream &os) const =0 |
Print whole image to os. | |
virtual void | b_write (vsl_b_ostream &bfs) const =0 |
Save class to binary file stream. | |
virtual void | b_read (vsl_b_istream &bfs)=0 |
Load class from binary file stream. | |
Private Member Functions | |
virtual bool | equals (const vimt_image &) const =0 |
Shallow equality tester. |
A base class for images of any dimension and type.
Derived classes tend to have world to image transformations attached to them, and to be able to act as `views' of external data.
Definition at line 21 of file vimt_image.h.
vimt_image::vimt_image | ( | ) | [inline] |
Dflt ctor.
Definition at line 29 of file vimt_image.h.
virtual vimt_image::~vimt_image | ( | ) | [inline, virtual] |
Destructor.
Definition at line 32 of file vimt_image.h.
virtual void vimt_image::b_read | ( | vsl_b_istream & | bfs | ) | [pure virtual] |
Load class from binary file stream.
Implemented in vimt_image_2d_of< T >.
virtual void vimt_image::b_write | ( | vsl_b_ostream & | bfs | ) | const [pure virtual] |
Save class to binary file stream.
Implemented in vimt_image_2d_of< T >.
virtual vimt_image* vimt_image::clone | ( | ) | const [pure virtual] |
Create a copy on the heap and return base class pointer.
Note that this will make a shallow copy of any contained images
Implemented in vimt_image_2d_of< T >.
virtual vimt_image* vimt_image::deep_clone | ( | ) | const [pure virtual] |
Create a deep copy on the heap and return base class pointer.
This will make a deep copy of any contained images
Implemented in vimt_image_2d_of< T >.
virtual bool vimt_image::equals | ( | const vimt_image & | ) | const [private, pure virtual] |
Shallow equality tester.
The parameter must be identical type to this.
Implemented in vimt_image_2d_of< T >.
virtual vcl_vector<unsigned> vimt_image::image_size | ( | ) | const [pure virtual] |
Return vector indicating size of image in pixels.
2D image is v[0] x v[1], 3D image is v[0] x v[1] x v[2] Somewhat inefficient: Only use when you absolutely have to. Usually one only needs to know the size once one knows the exact type.
Implemented in vimt_image_2d.
vcl_string vimt_image::is_a | ( | ) | const [pure virtual] |
Name of the class.
Implemented in vimt_image_2d_of< T >, and vimt_image_2d.
Definition at line 41 of file vimt_image.cxx.
bool vimt_image::is_class | ( | vcl_string const & | s | ) | const [pure virtual] |
Does the name of the class match the argument?.
Implemented in vimt_image_2d_of< T >, and vimt_image_2d.
Definition at line 49 of file vimt_image.cxx.
virtual unsigned vimt_image::n_dims | ( | ) | const [pure virtual] |
Return dimensionality of image.
Implemented in vimt_image_2d.
virtual unsigned vimt_image::n_planes | ( | ) | const [pure virtual] |
Return number of planes in images.
Implemented in vimt_image_2d_of< T >.
bool vimt_image::operator== | ( | const vimt_image & | im | ) | const |
Shallow equality.
tests if the two images are the same type, have equal transforms, and point to the same image data with equal step sizes, etc.
Definition at line 27 of file vimt_image.cxx.
virtual vcl_vector<double> vimt_image::pixel_size | ( | ) | const [pure virtual] |
Return vector indicating the size of a pixel.
2D image is v[0] x v[1], 3D image is v[0] x v[1] x v[2]
Implemented in vimt_image_2d.
virtual void vimt_image::print_all | ( | vcl_ostream & | os | ) | const [pure virtual] |
Print whole image to os.
Implemented in vimt_image_2d_of< T >.
virtual void vimt_image::print_summary | ( | vcl_ostream & | os | ) | const [pure virtual] |
Print class to os.
Implemented in vimt_image_2d_of< T >.
short vimt_image::version_no | ( | ) | const |
Version number for I/O.
Reimplemented in vimt_image_2d_of< T >.
Definition at line 18 of file vimt_image.cxx.
virtual void vimt_image::world_bounds | ( | vcl_vector< double > & | b_lo, |
vcl_vector< double > & | b_hi | ||
) | const [pure virtual] |
Return vectors defining bounding box containing image in world co-ords.
Somewhat inefficient: Only use when you absolutely have to. Usually one only needs to know the size once one knows the exact type.
Implemented in vimt_image_2d.