#include <arimage.h>
Public Member Functions | |
| void | CopyTo (ARImage &image) |
| Copies the contents of the current image to another image. | |
| bool | LoadFromFile (const char *filename) |
| Loads the specified file. | |
| bool | SaveToFile (const char *filename) |
| Saves the current image to file. | |
| char * | GetFilename () |
| Returns the filename associated with the image. | |
| bool | CreateImage (int width, int height) |
| Creates a image in memory. | |
| int | GetWidth () |
| Returns the width of the image in pixels. | |
| int | GetHeight () |
| Returns the height of the image in pixels. | |
| int | GetSize () |
| Returns the total size (width * height). | |
| void | ClearImage () |
| Clears the current image by setting all red,green,blue and alpha values to 0 (black). | |
| void | FlipHorizontal () |
| Turns the image upside down. | |
| void | Reset () |
| Resets the image by freeing up any allocated memory used by the image. | |
| ARColour * | GetBuffer () |
| Retrieves a pointer to the images memory location. | |
| void | GetHistogram (int *histogram, int &minlevel, int &maxlevel, Channel channel=ARLib::CHANNEL_ALPHA) |
| Creates a histogram for the specified channel. | |
| ARColour * | GetPixel (int x, int y) |
| Returns a pointer to a pixel. | |
| void | SetPixel (int x, int y, ARColour value) |
| Sets a pixels red, green, blue and alpha values. | |
| void | glDraw () |
| Draws the current image within the OpenGL context. | |
| void | glDrawAlpha () |
| Draws the current images alpha channel within the OpenGL context. | |
| void | glDrawLuminance () |
| Draw the current images luminance within the OpenGL context. | |
| void | glDrawHistogram (Channel channel=CHANNEL_ALPHA) |
| Draw a histogram for the specified channel within the OpenGL context. | |
| void | DrawCross (int x, int y, int size, const ARColour &colour) |
| Draws a cross centred at the passed x and y coordinate. | |
| void | DrawBox (int x1, int y1, int x2, int y2, const ARColour &colour) |
| Draws a box. | |
| void | DrawBox (const Utility::ARRecti &rect, const ARColour &colour) |
| Draws a box. | |
| void | DrawSolidBox (int x1, int y1, int x2, int y2, const ARColour &colour) |
| Draws a solid (filled) box. | |
| void | DrawSolidBox (const Utility::ARRecti &rect, const ARColour &colour) |
| Draws a solid (filled) box. | |
| void | DrawLine (int x1, int y1, int x2, int y2, const ARColour &colour) |
| Draws a line. | |
| void | DrawNumber (int number, int x, int y, const ARColour &colour) |
| Draws an integer value starting at the passed x and y coordinates. | |
| void | DrawBuffer (char buffer[], int size, int x, int y, const ARColour &colour) |
| Draw a character buffer starting at the passed x and y coordinates. | |
Each pixel of the image consists of a red, green, blue and alpha channel and can be manipulated through the ARColour structure.
The current version of the Image class supports the loading and saving of TIFF images through the use of libTIFF.
There are various helper functions for drawing directly onto the image (DrawBox, DrawCross, Draw Line etc).
There are helper functions for drawing within an OpenGL context (glDraw, glDrawAlpha, glDrawLuminance etc).
|
|
Copies the contents of the current image to another image.
|
|
||||||||||||
|
Creates a image in memory.
|
|
||||||||||||
|
Draws a box.
|
|
||||||||||||||||||||||||
|
Draws a box.
|
|
||||||||||||||||||||||||
|
Draw a character buffer starting at the passed x and y coordinates.
|
|
||||||||||||||||||||
|
Draws a cross centred at the passed x and y coordinate.
|
|
||||||||||||||||||||||||
|
Draws a line.
|
|
||||||||||||||||||||
|
Draws an integer value starting at the passed x and y coordinates.
|
|
||||||||||||
|
Draws a solid (filled) box.
|
|
||||||||||||||||||||||||
|
Draws a solid (filled) box.
|
|
|
Retrieves a pointer to the images memory location.
The method returns a pointer to the first pixel memory location of the image.
|
|
|
Returns the filename associated with the image.
|
|
||||||||||||||||||||
|
Creates a histogram for the specified channel. Example Code Image img; int histogram[256]; int minlevel, maxlevel; if (img.LoadFromFile( "sample.tiff" )) { GetHistogram( histogram, minlevel, maxlevel, COLOR_RED ); }
|
|
||||||||||||
|
Returns a pointer to a pixel.
For performance reasons, this method does not check the validity of the passed x and y coordinates.
|
|
|
Returns the total size (width * height).
|
|
|
Draw a histogram for the specified channel within the OpenGL context.
|
|
|
Loads the specified file. Currently, only TIFF files are supported.
|
|
|
Resets the image by freeing up any allocated memory used by the image.
Calling this method will removed all allocated memory for the image. |
|
|
Saves the current image to file. Currently, only TIFF files are supported.
|
|
||||||||||||||||
|
Sets a pixels red, green, blue and alpha values.
For performance reasons, this method does not check the validity of the passed x and y coordinates.
|
1.3.9.1