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

#include <Image.hh>

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

List of all members.

Public Member Functions

 Image (void)
virtual ~Image (void)
int rows (void) const
int cols (void) const
int size (void) const
ColumnVectorcol (int x=0)
RowVectorrow (int y=0)
FullVectorfull (int xy=0)
virtual coeff at (int y, int x) const =0
virtual coeff at (int abs) const =0
virtual void to (int y, int x, coeff val)=0
virtual void to (int abs, coeff val)=0
virtual int abs (int y, int x) const =0
virtual bool epsilons (Image &img, coeff epsilon) const =0
bool epsilonsAt (int y, int x, coeff value, coeff epsilon) const
bool epsilonsAt (int abs, coeff value, coeff epsilon) const
virtual bool equals (Image &img) const =0
virtual double iproduct (Image &img) const
virtual void normalize (coeff factor)
virtual void unnormalize (coeff factor)
virtual void gammaCorrection (double factor, int yoffs=0, int xoffs=0, int ysize=-1, int xsize=-1, int norm=255)
double gammaCorrectionAuto (int rows, int columns, int yoffs=0, int xoffs=0, int ysize=-1, int xsize=-1, int norm=255)
virtual void histEqualization (int yoffs=0, int xoffs=0, int ysize=-1, int xsize=-1, int startH=0, int endH=255)
virtual void beautify (int yoffs=0, int xoffs=0, int ysize=0, int xsize=0)
virtual void truncate (coeff min=0, coeff max=255)
virtual void pixelize (void)
void valadjust (void)
virtual void read (char const *fname, int rawy=0, int rawx=0)=0
virtual void read (char const *fname, filetype ftype, int rawy=0, int rawx=0)=0
virtual void write (char const *fname, bool beautify=false)=0
virtual void write (char const *fname, filetype ftype, bool beautify=false)=0
virtual void importCoeffs (int rows, int cols, coeff *buf)
virtual coeffexportCoeffs (void)
virtual void importPixels (int rows, int cols, pixel *buf)
virtual pixelexportPixels (void) const
virtual Imageclone (void) const =0
virtual void copy (Image &img)
Imagecrop (int yoffs, int xoffs, int ysize, int xsize) const
virtual void paste (int yoffs, int xoffs, Image &img)
virtual void shift (int yoffs, int xoffs)
int anasteps (void) const
int synsteps (void) const
void anasteps (int steps)
void synsteps (int steps)
void fill (coeff value, int fromY=0, int fromX=0, int toY=-1, int toX=-1)
virtual coeff smax (int fromY=0, int fromX=0, int toY=-1, int toX=-1) const =0
virtual coeff smin (int fromY=0, int fromX=0, int toY=-1, int toX=-1) const =0
virtual coeff amax (int fromY=0, int fromX=0, int toY=-1, int toX=-1) const =0
virtual coeff amin (int fromY=0, int fromX=0, int toY=-1, int toX=-1) const =0
virtual coeff saverage (int fromY=0, int fromX=0, int toY=-1, int toX=-1) const =0
virtual coeff aaverage (int fromY=0, int fromX=0, int toY=-1, int toX=-1) const =0
virtual coeff sqvariance (int fromY=0, int fromX=0, int toY=-1, int toX=-1) const
virtual coeff variance (int fromY, int fromX, int toY, int toX, coeff avg, bool abs) const
virtual coeff variance (int fromY=0, int fromX=0, int toY=-1, int toX=-1, bool abs=false) const
virtual coeff sdeviation (int fromY=0, int fromX=0, int toY=-1, int toX=-1, bool abs=false) const
virtual void resize (int rows, int cols)=0
virtual ImagefitInto (int rows, int cols, int fill=-1, int function=0) const
virtual ImagefitInto (int rows, int cols, bool mirrorExtend, int function=0) const
virtual ImagefitInto (int rows, int cols, ExtendFunc extend, int function=0) const
virtual ImagefitInto (int rows, int cols, ResizeFillFunc *fillFunc, int function=0) const
virtual Imagescale (double factor, int function=0) const
virtual Imagescale (double yFactor, double xFactor, int function=0) const

Protected Member Functions

void dimcheck (const Image &img) const
virtual ImagemkImage (int rows=0, int cols=0) const =0

Protected Attributes

ColumnVectorm_acol
RowVectorm_arow
FullVectorm_afull
int m_ysize
int m_xsize
int m_xysize
int m_asteps
int m_ssteps

Detailed Description

An image (abstract). A (grey-scale) more-than-one-dimensional image.

Definition at line 70 of file Image.hh.


Constructor & Destructor Documentation

Image::Image ( void  )

Constructor. Only sets standard values.

virtual Image::~Image ( void  ) [inline, virtual]

Destructor. Does nothing.

Definition at line 78 of file Image.hh.


Member Function Documentation

virtual coeff Image::aaverage ( int  fromY = 0,
int  fromX = 0,
int  toY = -1,
int  toX = -1 
) const [pure 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

Implemented in StillImage.

virtual int Image::abs ( int  y,
int  x 
) const [pure virtual]

Return the absolute offset of a position.

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

Implemented in StillImage.

virtual coeff Image::amax ( int  fromY = 0,
int  fromX = 0,
int  toY = -1,
int  toX = -1 
) const [pure 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 maximum

Implemented in StillImage.

virtual coeff Image::amin ( int  fromY = 0,
int  fromX = 0,
int  toY = -1,
int  toX = -1 
) const [pure 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

Implemented in StillImage.

int Image::anasteps ( void  ) const [inline]

Returns the number of analysis steps performed so far.

Returns:
the number of steps

Definition at line 434 of file Image.hh.

void Image::anasteps ( int  steps) [inline]

Sets the number of analysis steps performed so far.

Parameters:
stepsthe number of steps

Definition at line 442 of file Image.hh.

virtual coeff Image::at ( int  y,
int  x 
) const [pure virtual]

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

Parameters:
ythe row
xthe col
Returns:
the value

Implemented in StillImage.

virtual coeff Image::at ( int  abs) const [pure virtual]

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

Parameters:
absthe position
Returns:
the value

Implemented in StillImage.

virtual void Image::beautify ( int  yoffs = 0,
int  xoffs = 0,
int  ysize = 0,
int  xsize = 0 
) [virtual]

Do an intelligent kind of beautification considering previous transform steps. The original data will be overwritten, so this should only be used on clones or if the image is not going to be transformed afterwise. One region inside the image could be the low-pass subband and should thus be handled separately. If that is desired, the {ysize} and {xsize} parameters should be set to nonzero values.

Parameters:
yoffsthe horizontal offset of the region that should be handled separately
xoffsthe vertical offset of the region that should be handled separately
ysizethe horizontal size of the region that should be handled separately
xsizethe vertical size of the region that should be handled separately
virtual Image* Image::clone ( void  ) const [pure virtual]

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

Returns:
the new, copied object.

Implemented in StillImage, and VideoFrame.

ColumnVector& Image::col ( int  x = 0) [inline]

Return a column reference. Returns a pseudo-vector that provides a reference to one column of the image.

Parameters:
xThe number of the column to be returned
Returns:
the column reference

Definition at line 99 of file Image.hh.

References ColumnVector::go().

int Image::cols ( void  ) const [inline]

Return the number of columns.

Returns:
the number of columns

Definition at line 87 of file Image.hh.

Referenced by StillImage::makeEmpty().

virtual void Image::copy ( Image img) [virtual]

Copy all data from a source image.

Parameters:
imgthe source image
Image* Image::crop ( int  yoffs,
int  xoffs,
int  ysize,
int  xsize 
) const

Returns a subimage.

Parameters:
yoffsthe row where to start
xoffsthe col where to start
ysizethe vertical size
xsizethe horizontal size
Returns:
the new image
void Image::dimcheck ( const Image img) const [protected]

Make sure the other image's dimensions match.

Exceptions:
invalid_argumentThe other image's dimensions differ
Parameters:
imgthe other image
virtual bool Image::epsilons ( Image img,
coeff  epsilon 
) const [pure virtual]

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

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

Implemented in StillImage.

bool Image::epsilonsAt ( int  y,
int  x,
coeff  value,
coeff  epsilon 
) const

Rough comparison. See if an image value is equal to some value according to a given {epsilon} (important for floating-point comparisons).

Parameters:
ythe row
xthe col
valuethe value to compare to
epsilonthe epsilon
Returns:
if both are identical: {true}, else {false}
bool Image::epsilonsAt ( int  abs,
coeff  value,
coeff  epsilon 
) const

Rough comparison. See if an image value is equal to some value according to a given {epsilon} (important for floating-point comparisons).

Parameters:
absthe absolute position
valuethe value to compare to
epsilonthe epsilon
Returns:
if both are identical: {true}, else {false}
virtual bool Image::equals ( Image img) const [pure virtual]

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

Parameters:
imgThe other {Image} object
Returns:
if equals: {true}, else {false}

Implemented in StillImage.

virtual coeff* Image::exportCoeffs ( void  ) [virtual]

Exports an image.

Returns:
a new buffer holding the image coefficients (consists of rows * cols elements)
virtual pixel* Image::exportPixels ( void  ) const [virtual]

Exports a raw image. Values exceeding the 0..255 range will be truncated.

Returns:
a new buffer holding the image pixels (consists of rows * cols elements)
void Image::fill ( coeff  value,
int  fromY = 0,
int  fromX = 0,
int  toY = -1,
int  toX = -1 
)

Fills an image (or regions of it) with a given value

Parameters:
valthe new value for the selected positions
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)
virtual Image* Image::fitInto ( int  rows,
int  cols,
int  fill = -1,
int  function = 0 
) const [virtual]

Produce a scaled version of the image which just fits into the given dimensions. If the aspect ratio does not fit into the new dimensions the remaining areas can be filled with a given color or alternatively the resulting image will be smaller than the target dimensions keeping its aspect ratio.

Exceptions:
invalid_argumentthe factor is negative or the function argument is invalid
Parameters:
rowsthe target number of rows
colsthe target number of columns
fillif not less than zero use this to fill remaining space (else the a smaller image size will be chosen if the aspect ratio does not match)
functioninterpolation function (0: bilinear interpolation, 1: average, 2: nearest neighbour).
Returns:
a new rescaled image
virtual Image* Image::fitInto ( int  rows,
int  cols,
bool  mirrorExtend,
int  function = 0 
) const [virtual]

Produce a scaled version of the image which just fits into the given dimensions. If the aspect ratio does not fit into the new dimensions the remaining areas can be filled with a given color or alternatively the resulting image will be smaller than the target dimensions keeping its aspect ratio. This method is deprecad. Use the one with the enumeration ar instead.

Exceptions:
invalid_argumentthe factor is negative or the function argument is invalid
Parameters:
rowsthe target number of rows
colsthe target number of columns
mirrorExtendif true, the otherwise empty regions of the image are extended by a mirroring function (else the a smaller image size will be chosen if the aspect ratio does not match)
functioninterpolation function (0: bilinear interpolation, 1: average, 2: nearest neighbour).
Returns:
a new rescaled image
virtual Image* Image::fitInto ( int  rows,
int  cols,
ExtendFunc  extend,
int  function = 0 
) const [virtual]

Produce a scaled version of the image which just fits into the given dimensions. If the aspect ratio does not fit into the new dimensions the remaining areas can be filled with a given color or alternatively the resulting image will be smaller than the target dimensions keeping its aspect ratio.

Exceptions:
invalid_argumentthe factor is negative or the function argument is invalid
Parameters:
rowsthe target number of rows
colsthe target number of columns
extendthe type of extension function used if the aspect ratio does not match (else the a smaller image size will be chosen if the aspect ratio does not match)
functioninterpolation function (0: bilinear interpolation, 1: average, 2: nearest neighbour).
Returns:
a new rescaled image
virtual Image* Image::fitInto ( int  rows,
int  cols,
ResizeFillFunc fillFunc,
int  function = 0 
) const [virtual]

Produce a scaled version of the image which just fits into the given dimensions. If the aspect ratio does not fit into the new dimensions the remaining areas can be filled with a given color or alternatively the resulting image will be smaller than the target dimensions keeping its aspect ratio.

Exceptions:
invalid_argumentthe factor is negative or the function argument is invalid
Parameters:
rowsthe target number of rows
colsthe target number of columns
fillFuncif not NULL a function for filling otherwise empty regions (else the a smaller image size will be chosen if the aspect ratio does not match)
functioninterpolation function (0: bilinear interpolation, 1: average, 2: nearest neighbour).
Returns:
a new rescaled image
FullVector& Image::full ( int  xy = 0) [inline]

Return a full reference. Returns a pseudo-vector that provides a reference to the image as a big vector.

Parameters:
xyThe position where to start
Returns:
the full reference

Definition at line 114 of file Image.hh.

References FullVector::go().

virtual void Image::gammaCorrection ( double  factor,
int  yoffs = 0,
int  xoffs = 0,
int  ysize = -1,
int  xsize = -1,
int  norm = 255 
) [virtual]

Perform a gamma correction. Since this is normally only defined for the spatial domain (the pixels need to be normalized) the normalization factor is set to 255 by default, if values are found in the image outside the specified [0..norm] range, the range will be increased. If the range is increased a new normalization factor is automatically calculated as the difference between the image's maximum (if more than norm) and minimum (if less than 0) coefficient value.

Parameters:
factorthe gamma factor (0..1.0)
ysizethe horizontal size of the region to process
xsizethe vertical size of the region to process
yoffsthe horizontal offset of the region to process
xoffsthe vertical offset of the region to process
normthe normalization factor ( default = 255 )
double Image::gammaCorrectionAuto ( int  rows,
int  columns,
int  yoffs = 0,
int  xoffs = 0,
int  ysize = -1,
int  xsize = -1,
int  norm = 255 
)

Does a automatic gamma correction. This function breaks the image up into smaller matrices and then calculates their averages. The highest and lowest average is then used to calculate a gamma value which is used to a parameter in a call to gammaCorrection().

Note:
If the image can not be split into the required sub-areas without a remainder the nearest solution (down) is used.
Parameters:
rowsSplit image horizontly into subsections
columnsSplit image vertically into subsections
yoffsVertical offset
xoffsHorizontal offset
ysizeVertical size
xsizeHorizontal size
normthe normalization factor ( default = 255 )
Returns:
the gamma value - (use it to undo operation if needed)
virtual void Image::histEqualization ( int  yoffs = 0,
int  xoffs = 0,
int  ysize = -1,
int  xsize = -1,
int  startH = 0,
int  endH = 255 
) [virtual]

Perform a histogram equalisation. The operation performs a floating-point to int quantisation and uses a given color range if 0..255 is not desired. Explicit values for the color range can be necessary e.g. for Wavelet-decomposed images; for example for Haar LL Level 1 a good choice would be 0..1023 and -512..511 for Haar non LL Level 1. Code provided by Johan Ehlers.

Warning:
Use unnormalised coefficients else the operation has un-determinable results.
Parameters:
ysizethe horizontal size of the region to process
xsizethe vertical size of the region to process
yoffsthe horizontal offset of the region to process
xoffsthe vertical offset of the region to process
startHthe start value for range of histogram default = 0
endHthe end value for the range of the histogram default = 255
virtual void Image::importCoeffs ( int  rows,
int  cols,
coeff buf 
) [virtual]

Import an image. The values will be copied.

Parameters:
rowsthe number of image rows (logical)
colsthe number of image cols (logical)
bufthe buffer holding the image coefficients (consists of rows * cols elements)
virtual void Image::importPixels ( int  rows,
int  cols,
pixel buf 
) [virtual]

Import a raw image. The values will be copied.

Parameters:
rowsthe number of image rows (logical)
colsthe number of image cols (logical)
bufthe buffer holding the image pixels (consists of rows * cols elements)
virtual double Image::iproduct ( Image img) const [virtual]

Computes the inner product between this and another image. Both images have to have identical dimensions.

Exceptions:
invalid_argumentThe images don't have identical dimensions
Parameters:
imgThe other {Image} object
Returns:
the inner product
virtual Image* Image::mkImage ( int  rows = 0,
int  cols = 0 
) const [protected, pure virtual]

Abstract 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

Implemented in StillImage.

virtual void Image::normalize ( coeff  factor) [virtual]

Normalize coefficients.

Parameters:
factorthe normalization factor
virtual void Image::paste ( int  yoffs,
int  xoffs,
Image img 
) [virtual]

Inserts a subimage.

Parameters:
yoffsthe row where to start
xoffsthe col where to start
imgthe image to insert
virtual void Image::pixelize ( void  ) [virtual]

First truncate the values to the [0..255] range, and then round them to integer numbers.

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

Read an image (abstract). Reads an image from a file guessing the file type from the file name's extension.

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)

Implemented in StillImage.

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

Read an image (abstract). Reads an image from a file using the specified file type.

Parameters:
fnamethe file name, if {NULL}, then {stdin}
ftypethe file type (image format)
rawythe number of rows (only needed for RAW format)
rawxthe number of cols (only needed for RAW format)

Implemented in StillImage.

virtual void Image::resize ( int  rows,
int  cols 
) [pure 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

Implemented in StillImage.

RowVector& Image::row ( int  y = 0) [inline]

Return a row reference. Returns a pseudo-vector that provides a reference to one row of the image.

Parameters:
yThe number of the row to be returned
Returns:
the row reference

Definition at line 106 of file Image.hh.

References RowVector::go().

int Image::rows ( void  ) const [inline]

Return the number of rows.

Returns:
the number of rows

Definition at line 83 of file Image.hh.

Referenced by StillImage::makeEmpty().

virtual coeff Image::saverage ( int  fromY = 0,
int  fromX = 0,
int  toY = -1,
int  toX = -1 
) const [pure 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

Implemented in StillImage.

virtual Image* Image::scale ( double  factor,
int  function = 0 
) const [virtual]

Produce a scaled version of the image. The aspect ratio will remain the same.

Exceptions:
invalid_argumentthe factor is negative or the function argument is invalid
Parameters:
factorthe scale factor (>= 0, 1 for no change)
functioninterpolation function (0: bilinear interpolation, 1: average, 2: nearest neighbour).
Returns:
a new rescaled image
virtual Image* Image::scale ( double  yFactor,
double  xFactor,
int  function = 0 
) const [virtual]

Produce a scaled version of the image. The aspect ratio depends on the two scale factors

Exceptions:
invalid_argumentthe factor is negative or the function argument is invalid
Parameters:
yFactorthe vertical scale factor (>= 0, 1 for no change)
xFactorthe horizontal scale factor (>= 0, 1 for no change)
functioninterpolation function (0: bilinear interpolation, 1: average, 2: nearest neighbour).
Returns:
a new rescaled image
virtual coeff Image::sdeviation ( int  fromY = 0,
int  fromX = 0,
int  toY = -1,
int  toX = -1,
bool  abs = false 
) const [virtual]

Returns the standard deviation for a rectangular region inside the image drawn from one point within and the second point just outside the region. Signs will be considered. Use this method if you want statistics on a region in the image. For other cases you may want to use ImageInformation::sdeviation().

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)
abstrue if signs are discarded
Returns:
the standard deviation.
virtual void Image::shift ( int  yoffs,
int  xoffs 
) [virtual]

Shift an Image.

Parameters:
yoffsthe rows to shift
xoffsthe cols to shift
int Image::size ( void  ) const [inline]

Return the overall size.

Returns:
the overall size

Definition at line 91 of file Image.hh.

virtual coeff Image::smax ( int  fromY = 0,
int  fromX = 0,
int  toY = -1,
int  toX = -1 
) const [pure 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

Implemented in StillImage.

virtual coeff Image::smin ( int  fromY = 0,
int  fromX = 0,
int  toY = -1,
int  toX = -1 
) const [pure 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

Implemented in StillImage.

virtual coeff Image::sqvariance ( int  fromY = 0,
int  fromX = 0,
int  toY = -1,
int  toX = -1 
) const [virtual]

Return the square variance for a rectangular region inside the image drawn from one point within and the second point just outside the region. Signs will be considered. Use this method if you want statistics on a region in the image. For other cases you may want to use ImageInformation::sqvariance().

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 square variance
int Image::synsteps ( void  ) const [inline]

Returns the number of synthesis steps performed so far.

Returns:
the number of steps

Definition at line 438 of file Image.hh.

void Image::synsteps ( int  steps) [inline]

Sets the number of synthesis steps performed so far.

Parameters:
stepsthe number of steps

Definition at line 446 of file Image.hh.

virtual void Image::to ( int  y,
int  x,
coeff  val 
) [pure virtual]

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

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

Implemented in StillImage.

virtual void Image::to ( int  abs,
coeff  val 
) [pure virtual]

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

Parameters:
absthe position
valthe new value

Implemented in StillImage.

virtual void Image::truncate ( coeff  min = 0,
coeff  max = 255 
) [virtual]

Do a dumb kind of beautification by just truncating values to their possible maxima depending on the image format or whatever. The original data will be overwritten, so this should only be used on clones or if the original data is not needed anymore.

Parameters:
minthe minimum allowed value
maxthe maximum allowed value
virtual void Image::unnormalize ( coeff  factor) [virtual]

Unnormalize coefficients.

Parameters:
factorthe unnormalization factor
void Image::valadjust ( void  )

Adjust the coefficients to make them pixelizable.

virtual coeff Image::variance ( int  fromY,
int  fromX,
int  toY,
int  toX,
coeff  avg,
bool  abs 
) const [virtual]

Return the variance for a rectangular region inside the image drawn from one point within and the second point just outside the region. Use this method if you want statistics on a region in the image. For other cases you may want to use ImageInformation::variance(). This version of the method takes the average (either absolute or signed) as argument so that it does not need to be calculated again.

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)
avgthe average for the region
abstrue if signs are discarded
Returns:
the square variance
virtual coeff Image::variance ( int  fromY = 0,
int  fromX = 0,
int  toY = -1,
int  toX = -1,
bool  abs = false 
) const [virtual]

Return the variance for a rectangular region inside the image drawn from one point within and the second point just outside the region. Use this method if you want statistics on a region in the image. For other cases you may want to use ImageInformation::variance().

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)
abstrue if signs are discarded
Returns:
the square variance
virtual void Image::write ( char const *  fname,
bool  beautify = false 
) [pure 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?

Implemented in StillImage.

virtual void Image::write ( char const *  fname,
filetype  ftype,
bool  beautify = false 
) [pure 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?

Implemented in StillImage.


Member Data Documentation

Column reference. A vector that can be set to any column to allow iterating over its values.

Definition at line 704 of file Image.hh.

FullVector* Image::m_afull [protected]

Full reference. A vector that can be set anywhere within the pixels to iterating over its values.

Definition at line 710 of file Image.hh.

RowVector* Image::m_arow [protected]

Row reference. A vector that can be set to any row to allow iterating over its values.

Definition at line 707 of file Image.hh.

int Image::m_asteps [protected]

The number of steps performed in the last analysis.

Definition at line 718 of file Image.hh.

int Image::m_ssteps [protected]

The number of steps performed in the last synthesis.

Definition at line 720 of file Image.hh.

int Image::m_xsize [protected]

Number of cols.

Definition at line 714 of file Image.hh.

int Image::m_xysize [protected]

Overall size.

Definition at line 716 of file Image.hh.

int Image::m_ysize [protected]

Number of rows.

Definition at line 712 of file Image.hh.


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