Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

halftoner::Image Class Reference

#include <Image.h>

List of all members.


Detailed Description

Class Image represents 8-bit per pixel image.

Definition at line 37 of file Image.h.

Public Methods

Accessors
Mutators

Static Public Methods

Class method

Private Methods

Special accessors

Private Attributes

Instance variables

Constructor & Destructor Documentation

halftoner::Image::Image int    width,
int    height
throw (std::invalid_argument)
 

Constructor.

Parameters:
width  the width of the image.
height  the height of the image.
Exceptions:
std::invalid_argument  if either width or height are smaller than or equal to 0

Definition at line 38 of file Image.cxx.

halftoner::Image::~Image   throw ()
 

Destructor.

Definition at line 61 of file Image.cxx.


Member Function Documentation

int halftoner::Image::calculateOffset int    x,
int    y,
int    width
throw () [static]
 

Calculates the linear offset of the specified point.

Parameters:
x  the column.
y  the row.
width  the width of the line.
Returns :
the linear offset, row major.

Definition at line 151 of file Image.cxx.

int halftoner::Image::getColorAt int    x,
int    y
const throw (std::out_of_range)
 

Returns the color at the specified pixel.

Parameters:
x  the column.
y  the row.
Returns :
the color of the pixel at that position.
Exceptions:
std::out_of_range  if the position is not within the canvas, in other words, if x < 0 || x >= width || y < 0 || y >= height

Definition at line 86 of file Image.cxx.

unsigned char * halftoner::Image::getCopy   const throw ()
 

Returns a copy of the raw pixels.

Returns :
a copy of the raw pixels.

Definition at line 133 of file Image.cxx.

Referenced by halftoner::ImageIO::savePBMraw(), halftoner::ErrorDiffusionHalftoner::scanline(), and halftoner::ErrorDiffusionHalftoner::serpentine().

int halftoner::Image::getHeight   const throw ()
 

Returns the height of the image.

Returns :
the height.

Definition at line 81 of file Image.cxx.

Referenced by halftoner::ErrorDiffusionHalftoner::scanline(), and halftoner::ErrorDiffusionHalftoner::serpentine().

unsigned char * halftoner::Image::getPixel int    x,
int    y
const throw (std::out_of_range) [private]
 

Returns the address of the specified pixel.

Parameters:
x  the column.
y  the row.
Returns :
the address of the pixel.
Exceptions:
std::out_of_range  if the position is not within the canvas, in other words, if x < 0 || x >= width || y < 0 || y >= height

Definition at line 115 of file Image.cxx.

unsigned char * halftoner::Image::getPixels   const throw () [private]
 

Returns the raw pixels.

Returns :
the raw pixels.

Definition at line 71 of file Image.cxx.

int halftoner::Image::getWidth   const throw ()
 

Returns the width of the image.

Returns :
the width.

Definition at line 76 of file Image.cxx.

Referenced by halftoner::ErrorDiffusionHalftoner::scanline(), and halftoner::ErrorDiffusionHalftoner::serpentine().

void halftoner::Image::setColorAt int    x,
int    y,
int    color
throw (std::out_of_range)
 

Changes the color at the specified pixel.

Parameters:
x  the column.
y  the row.
color  the new color.
Exceptions:
std::out_of_range  if the position is not within the canvas, in other words, if x < 0 || x >= width || y < 0 || y >= height

Definition at line 93 of file Image.cxx.

Referenced by halftoner::VGexp::halftone(), halftoner::VG95::halftone(), halftoner::VG91::halftone(), halftoner::ImageIO::loadPGM(), and halftoner::ErrorDiffusionHalftoner::scanline().

void halftoner::Image::setLine int    line,
int *    colors,
int    width
throw (std::out_of_range)
 

Changes one line.

Parameters:
line  the line to change.
colors  the new colors.
width  the number of pixel to copy.
Exceptions:
std::out_of_range  if this->getWidth() != colors_size.
std::out_of_range  if line < 0 || line >= this->getHeight().

Definition at line 99 of file Image.cxx.

Referenced by halftoner::ErrorDiffusionHalftoner::serpentine().


Member Data Documentation

int halftoner::Image::height [private]
 

The height of the image.

Definition at line 47 of file Image.h.

unsigned char* halftoner::Image::pixels [private]
 

The raw pixels.

Definition at line 43 of file Image.h.

int halftoner::Image::width [private]
 

The width of the image.

Definition at line 45 of file Image.h.


The documentation for this class was generated from the following files:
Generated on Sat Sep 7 16:35:54 2002 for Halftoning Library by doxygen1.2.17