#include <Graphics.h>
Inheritance diagram for prapi::graphics::MemoryGraphics< T >:

Public Methods | |
| MemoryGraphics (util::Matrix< T > &buffer) | |
| Create a new MemoryGraphics object that uses the given matrix as an output buffer. | |
Protected Methods | |
| T | getPixel (int x, int y) const |
| Get a pixel in a graphics context. | |
| T & | pixel (int x, int y) |
| Get a pixel in a graphics context. | |
| void | setPixel (int x, int y, T value) |
| Set a pixel in a graphics context. | |
|
||||||||||
|
Create a new MemoryGraphics object that uses the given matrix as an output buffer. All drawing methods will modify the pixels in this buffer. Note that the buffer is passed by a reference. You must allocate and keep the storage yourself. A bad example:
Matrix<int> *mat = new Matrix<int>(100,100); MemoryGraphics<int> graphics(*mat); delete mat; //OOPS! graphics.drawPixel(1,1); //segmentation fault A better one:
Matrix<int> mat(100,100); MemoryGraphics<int> graphics(mat); graphics.drawPixel(1,1); |
|
||||||||||||||||
|
Get a pixel in a graphics context. Subclasses must implement this method to get the contents of the graphics device/buffer. Boundary checking has been done before calling this method. Thus, assuming _dimBounds has been set correctly, subclasses never need to check whether the given coordinates are within the allowed range. Implements prapi::graphics::Graphics< T >. |
|
||||||||||||||||
|
Get a pixel in a graphics context. Subclasses must implement this method to get the contents of the graphics device/buffer. Boundary checking has been done before calling this method. Thus, assuming _dimBounds has been set correctly, subclasses never need to check whether the given coordinates are within the allowed range. Implements prapi::graphics::Graphics< T >. |
|
||||||||||||||||||||
|
Set a pixel in a graphics context. Subclasses must implement this method to alter the graphics device/buffer. Boundary checking has been done before calling this method. Thus, assuming _dimBounds has been set correctly, subclasses never need to check whether the given coordinates are within the allowed range. Implements prapi::graphics::Graphics< T >. |