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

#include <Histogram.hh>

Collaboration diagram for Histogram:
Collaboration graph
[legend]

List of all members.

Classes

struct  hist

Public Member Functions

 Histogram (Image &img, double dlt=1.0)
 Histogram (ImageInformation &ii, double dlt=1.0)
 ~Histogram (void)
int at (int pos, coeff &lower)
int at (coeff value)
int size (void)
double delta (void)
void update (void)
void print (void)
void add (coeff value, int number)

Protected Attributes

Imagem_image
ImageInformationm_data
ImageInformationm_ii
double m_dlt
struct histm_values
int m_nvals

Detailed Description

A class for histograms.

Definition at line 21 of file Histogram.hh.


Constructor & Destructor Documentation

Histogram::Histogram ( Image img,
double  dlt = 1.0 
)

Constructor. Creates the histogram from an Image object.

Exceptions:
invalid_argumenta zero value for {dlt} was specified
Parameters:
imgthe image to look at
dltthe quantization step (necessary for histograms in the DWT domain
Histogram::Histogram ( ImageInformation ii,
double  dlt = 1.0 
)

Constructor. Creates the histogram from an ImageInformation object.

Exceptions:
invalid_argumenta zero value for {dlt} was specified
Parameters:
iithe image data to look at (will be duplicated)
dltthe quantization step (necessary for histograms in the DWT domain

Destructor. Releases allocated memory


Member Function Documentation

void Histogram::add ( coeff  value,
int  number 
)

Add an occurrence number for a given value.

Exceptions:
invalid_argumentadding number would make the result negative
Parameters:
valuethe value
numberthe number to be added
int Histogram::at ( int  pos,
coeff lower 
)

Get a value via an index.

Exceptions:
invalid_argumentthe index {pos} is out of bounds.
Parameters:
posThe index position.
lowerThe lower greyscale boundary (returned value).
Returns:
the value
int Histogram::at ( coeff  value)

Get a value via a greyscale value.

Parameters:
valuethe greyscale value.
Returns:
the value
double Histogram::delta ( void  ) [inline]

Get the histogram's delta.

Returns:
the delta

Definition at line 62 of file Histogram.hh.

References m_dlt.

void Histogram::print ( void  )

Print the histogram to stdout.

int Histogram::size ( void  ) [inline]

Return the number of numbers stored.

Returns:
the number of numbers.

Definition at line 59 of file Histogram.hh.

References m_nvals.

void Histogram::update ( void  )

Update the Histogram. This may be necessary after changes to the image.


Member Data Documentation

A pointer as a reference to the ImageInformation object (needs to be stored in order to be able to update the histogram after changes to the original image).

Definition at line 82 of file Histogram.hh.

double Histogram::m_dlt [protected]

The delta between two histogram slots.

Definition at line 86 of file Histogram.hh.

Referenced by delta().

A helper object for getting the image's coefficients sorted.

Definition at line 84 of file Histogram.hh.

Image* Histogram::m_image [protected]

A pointer as a reference to the image.

Definition at line 78 of file Histogram.hh.

int Histogram::m_nvals [protected]

The number of histogram slots.

Definition at line 99 of file Histogram.hh.

Referenced by size().

struct hist* Histogram::m_values [protected]

The internal histogram (an array of hist structs).

Definition at line 97 of file Histogram.hh.


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