class Image

This class is designed to handle images

Inheritance:


Public Fields

[more] data and pixmap fields
[more] image size fields
[more] other fields

Public Methods

[more] constructors and destructor
[more] copy methods
[more]unsigned char* get(int y_, int x_)
Access a byte pixel value.
[more]real* getr(int y_, int x_)
Access a real pixel value.
[more] synchronization methods
[more] load/save methods
[more] drawing methods
[more] other methods

Protected Methods

[more]void imageRealloc()
memory allocation/re-allocation


Documentation

This class is designed to handle images

An image is stored as a sequence of one frame in interleaved format (ex: rgbrgb...rgb). Consequently, n_frames = 1 and frames[0] contains the image.

ovoid imageRealloc()
memory allocation/re-allocation

o data and pixmap fields

oreal* data
The image in real idem as frames[0]

ounsigned char* pixmap
Also the image but in bytes

o image size fields

oint width
width of the image

oint height
height of the image

oint image_size
Number of pixels of the image (in use)

oint real_image_size
Real number of pixels allocated

oint n_planes
Number of color planes (channels)

o other fields

ochar* coding
Coding format. Could be "rgb", "yuv", "gray" ...

obool verbose
verbose

o constructors and destructor

o Image()
Creates an empty image

o Image(int width_, int height_, int n_planes_)
Creates a black image.

Parameters:
width_ - is the width of the image
height_ - is the height of the image
n_planes_ - is the number of color components of the image (3 for RGB, 1 for gray)

ovirtual ~Image()

o copy methods

ovirtual bool copyFrom(int width_, int height_, unsigned char* pixmap_, const char* coding_) = 0
Copy from an image (in bytes).

Parameters:
width_ - is the width of the image to copy
height_ - is the height of the image to copy
pixmap_ - is the image (in bytes) to copy into pixmap and data
coding_ - is the coding of the pixmap_ to copy

ovirtual bool copyFrom(int width_, int height_, real* data_, const char* coding_, real max_ = 255.0) = 0
Copy from an image (in real).

Parameters:
width_ - is the width of the image to copy
height_ - is the height of the image to copy
data_ - is the image (in real) to copy into pixmap and data
coding_ - is the coding of the data_ to copy
max_ - is the range of pixel values in data_

ovirtual bool copyFrom(Image* image_) = 0
Copy an image from another image.

Parameters:
image_ - is the image to copy

ounsigned char* get(int y_, int x_)
Access a byte pixel value.

Parameters:
y_ - is the line coordinate
x_ - is the column coordinate
Returns:
the address of the pixel at the given coordinates

oreal* getr(int y_, int x_)
Access a real pixel value.

Parameters:
y_ - is the line coordinate
x_ - is the column coordinate
Returns:
the address of the pixel at the given coordinates

o synchronization methods

ovirtual void updateDataFromPixmap()
update the field data from the field pixmap

ovirtual void updatePixmapFromData()
update the field pixmap from the field data

o load/save methods

ovirtual bool saveImageXFile(ImageDiskXFile* file)
save the image using an ImageDiskXFile.

Parameters:
file - is the ImageDiskXFile to use to save the image

ovirtual bool loadImageXFile(ImageDiskXFile* file)
load the image using an ImageDiskXFile.

Parameters:
file - is the ImageDiskXFile to use to load the image

ovirtual void saveXFile(XFile* file)
save the image

ovirtual void loadXFile(XFile* file)
load the image

o drawing methods

ovirtual void drawpixel(int x_, int y_, Color c) = 0
draw a pixel in the image.

Parameters:
x_ - is the x coordinate of the pixel to draw
y_ - is the y coordinate of the pixel to draw
c - is the color to draw

ovoid drawline(int x1, int y1, int x2, int y2, Color c)
draw a line P1-P2 in the image.

Parameters:
x1 - is the x coordinate of P1
y1 - is the y coordinate of P1
x2 - is the x coordinate of P2
y2 - is the y coordinate of P2
c - is the color to draw

ovoid drawline(double x1, double y1, double x2, double y2, Color c)
draw a line P1-P2 in the image.

Parameters:
x1 - is the x coordinate of P1
y1 - is the y coordinate of P1
x2 - is the x coordinate of P2
y2 - is the y coordinate of P2
c - is the color to draw

o other methods

ovoid setImageId(int image_id_)
setting image id

oint getImageId()
getting image id


Direct child classes:
ImageRgb
ImageGray
Author:
Sebastien Marcel (marcel@idiap.ch)
Version:
2.0 Wed 28 Jun 2006 05:19:21 PM CEST
Since:
1.0

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.