#include <vil1_memory_image_of.h>
Inheritance diagram for vil1_memory_image_of< T >:

vil1_memory_image_of<Type> provides a templated interface to a vil1_memory_image. It is assumed that the user has queried the pixel size of the image and is instantiating an ImageBuffer of the appropriate type.
This allows C-efficiency access with C++ notational convenience after the type has been ascertained. Note that this should not be used for images too large to fit in memory.
CAVEAT PROGRAMMER: Each raster (row) is stored in a contiguous chunk of memory and the operator [] method gives a pointer to the beginning of a raster. Thus image[i][j] is the element in the i-th row and j-th column. However, image(x, y) is the element in the x-th column and y-th row.
Definition at line 46 of file vil1_memory_image_of.h.
Public Types | |
| typedef T | pixel_type |
| typedef T * | iterator |
| typedef T const * | const_iterator |
Public Member Functions | |
| iterator | begin () |
| iterator | end () |
| const_iterator | begin () const |
| const_iterator | end () const |
| unsigned | size () const |
| vil1_memory_image_of () | |
| Empty image. | |
| vil1_memory_image_of (vil1_memory_image_of< T > const &) | |
| This is a copy constructor, but it doesn't make a new buffer. | |
| vil1_memory_image_of (vil1_image const &image) | |
| Copy given image into a memory buffer. | |
| vil1_memory_image_of (int sizex, int sizey) | |
| Construct a w x h image, pixel format is determined from T. | |
| vil1_memory_image_of (T *buf, int sizex, int sizey) | |
| Construct a w x h image, pixel format is determined from T from memory previously created and pointed to by buf. | |
| ~vil1_memory_image_of () | |
| Clearly, this will deallocate the memory buffer. | |
| vil1_memory_image_of< T > & | operator= (vil1_memory_image_of< T > const &) |
| This method hides the operator= in the base class. | |
| vil1_memory_image_of< T > & | operator= (vil1_image const &) |
| Copy a vil1_image, only if it's in an appropriate format. | |
| void | set (vil1_image const &image) |
| Load image. | |
| void | resize (int width, int height) |
| These override the methods in the base class. | |
| T & | operator() (int x, int y) |
| Return read/write reference to pixel at (x,y). | |
| T const & | operator() (int x, int y) const |
| T * | operator[] (int y) |
| Return pointer to raster y. | |
| T const * | operator[] (int y) const |
| T *const * | row_array () |
| Return pointer to array of rasters. aka known as data_array() for matrices. | |
| T const *const * | row_array () const |
| T * | get_buffer () |
| Return pointer to the memory buffer. | |
| T const * | get_buffer () const |
| bool | in_range (int x, int y) const |
| Return true if (x,y) is a valid index into this buffer. | |
| bool | in_range_window (int x, int y, int w) const |
| Return true if (x+/-w,y+/-h) are valid indices into this buffer. | |
| bool | in_range (int x, int y, unsigned w, unsigned h) const |
| Return true if the region of size w,h starting at x,y is valid in this buffer. | |
| void | fill (T const &) |
| Fill with given value. | |
| int | width () const |
| Dimensions: Planes x W x H x Components. | |
| int | height () const |
| Dimensions: Planes x W x H x Components. | |
| void | assert_size (int width, int height) const |
| void | recache_from_impl () |
| Reset this class's member variables from the image implementation. | |
| int | planes () const |
| Dimensions: Planes x W x H x Components. | |
| int | components () const |
| Dimensions: Planes x W x H x Components. | |
| int | bits_per_component () const |
| Format. | |
| enum vil1_component_format | component_format () const |
| Format. | |
| vil1_image | get_plane (unsigned int p) const |
| return the ith plane. | |
| bool | get_section (void *buf, int x0, int y0, int wd, int ht) const |
| Copy from image to buf. | |
| bool | put_section (void const *buf, int x0, int y0, int wd, int ht) |
| Copy from buf to image. | |
| bool | get_property (char const *tag, void *property_value=0) const |
| Getting property information. | |
| bool | set_property (char const *tag, void const *property_value=0) |
| Setting property information. | |
| char const * | file_format () const |
| Return a string describing the file format. | |
| int | rows () const |
| Number of rows. | |
| int | cols () const |
| Number of columns. | |
| int | get_size_bytes () const |
| return size in bytes. | |
| vcl_ostream & | print (vcl_ostream &) const |
| Print a 1-line summary of contents. | |
| bool | operator== (vil1_image const &that) const |
| equality means equality of implementation, not pixels. | |
| bool | operator< (vil1_image const &that) const |
| needed for sorted containers of images. | |
| operator safe_bool () const | |
| conversion to bool. | |
| bool | operator! () const |
| inverse conversion to bool. | |
| vil1_image_impl * | impl () const |
| use "sptr.impl()" to get a pointer to the impl object. | |
Protected Attributes | |
| int | width_ |
| int | height_ |
| void ** | rows0_ |
| vil1_image_impl * | ptr |
Private Member Functions | |
| void | resize (int planes, int width, int height) |
| typedef T vil1_memory_image_of< T >::pixel_type |
Definition at line 50 of file vil1_memory_image_of.h.
| typedef T* vil1_memory_image_of< T >::iterator |
Definition at line 53 of file vil1_memory_image_of.h.
| typedef T const* vil1_memory_image_of< T >::const_iterator |
Definition at line 57 of file vil1_memory_image_of.h.
| vil1_memory_image_of< T >::vil1_memory_image_of | ( | ) |
| vil1_memory_image_of< T >::vil1_memory_image_of | ( | vil1_memory_image_of< T > const & | ) |
This is a copy constructor, but it doesn't make a new buffer.
Definition at line 21 of file vil1_memory_image_of.txx.
| vil1_memory_image_of< T >::vil1_memory_image_of | ( | vil1_image const & | image | ) | [explicit] |
Copy given image into a memory buffer.
If it's already a memory image, do as the copy constructor (above) does.
Definition at line 27 of file vil1_memory_image_of.txx.
| vil1_memory_image_of< T >::vil1_memory_image_of | ( | int | sizex, | |
| int | sizey | |||
| ) |
Construct a w x h image, pixel format is determined from T.
Definition at line 38 of file vil1_memory_image_of.txx.
| vil1_memory_image_of< T >::vil1_memory_image_of | ( | T * | buf, | |
| int | sizex, | |||
| int | sizey | |||
| ) |
Construct a w x h image, pixel format is determined from T from memory previously created and pointed to by buf.
Definition at line 46 of file vil1_memory_image_of.txx.
| vil1_memory_image_of< T >::~vil1_memory_image_of | ( | ) | [inline] |
Clearly, this will deallocate the memory buffer.
Definition at line 84 of file vil1_memory_image_of.h.
| iterator vil1_memory_image_of< T >::begin | ( | ) | [inline] |
Definition at line 54 of file vil1_memory_image_of.h.
| iterator vil1_memory_image_of< T >::end | ( | ) | [inline] |
Definition at line 55 of file vil1_memory_image_of.h.
| const_iterator vil1_memory_image_of< T >::begin | ( | ) | const [inline] |
Definition at line 58 of file vil1_memory_image_of.h.
| const_iterator vil1_memory_image_of< T >::end | ( | ) | const [inline] |
Definition at line 59 of file vil1_memory_image_of.h.
| unsigned vil1_memory_image_of< T >::size | ( | ) | const [inline] |
Definition at line 61 of file vil1_memory_image_of.h.
| vil1_memory_image_of< T > & vil1_memory_image_of< T >::operator= | ( | vil1_memory_image_of< T > const & | ) |
This method hides the operator= in the base class.
Definition at line 71 of file vil1_memory_image_of.txx.
| vil1_memory_image_of< T > & vil1_memory_image_of< T >::operator= | ( | vil1_image const & | ) |
Copy a vil1_image, only if it's in an appropriate format.
This routine does not try to guess how to convert images which are not compatible with T.
Reimplemented from vil1_image.
Definition at line 78 of file vil1_memory_image_of.txx.
| void vil1_memory_image_of< T >::set | ( | vil1_image const & | image | ) |
| void vil1_memory_image_of< T >::resize | ( | int | width, | |
| int | height | |||
| ) |
These override the methods in the base class.
Reimplemented from vil1_memory_image.
Definition at line 86 of file vil1_memory_image_of.txx.
| void vil1_memory_image_of< T >::resize | ( | int | planes, | |
| int | width, | |||
| int | height | |||
| ) | [private] |
| T& vil1_memory_image_of< T >::operator() | ( | int | x, | |
| int | y | |||
| ) | [inline] |
Return read/write reference to pixel at (x,y).
Definition at line 107 of file vil1_memory_image_of.h.
| T const& vil1_memory_image_of< T >::operator() | ( | int | x, | |
| int | y | |||
| ) | const [inline] |
Definition at line 108 of file vil1_memory_image_of.h.
| T* vil1_memory_image_of< T >::operator[] | ( | int | y | ) | [inline] |
| T const* vil1_memory_image_of< T >::operator[] | ( | int | y | ) | const [inline] |
Definition at line 112 of file vil1_memory_image_of.h.
| T* const* vil1_memory_image_of< T >::row_array | ( | ) | [inline] |
Return pointer to array of rasters. aka known as data_array() for matrices.
Definition at line 115 of file vil1_memory_image_of.h.
| T const* const* vil1_memory_image_of< T >::row_array | ( | ) | const [inline] |
Definition at line 116 of file vil1_memory_image_of.h.
| T* vil1_memory_image_of< T >::get_buffer | ( | ) | [inline] |
Return pointer to the memory buffer.
Reimplemented from vil1_memory_image.
Definition at line 119 of file vil1_memory_image_of.h.
| T const* vil1_memory_image_of< T >::get_buffer | ( | ) | const [inline] |
Definition at line 120 of file vil1_memory_image_of.h.
| bool vil1_memory_image_of< T >::in_range | ( | int | x, | |
| int | y | |||
| ) | const [inline] |
Return true if (x,y) is a valid index into this buffer.
Definition at line 123 of file vil1_memory_image_of.h.
| bool vil1_memory_image_of< T >::in_range_window | ( | int | x, | |
| int | y, | |||
| int | w | |||
| ) | const [inline] |
Return true if (x+/-w,y+/-h) are valid indices into this buffer.
Definition at line 126 of file vil1_memory_image_of.h.
| bool vil1_memory_image_of< T >::in_range | ( | int | x, | |
| int | y, | |||
| unsigned | w, | |||
| unsigned | h | |||
| ) | const [inline] |
Return true if the region of size w,h starting at x,y is valid in this buffer.
Definition at line 131 of file vil1_memory_image_of.h.
| void vil1_memory_image_of< T >::fill | ( | T const & | ) |
| int vil1_memory_image::width | ( | ) | const [inline, inherited] |
Dimensions: Planes x W x H x Components.
Reimplemented from vil1_image.
Definition at line 59 of file vil1_memory_image.h.
| int vil1_memory_image::height | ( | ) | const [inline, inherited] |
Dimensions: Planes x W x H x Components.
Reimplemented from vil1_image.
Definition at line 60 of file vil1_memory_image.h.
| void vil1_memory_image::assert_size | ( | int | width, | |
| int | height | |||
| ) | const [inherited] |
Definition at line 137 of file vil1_memory_image.cxx.
| void vil1_memory_image::recache_from_impl | ( | ) | [inherited] |
Reset this class's member variables from the image implementation.
This is is useful if the impl object has been modified outside the control of this object.
Definition at line 189 of file vil1_memory_image.cxx.
| int vil1_image::planes | ( | ) | const [inline, inherited] |
| int vil1_image::components | ( | ) | const [inline, inherited] |
| int vil1_image::bits_per_component | ( | ) | const [inline, inherited] |
| enum vil1_component_format vil1_image::component_format | ( | ) | const [inline, inherited] |
| vil1_image vil1_image::get_plane | ( | unsigned int | p | ) | const [inline, inherited] |
| bool vil1_image::get_section | ( | void * | buf, | |
| int | x0, | |||
| int | y0, | |||
| int | wd, | |||
| int | ht | |||
| ) | const [inline, inherited] |
| bool vil1_image::put_section | ( | void const * | buf, | |
| int | x0, | |||
| int | y0, | |||
| int | wd, | |||
| int | ht | |||
| ) | [inline, inherited] |
| bool vil1_image::get_property | ( | char const * | tag, | |
| void * | property_value = 0 | |||
| ) | const [inline, inherited] |
| bool vil1_image::set_property | ( | char const * | tag, | |
| void const * | property_value = 0 | |||
| ) | [inline, inherited] |
| char const* vil1_image::file_format | ( | ) | const [inline, inherited] |
Return a string describing the file format.
Only file images have a format, others return 0
Definition at line 75 of file vil1_image.h.
| int vil1_image::rows | ( | ) | const [inline, inherited] |
| int vil1_image::cols | ( | ) | const [inline, inherited] |
| int vil1_image::get_size_bytes | ( | ) | const [inherited] |
| vcl_ostream & vil1_image::print | ( | vcl_ostream & | ) | const [inherited] |
| bool vil1_image::operator== | ( | vil1_image const & | that | ) | const [inline, inherited] |
| bool vil1_image::operator< | ( | vil1_image const & | that | ) | const [inline, inherited] |
| vil1_image::operator safe_bool | ( | ) | const [inline, inherited] |
| bool vil1_image::operator! | ( | ) | const [inline, inherited] |
| vil1_image_impl* vil1_image::impl | ( | ) | const [inline, inherited] |
int vil1_memory_image::width_ [protected, inherited] |
Definition at line 69 of file vil1_memory_image.h.
int vil1_memory_image::height_ [protected, inherited] |
Definition at line 70 of file vil1_memory_image.h.
void** vil1_memory_image::rows0_ [protected, inherited] |
Definition at line 71 of file vil1_memory_image.h.
vil1_image_impl* vil1_image::ptr [protected, inherited] |
Definition at line 155 of file vil1_image.h.
1.5.1