Wavelet and Image class library  1.3.2
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
StillImage Class Reference

#include <StillImage.hh>

Inheritance diagram for StillImage:
Inheritance graph
[legend]
Collaboration diagram for StillImage:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 StillImage (int rows=0, int cols=0)
 StillImage (ImageArray< coeff > &ia)
virtual ~StillImage (void)
virtual coeff at (int y, int x) const
virtual coeff at (int abs) const
virtual void to (int y, int x, coeff val)
virtual void to (int abs, coeff val)
virtual int abs (int y, int x) const
virtual bool epsilons (Image &si, coeff epsilon) const
virtual bool equals (Image &si) const
virtual void read (char const *fname, int rawy=0, int rawx=0)
virtual void read (char const *fname, filetype ftype, int rawy=0, int rawx=0)
virtual void write (char const *fname, bool beautify=false)
virtual void write (char const *fname, filetype ftype, bool beautify=false)
virtual Imageclone (void) const
virtual coeff smax (int fromY=0, int fromX=0, int toY=-1, int toX=-1) const
virtual coeff smin (int fromY=0, int fromX=0, int toY=-1, int toX=-1) const
virtual coeff amax (int fromY=0, int fromX=0, int toY=-1, int toX=-1) const
virtual coeff amin (int fromY=0, int fromX=0, int toY=-1, int toX=-1) const
virtual coeff saverage (int fromY=0, int fromX=0, int toY=-1, int toX=-1) const
virtual coeff aaverage (int fromY=0, int fromX=0, int toY=-1, int toX=-1) const
virtual void resize (int rows, int cols)

Static Public Member Functions

static ImagemakeEmpty (int rows=0, int cols=0)

Protected Member Functions

 StillImage (bool dummy)
virtual ImagemkImage (int rows=0, int cols=0) const

Protected Attributes

ImageArray< coeff > * m_coeffs
bool m_coeffsMustDelete

Detailed Description

A still image. A (grey-scale) two-dimensional image.

Definition at line 21 of file StillImage.hh.


Constructor & Destructor Documentation

StillImage::StillImage ( int  rows = 0,
int  cols = 0 
)

Constructor. Creates an empty image with given dimensions.

Parameters:
rowsthe number of rows
colsthe number of cols

Referenced by makeEmpty().

Constructor. Imports an existing {ImageArray} object. The array will be duplicated.

Parameters:
iaThe source array
virtual StillImage::~StillImage ( void  ) [virtual]

Destructor. Deallocates objects.

StillImage::StillImage ( bool  dummy) [inline, protected]

Dummy constructor, only to be called by derived classes.

Parameters:
dummyonly distinguishes this constructor from the others

Definition at line 256 of file StillImage.hh.


Member Function Documentation

virtual coeff StillImage::aaverage ( int  fromY = 0,
int  fromX = 0,
int  toY = -1,
int  toX = -1 
) const [inline, virtual]

Return the average color for a rectangular region inside the image drawn from one point within and the second point just outside the region. The coefficients' signedness will be discarded.

Parameters:
fromYthe first point's row
fromXthe first point's col
toYthe second point's row (-1 if lower image border)
toXthe second point's col (-1 if right image border)
Returns:
the average color

Implements Image.

Definition at line 223 of file StillImage.hh.

References ImageArray< T >::aaverage(), and m_coeffs.

virtual int StillImage::abs ( int  y,
int  x 
) const [inline, virtual]

Return the absolute offset of a position.

Parameters:
ythe position's row
xthe position's col
Returns:
the absolute offset

Implements Image.

Definition at line 78 of file StillImage.hh.

References ImageArray< T >::abs(), and m_coeffs.

virtual coeff StillImage::amax ( int  fromY = 0,
int  fromX = 0,
int  toY = -1,
int  toX = -1 
) const [inline, virtual]

Returns the maximum absolute value in a region. Signs will be discarded.

Parameters:
fromYthe first point's row
fromXthe first point's col
toYthe second point's row (-1 if lower image border)
toXthe second point's col (-1 if right image border)
Returns:
the maximum

Implements Image.

Definition at line 188 of file StillImage.hh.

References ImageArray< T >::amax(), and m_coeffs.

virtual coeff StillImage::amin ( int  fromY = 0,
int  fromX = 0,
int  toY = -1,
int  toX = -1 
) const [inline, virtual]

Returns the minimum absolute value in a region. Signs will be discarded.

Parameters:
fromYthe first point's row
fromXthe first point's col
toYthe second point's row (-1 if lower image border)
toXthe second point's col (-1 if right image border)
Returns:
the minimum

Implements Image.

Definition at line 199 of file StillImage.hh.

References ImageArray< T >::amin(), and m_coeffs.

virtual coeff StillImage::at ( int  y,
int  x 
) const [inline, virtual]

Get a value. Returns the value at row {y} and col {x}.

Parameters:
ythe row
xthe col
Returns:
the value

Implements Image.

Definition at line 47 of file StillImage.hh.

References ImageArray< T >::at(), and m_coeffs.

virtual coeff StillImage::at ( int  abs) const [inline, virtual]

Get a value. Returns the value at absolute position {abs}.

Parameters:
absthe position
Returns:
the value

Implements Image.

Definition at line 53 of file StillImage.hh.

References ImageArray< T >::at(), and m_coeffs.

virtual Image* StillImage::clone ( void  ) const [virtual]

Produce a copy. Every dynamically object will be cloned rather than passing on the reference.

Returns:
the new, copied object.

Implements Image.

Reimplemented in VideoFrame.

virtual bool StillImage::epsilons ( Image si,
coeff  epsilon 
) const [virtual]

Rough comparison. See if two images are similar according to a given {epsilon} (important for floating-point comparisons).

Parameters:
sithe other {Image} object
epsilonthe epsilon
Returns:
if both are identical: {true}, else {false}

Implements Image.

virtual bool StillImage::equals ( Image si) const [virtual]

Compares two still images. Return {true} if both are equal.

Parameters:
siThe other {StillImage} object
Returns:
if equals: {true}, else {false}

Implements Image.

static Image* StillImage::makeEmpty ( int  rows = 0,
int  cols = 0 
) [inline, static]

Create an empty StillImage.

Parameters:
rowsthe number of rows
colsthe number of cols
Returns:
the new image

Definition at line 156 of file StillImage.hh.

References Image::cols(), Image::rows(), and StillImage().

virtual Image* StillImage::mkImage ( int  rows = 0,
int  cols = 0 
) const [protected, virtual]

Factory method to get a new instance of a given size filled with zeroes.

Parameters:
rowsthe number of rows
colsthe number of cols
Returns:
the new image

Implements Image.

virtual void StillImage::read ( char const *  fname,
int  rawy = 0,
int  rawx = 0 
) [virtual]

Read an image. Reads an image from a file guessing the file type from the file name's extension. Currently PGM, RAW and PFI are supported.

Exceptions:
invalid_argumentthe file type is either not supported or could not be determined from the given file name
Parameters:
fnamethe file name, if {NULL}, then {stdin}
rawythe number of rows (only needed for RAW format)
rawxthe number of cols (only needed for RAW format)

Implements Image.

virtual void StillImage::read ( char const *  fname,
filetype  ftype,
int  rawy = 0,
int  rawx = 0 
) [virtual]

Read an image. Reads an image from a file using the specified file type. Currently PGM, RAW and PFI are supported.

Exceptions:
invalid_argumentthe file type is either not supported or could not be determined from the given file name
Parameters:
fnamethe file name, if {NULL}, then {stdin}
ftypethe file type
rawythe number of rows (only needed for RAW format)
rawxthe number of cols (only needed for RAW format)

Implements Image.

virtual void StillImage::resize ( int  rows,
int  cols 
) [virtual]

Resize the image's x/y dimensions. The old values will remain as far as they fit in the new dimensions. The new dimensions must all be greater than zero.

Exceptions:
invalid_argumentone or both dimensions are either negative or zero
Parameters:
rowsthe new number of rows
colsthe new number of cols

Implements Image.

virtual coeff StillImage::saverage ( int  fromY = 0,
int  fromX = 0,
int  toY = -1,
int  toX = -1 
) const [inline, virtual]

Return the average color for a rectangular region inside the image drawn from one point within and the second point just outside the region. The coefficients' signedness will be considered.

Parameters:
fromYthe first point's row
fromXthe first point's col
toYthe second point's row (-1 if lower image border)
toXthe second point's col (-1 if right image border)
Returns:
the average color

Implements Image.

Definition at line 211 of file StillImage.hh.

References m_coeffs, and ImageArray< T >::saverage().

virtual coeff StillImage::smax ( int  fromY = 0,
int  fromX = 0,
int  toY = -1,
int  toX = -1 
) const [inline, virtual]

Returns the maximum value in a region. Signs will be considered.

Parameters:
fromYthe first point's row
fromXthe first point's col
toYthe second point's row (-1 if lower image border)
toXthe second point's col (-1 if right image border)
Returns:
the maximum

Implements Image.

Definition at line 166 of file StillImage.hh.

References m_coeffs, and ImageArray< T >::smax().

virtual coeff StillImage::smin ( int  fromY = 0,
int  fromX = 0,
int  toY = -1,
int  toX = -1 
) const [inline, virtual]

Returns the maximum absolute value in a region. Signs will be discarded.

Parameters:
fromYthe first point's row
fromXthe first point's col
toYthe second point's row (-1 if lower image border)
toXthe second point's col (-1 if right image border)
Returns:
the maximum

Implements Image.

Definition at line 177 of file StillImage.hh.

References m_coeffs, and ImageArray< T >::smin().

virtual void StillImage::to ( int  y,
int  x,
coeff  val 
) [inline, virtual]

Set a value. Sets the value at row {y} and col {x}.

Parameters:
ythe row
xthe col
valthe new value
Returns:
the value

Implements Image.

Definition at line 63 of file StillImage.hh.

References m_coeffs, and ImageArray< T >::to().

virtual void StillImage::to ( int  abs,
coeff  val 
) [inline, virtual]

Set a value. Sets the value at absolute position {abs}.

Parameters:
absthe position
valthe new value

Implements Image.

Definition at line 69 of file StillImage.hh.

References m_coeffs, and ImageArray< T >::to().

virtual void StillImage::write ( char const *  fname,
bool  beautify = false 
) [virtual]

Write an image (abstract). Writes an image to a file guessing the file type from the file name's extension.

Parameters:
fnamethe file name, if {NULL}, then {stdout}
beautifybeautify images that have not had more analysis than synthesis steps?

Implements Image.

virtual void StillImage::write ( char const *  fname,
filetype  ftype,
bool  beautify = false 
) [virtual]

Write an image (abstract). Writes an image to a file using the specified file type.

Parameters:
ftypethe file type
fnamethe file name, if {NULL}, then {stdout}
beautifybeautify images that have not had more analysis than synthesis steps?

Implements Image.


Member Data Documentation

The image values. The image values are stored in a two-dimensional array.

Definition at line 259 of file StillImage.hh.

Referenced by aaverage(), abs(), amax(), amin(), at(), saverage(), smax(), smin(), and to().

This is true if the `m_coeffs' member variable is private to the object and must therefore be deleted at object destruction

Definition at line 263 of file StillImage.hh.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines