Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members
vil_image_view_base Class Referenceabstract

An abstract base class of smart pointers to actual image data in memory. More...

#include <vil_image_view_base.h>

Inheritance diagram for vil_image_view_base:
Inheritance graph
[legend]

Public Member Functions

virtual ~vil_image_view_base ()
 
unsigned ni () const
 Width. More...
 
unsigned nj () const
 Height. More...
 
unsigned nplanes () const
 Number of planes. More...
 
unsigned long size () const
 The number of pixels. More...
 
virtual void set_size (unsigned width, unsigned height)=0
 set_size current planes to width x height. More...
 
virtual void set_size (unsigned width, unsigned height, unsigned n_planes)=0
 resize to width x height x n_planes. More...
 
virtual void print (std::ostream &) const =0
 Print a 1-line summary of contents. More...
 
virtual std::string is_a () const =0
 Return class name. More...
 
virtual enum vil_pixel_format pixel_format () const =0
 Return a description of the concrete data pixel type. More...
 
virtual bool is_class (std::string const &s) const
 True if this is (or is derived from) class s. More...
 

Protected Member Functions

 vil_image_view_base (unsigned n_i, unsigned n_j, unsigned n_planes)
 
 vil_image_view_base ()
 Default is an empty one-plane image. More...
 

Protected Attributes

unsigned ni_
 Number of columns. More...
 
unsigned nj_
 Number of rasters. More...
 
unsigned nplanes_
 Number of planes. More...
 

Private Member Functions

void ref ()
 
void unref ()
 

Private Attributes

vcl_atomic_count reference_count_
 

Friends

class vil_smart_ptr< vil_image_view_base >
 

Detailed Description

An abstract base class of smart pointers to actual image data in memory.

If you want an actual image, try instantiating vil_image_view<T>.

Definition at line 27 of file vil_image_view_base.h.

Constructor & Destructor Documentation

◆ vil_image_view_base() [1/2]

vil_image_view_base::vil_image_view_base ( unsigned  n_i,
unsigned  n_j,
unsigned  n_planes 
)
inlineprotected

Definition at line 37 of file vil_image_view_base.h.

◆ vil_image_view_base() [2/2]

vil_image_view_base::vil_image_view_base ( )
inlineprotected

Default is an empty one-plane image.

Don't set nplanes_ to zero as it confuses set_size(nx,ny) later

Definition at line 42 of file vil_image_view_base.h.

◆ ~vil_image_view_base()

virtual vil_image_view_base::~vil_image_view_base ( )
inlinevirtual

Definition at line 46 of file vil_image_view_base.h.

Member Function Documentation

◆ is_a()

virtual std::string vil_image_view_base::is_a ( ) const
pure virtual

Return class name.

Implemented in vil_image_view< T >, and vil_image_view< bool >.

◆ is_class()

virtual bool vil_image_view_base::is_class ( std::string const &  s) const
inlinevirtual

True if this is (or is derived from) class s.

Reimplemented in vil_image_view< T >, and vil_image_view< bool >.

Definition at line 79 of file vil_image_view_base.h.

◆ ni()

unsigned vil_image_view_base::ni ( ) const
inline

Width.

Definition at line 49 of file vil_image_view_base.h.

◆ nj()

unsigned vil_image_view_base::nj ( ) const
inline

Height.

Definition at line 51 of file vil_image_view_base.h.

◆ nplanes()

unsigned vil_image_view_base::nplanes ( ) const
inline

Number of planes.

Definition at line 53 of file vil_image_view_base.h.

◆ pixel_format()

virtual enum vil_pixel_format vil_image_view_base::pixel_format ( ) const
pure virtual

Return a description of the concrete data pixel type.

For example if the value is VIL_PIXEL_FORMAT_BYTE, you can safely cast, or assign the base class reference to a vil_image_view<vxl_byte>.

Implemented in vil_image_view< T >, and vil_image_view< bool >.

◆ print()

virtual void vil_image_view_base::print ( std::ostream &  ) const
pure virtual

Print a 1-line summary of contents.

Implemented in vil_image_view< T >, and vil_image_view< bool >.

◆ ref()

void vil_image_view_base::ref ( )
inlineprivate

Definition at line 85 of file vil_image_view_base.h.

◆ set_size() [1/2]

virtual void vil_image_view_base::set_size ( unsigned  width,
unsigned  height 
)
pure virtual

set_size current planes to width x height.

If already correct size, this function returns quickly

Implemented in vil_image_view< T >, and vil_image_view< bool >.

◆ set_size() [2/2]

virtual void vil_image_view_base::set_size ( unsigned  width,
unsigned  height,
unsigned  n_planes 
)
pure virtual

resize to width x height x n_planes.

If already correct size, this function returns quickly

Implemented in vil_image_view< T >, and vil_image_view< bool >.

◆ size()

unsigned long vil_image_view_base::size ( ) const
inline

The number of pixels.

Definition at line 56 of file vil_image_view_base.h.

◆ unref()

void vil_image_view_base::unref ( )
inlineprivate

Definition at line 86 of file vil_image_view_base.h.

Friends And Related Function Documentation

◆ vil_smart_ptr< vil_image_view_base >

friend class vil_smart_ptr< vil_image_view_base >
friend

Definition at line 84 of file vil_image_view_base.h.

Member Data Documentation

◆ ni_

unsigned vil_image_view_base::ni_
protected

Number of columns.

Definition at line 31 of file vil_image_view_base.h.

◆ nj_

unsigned vil_image_view_base::nj_
protected

Number of rasters.

Definition at line 33 of file vil_image_view_base.h.

◆ nplanes_

unsigned vil_image_view_base::nplanes_
protected

Number of planes.

Definition at line 35 of file vil_image_view_base.h.

◆ reference_count_

vcl_atomic_count vil_image_view_base::reference_count_
private

Definition at line 89 of file vil_image_view_base.h.


The documentation for this class was generated from the following file: