Public Member Functions | Private Member Functions | Private Attributes | Friends | Related Functions
vil3d_memory_image Class Reference

Generic image implementation for PNM files. More...

#include <vil3d_memory_image.h>

Inheritance diagram for vil3d_memory_image:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 ~vil3d_memory_image ()
virtual unsigned nplanes () const
 Dimensions: planes x width x height x components.
virtual unsigned ni () const
 Dimensions: Planes x ni x nj x nk.
virtual unsigned nj () const
 Dimensions: Planes x ni x nj x nk.
virtual unsigned nk () const
 Dimensions: Planes x ni x nj x nk.
virtual enum vil_pixel_format pixel_format () const
 Pixel Format.
virtual vil3d_image_view_base_sptr get_copy_view (unsigned i0, unsigned ni, unsigned j0, unsigned nj, unsigned k0, unsigned nk) const
 Create a read/write view of a copy of this data.
virtual vil3d_image_view_base_sptr get_view (unsigned i0, unsigned ni, unsigned j0, unsigned nj, unsigned k0, unsigned nk) const
 Create a view of this data.
virtual bool put_view (const vil3d_image_view_base &im, unsigned i0, unsigned j0, unsigned k0)
 Put the data in this view back into the image source.
bool get_property (char const *, void *=0) const
 Extra property information.
vil3d_image_view_base_sptr get_view () const
 Create a read/write view of all the data.
virtual bool set_voxel_size (float, float, float)
 Set the size of the each voxel in the i,j,k directions.
virtual bool view_fits (const vil3d_image_view_base &im, unsigned i0, unsigned j0, unsigned k0)
 Check that a view will fit into the data at the given offset.
virtual char const * file_format () const
 Return a string describing the file format.

Private Member Functions

 vil3d_memory_image ()
 Create an empty memory image.
 vil3d_memory_image (unsigned ni, unsigned nj, unsigned nk, unsigned nplanes, vil_pixel_format format)
 Create an in-memory image of given size and pixel type.

Private Attributes

vil3d_image_view_baseview_
 Management of the memory image is devolved to an internal image_view.

Friends

vil3d_image_resource_sptr vil3d_new_image_resource (unsigned ni, unsigned nj, unsigned nk, unsigned nplanes, vil_pixel_format format)
 Make a new image of given format.

Related Functions

(Note that these are not member functions.)

bool vil3d_copy_deep (const vil3d_image_resource_sptr &src, vil3d_image_resource_sptr &dest)
 Copy src to dest.
vil3d_image_resource_sptr vil3d_crop (const vil3d_image_resource_sptr &src, unsigned i0, unsigned ni, unsigned j0, unsigned nj, unsigned k0, unsigned nk)
 Crop to a region of src.
vil3d_image_resource_sptr vil3d_new_image_resource (const char *filename, unsigned ni, unsigned nj, unsigned nk, unsigned nplanes, vil_pixel_format format, char const *file_format=0)
 Make a new image on disk.
bool vil3d_save_image_resource (const vil3d_image_resource_sptr &ir, char const *filename, char const *file_format)
 Send vil3d_image_resource to disk.
bool vil3d_save_image_resource (const vil3d_image_resource_sptr &ir, char const *filename)
 Save vil3d_image_resource to file, deducing format from filename.

Detailed Description

Generic image implementation for PNM files.

You can't create one of these yourself - use vil3d_new() instead.

Definition at line 16 of file vil3d_memory_image.h.


Constructor & Destructor Documentation

vil3d_memory_image::vil3d_memory_image ( ) [private]

Create an empty memory image.

Definition at line 19 of file vil3d_memory_image.cxx.

vil3d_memory_image::vil3d_memory_image ( unsigned  ni,
unsigned  nj,
unsigned  nk,
unsigned  nplanes,
vil_pixel_format  format 
) [private]

Create an in-memory image of given size and pixel type.

The pixel type must be scalar.

Definition at line 22 of file vil3d_memory_image.cxx.

vil3d_memory_image::~vil3d_memory_image ( ) [inline]

Definition at line 37 of file vil3d_memory_image.h.


Member Function Documentation

virtual char const* vil3d_image_resource::file_format ( ) const [inline, virtual, inherited]

Return a string describing the file format.

Only file images have a format, others return 0

Reimplemented in vil3d_analyze_image, vil3d_meta_image, vil3d_gipl_image, vil3d_slice_list_image, and vil3d_dicom_image.

Definition at line 107 of file vil3d_image_resource.h.

vil3d_image_view_base_sptr vil3d_memory_image::get_copy_view ( unsigned  i0,
unsigned  ni,
unsigned  j0,
unsigned  nj,
unsigned  k0,
unsigned  nk 
) const [virtual]

Create a read/write view of a copy of this data.

Returns:
0 if unable to get view of correct size.

Currently not yet implemented.

Returns:
0 if unable to get view of correct size.

Implements vil3d_image_resource.

Definition at line 775 of file vil3d_meta_image_format.cxx.

bool vil3d_memory_image::get_property ( char const *  label,
void *  property_value = 0 
) const [inline, virtual]

Extra property information.

Implements vil3d_image_resource.

Definition at line 63 of file vil3d_memory_image.h.

vil3d_image_view_base_sptr vil3d_memory_image::get_view ( unsigned  i0,
unsigned  ni,
unsigned  j0,
unsigned  nj,
unsigned  k0,
unsigned  nk 
) const [virtual]

Create a view of this data.

Create a read/write view of a copy of this data.

Returns:
0 if unable to get view of correct size.

Reimplemented from vil3d_image_resource.

Definition at line 87 of file vil3d_memory_image.cxx.

vil3d_image_view_base_sptr vil3d_image_resource::get_view ( ) const [inline, inherited]

Create a read/write view of all the data.

Definition at line 69 of file vil3d_image_resource.h.

virtual unsigned vil3d_memory_image::ni ( ) const [inline, virtual]

Dimensions: Planes x ni x nj x nk.

The number of pixels in each row.

Implements vil3d_image_resource.

Definition at line 41 of file vil3d_memory_image.h.

virtual unsigned vil3d_memory_image::nj ( ) const [inline, virtual]

Dimensions: Planes x ni x nj x nk.

The number of pixels in each column.

Implements vil3d_image_resource.

Definition at line 42 of file vil3d_memory_image.h.

virtual unsigned vil3d_memory_image::nk ( ) const [inline, virtual]

Dimensions: Planes x ni x nj x nk.

The number of pixels in each column.

Implements vil3d_image_resource.

Definition at line 43 of file vil3d_memory_image.h.

virtual unsigned vil3d_memory_image::nplanes ( void  ) const [inline, virtual]

Dimensions: planes x width x height x components.

Implements vil3d_image_resource.

Definition at line 40 of file vil3d_memory_image.h.

virtual enum vil_pixel_format vil3d_memory_image::pixel_format ( ) const [inline, virtual]

Pixel Format.

pixel_format() == VIL_PIXEL_FORMAT_BYTE

Implements vil3d_image_resource.

Definition at line 45 of file vil3d_memory_image.h.

bool vil3d_memory_image::put_view ( const vil3d_image_view_base im,
unsigned  i0,
unsigned  j0,
unsigned  k0 
) [virtual]

Put the data in this view back into the image source.

Currently not yet implemented.

Returns:
true on success.

Implements vil3d_image_resource.

Definition at line 838 of file vil3d_meta_image_format.cxx.

virtual bool vil3d_image_resource::set_voxel_size ( float  ,
float  ,
float   
) [inline, virtual, inherited]

Set the size of the each voxel in the i,j,k directions.

You can get the voxel sizes via get_properties().

Returns:
false if underlying image doesn't store pixel sizes.

Reimplemented in vil3d_analyze_image, vil3d_meta_image, and vil3d_gipl_image.

Definition at line 76 of file vil3d_image_resource.h.

virtual bool vil3d_image_resource::view_fits ( const vil3d_image_view_base im,
unsigned  i0,
unsigned  j0,
unsigned  k0 
) [inline, virtual, inherited]

Check that a view will fit into the data at the given offset.

This includes checking that the pixel type is scalar.

Definition at line 97 of file vil3d_image_resource.h.


Friends And Related Function Documentation

bool vil3d_copy_deep ( const vil3d_image_resource_sptr src,
vil3d_image_resource_sptr dest 
) [related]

Copy src to dest.

This is useful if you want to copy on image into a window on another image. src and dest must have identical sizes, and pixel-types. Returns false if the copy failed. O(size).

Definition at line 25 of file vil3d_copy.cxx.

vil3d_image_resource_sptr vil3d_crop ( const vil3d_image_resource_sptr src,
unsigned  i0,
unsigned  ni,
unsigned  j0,
unsigned  nj,
unsigned  k0,
unsigned  nk 
) [related]

Crop to a region of src.

Definition at line 13 of file vil3d_crop.cxx.

vil3d_image_resource_sptr vil3d_new_image_resource ( const char *  filename,
unsigned  ni,
unsigned  nj,
unsigned  nk,
unsigned  nplanes,
vil_pixel_format  format,
char const *  file_format = 0 
) [related]

Make a new image on disk.

Definition at line 31 of file vil3d_new.cxx.

vil3d_image_resource_sptr vil3d_new_image_resource ( unsigned  ni,
unsigned  nj,
unsigned  nk,
unsigned  nplanes,
vil_pixel_format  format 
) [friend]

Make a new image of given format.

Reimplemented from vil3d_image_resource.

Definition at line 23 of file vil3d_new.cxx.

bool vil3d_save_image_resource ( const vil3d_image_resource_sptr ir,
char const *  filename,
char const *  file_format 
) [related]

Send vil3d_image_resource to disk.

Definition at line 97 of file vil3d_save.cxx.

bool vil3d_save_image_resource ( const vil3d_image_resource_sptr ir,
char const *  filename 
) [related]

Save vil3d_image_resource to file, deducing format from filename.

Definition at line 111 of file vil3d_save.cxx.


Member Data Documentation

Management of the memory image is devolved to an internal image_view.

Definition at line 19 of file vil3d_memory_image.h.


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