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

#include <ImageInformation.hh>

Collaboration diagram for ImageInformation:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ImageInformation (int size=0)
 ImageInformation (Image &img)
 ~ImageInformation (void)
int size (void) const
ImageInformationhead (int n)
ImageInformationtail (int n)
ImageInformationappend (ImageInformation &ii)
ImageInformationclone (void)
void shrink (int newsize, bool leavehead=true)
bool equals (ImageInformation &ii)
CoeffInformationat (int pos)
void to (CoeffInformation &c, int pos)
void to (const CoeffInformation &c, int pos)
void resize (int size)
void swap (int pos1, int pos2)
void gensort (cipredicate isless)
void ssort (void)
void asort (void)
void psort (void)
void yxsort (void)
void xysort (void)
void isort (void)
void shuffle (void)
bool ssorted (void) const
bool asorted (void) const
bool psorted (void) const
bool isorted (void) const
bool isIn (int abs) const
bool isIn (int y, int x) const
int locate (int abs) const
int locate (int y, int x) const
coeff amax (void)
coeff smax (void)
coeff amin (void)
coeff smin (void)
void dump (const char *delim=" ", const char *file="") const
coeff aaverage (void) const
coeff saverage (void) const
double sqvariance (void) const
double variance (bool abs=false) const
double sdeviation (bool abs=false) const

Protected Member Functions

void copyCoeffs (CoeffInformation *coeffs, int size, bool head)
ImageInformationsubimage (int size, bool head)
int randint (int from, int to)
void quicksort (int from, int to, cipredicate isless)

Protected Attributes

CoeffInformationm_coeffs
int m_size

Detailed Description

Image information. The information consists coefficient information nodes, so the original image can be reconstructed from this. Tool methods for sorting, shuffleing etc. are used for watermark.

Definition at line 35 of file ImageInformation.hh.


Constructor & Destructor Documentation

Constructor. Initializes a number of empty components.

Parameters:
sizethe number of components

Constructor. Gets information from an image.

Parameters:
imgthe source image

Destructor. Frees allocated objects.


Member Function Documentation

Return the average absolute greyscale value.

Returns:
the average absolute greyscale value

Get the maximum signed value from the selected coefficients.

Returns:
the maximum value

Get the minimum absolute value from the selected coefficients.

Returns:
the minimum value

Append another ImageInformation object.

Parameters:
iithe other ImageInformation object.
Returns:
a new info object containing the coeffs
void ImageInformation::asort ( void  )

Sort the coeffs according to their absolute values.

bool ImageInformation::asorted ( void  ) const

Are the coeffs sorted according to their absolute values?

Returns:
if sorted according to their values: {true}, else {false}
CoeffInformation& ImageInformation::at ( int  pos) [inline]

Return a coeff info.

Parameters:
posthe info's position in this object (array index)
Returns:
a reference to the coeff info node

Definition at line 103 of file ImageInformation.hh.

Get a copy of this.

Returns:
a new info object containing a copy of this

Definition at line 73 of file ImageInformation.hh.

void ImageInformation::copyCoeffs ( CoeffInformation coeffs,
int  size,
bool  head 
) [protected]

Obtain a subset of the coeffs.

Parameters:
coeffsthe address of the CoeffInformation array to write to
sizethe new array's size
headif {true} the subset will be taken from the top, else from the bottom
void ImageInformation::dump ( const char *  delim = " ",
const char *  file = "" 
) const

Write the contents to stdout or a file.

Exceptions:
ios_base::failureif the file could not be opened for writing.
Parameters:
delimwhat to print between two entries
filethe name of the file (empty string for stdout)

Equality test.

Parameters:
iiother info object
Returns:
if number of coeffs, order and the coeffs themselves are equal: {true}, else {false}

Sort the coeffs according to their values.

Parameters:
islessthe comparison function to use.

Get the first n coeffs.

Parameters:
nthe number of coeffs
Returns:
a new info object containing the coeffs
bool ImageInformation::isIn ( int  abs) const [inline]

Returns true if a position is in this ImageInformation object.

Parameters:
absthe absolute position in the image
Returns:
true if the position was found

Definition at line 163 of file ImageInformation.hh.

bool ImageInformation::isIn ( int  y,
int  x 
) const [inline]

Returns true if a position is in this ImageInformation object.

Parameters:
ythe row in the image
xthe col in the image
Returns:
true if the position was found

Definition at line 168 of file ImageInformation.hh.

void ImageInformation::isort ( void  )

Sort the coeffs according to their IDs.

bool ImageInformation::isorted ( void  ) const

Are the coeffs sorted according to their IDs?

Returns:
if sorted according to their IDs: {true}, else {false}
int ImageInformation::locate ( int  abs) const

Returns true a position's index if it is is in this ImageInformation object.

Parameters:
absthe absolute position in the image
Returns:
the index if found, else -1
int ImageInformation::locate ( int  y,
int  x 
) const

Returns true a position's index if it is is in this ImageInformation object.

Parameters:
ythe row in the image
xthe col in the image
Returns:
the index if found, else -1
void ImageInformation::psort ( void  )

Sort the coeffs according to their absolute positions in the image.

bool ImageInformation::psorted ( void  ) const

Are the coeffs sorted according to their position in their image?

Returns:
if sorted according to their positions: {true}, else {false}
void ImageInformation::quicksort ( int  from,
int  to,
cipredicate  isless 
) [protected]

Sort the coefficients. A Quicksort algorithm according to Jon Bentley.

Parameters:
fromthe start index
tothe end index (included in sort)
islessthe the comparison function, {true} when the left arg is less than the right one
int ImageInformation::randint ( int  from,
int  to 
) [protected]

Obtain positive pseudo-random numbers.

Parameters:
fromthe minimum number
toone more than the maximum number
Returns:
the pseudo-random number
void ImageInformation::resize ( int  size)

Resize the object preserving as many old values as possible.

Parameters:
sizethe new size

Return the average (signed) greyscale value.

Returns:
the average greyscale value
double ImageInformation::sdeviation ( bool  abs = false) const

Returns the standard deviation.

Parameters:
abstrue if signs are discarded.
Returns:
the standard deviation.
void ImageInformation::shrink ( int  newsize,
bool  leavehead = true 
)

Shrink (discard some of the coeffs).

Parameters:
newsizethe new number of coeffs, if greater than the actual size, the operation has no effect
leaveheadif {true} discard from behind, else discard from the top
void ImageInformation::shuffle ( void  )

Mix coeffs using pseudo-random numbers.

int ImageInformation::size ( void  ) const [inline]

Get the number of stored coeffs.

Returns:
the number of stored coeffs

Definition at line 51 of file ImageInformation.hh.

Get the maximum absolute value from the selected coefficients.

Returns:
the maximum value

Get the minimum signed value from the selected coefficients.

Returns:
the minimum value
double ImageInformation::sqvariance ( void  ) const

Return the square variance.

Returns:
the square variance
void ImageInformation::ssort ( void  )

Sort the coeffs according to their values.

bool ImageInformation::ssorted ( void  ) const

Are the coeffs sorted according to their values?

Returns:
if sorted according to their values: {true}, else {false}
ImageInformation* ImageInformation::subimage ( int  size,
bool  head 
) [protected]

Obtain a new info object containging a subset of the coeffs.

Parameters:
sizethe number of coeffs to be stored
headif {true} the subset will be taken from the top, else from the bottom
Returns:
the new info object
void ImageInformation::swap ( int  pos1,
int  pos2 
)

Swap two coefficients.

Parameters:
pos1the first object's position
pos2the second object's position

Get the last n coeffs.

Parameters:
nthe number of coeffs
Returns:
a new info object containing the coeffs
void ImageInformation::to ( CoeffInformation c,
int  pos 
) [inline]

Set a position from a CoeffInformation object.

Parameters:
cthe CoeffInformation object
posthe info's position in this object (array index)

Definition at line 109 of file ImageInformation.hh.

void ImageInformation::to ( const CoeffInformation c,
int  pos 
) [inline]

Set a position from a CoeffInformation object.

Parameters:
cthe CoeffInformation object
posthe info's position in this object (array index)

Definition at line 115 of file ImageInformation.hh.

double ImageInformation::variance ( bool  abs = false) const

Return the variance.

Parameters:
abstrue if signs are discarded.
Returns:
the variance
void ImageInformation::xysort ( void  )

Sort the coeffs according to their cols/rows positions in the image.

void ImageInformation::yxsort ( void  )

Sort the coeffs according to their rows/cols positions in the image.


Member Data Documentation

An array containing the coefficient nodes.

Definition at line 238 of file ImageInformation.hh.

int ImageInformation::m_size [protected]

The number of coeffs.

Definition at line 240 of file ImageInformation.hh.


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