|
Ray Tracer Common Project
Image rendering program based on the ray tracing technique.
|
Image surface. More...
#include <image.hpp>
Public Member Functions | |
| image (int width, int height) | |
| image (const image &img) | |
| virtual | ~image () |
| virtual int | width () const |
| virtual int | height () const |
| virtual image | copy () const |
| virtual color | get_pixel (int x, int y) const |
| virtual void | set_pixel (int x, int y, const color &c) |
| virtual void | blit (image &dst, const rect &srcrect, int dstx, int dsty) const |
| virtual void | blit (image &dst, int dstx, int dsty) const |
| virtual void | draw_line (int x1, int y1, int x2, int y2, const color &c) |
| virtual void | draw_rect (int x1, int y1, int x2, int y2, const color &c) |
| virtual void | fill_rect (int x1, int y1, int x2, int y2, const color &c) |
Protected Member Functions | |
| image () | |
Protected Attributes | |
| SDL_Surface * | data |
Image surface.
The image class wraps a SDL_Surface structure to offer object-oriented access to its data. It represents an in-memory image.
|
protected |
Default constructor is protected and can be used only by inheriting classes. It is forbidden to build an image without at least its dimensions.
| rt::image::image | ( | int | width, |
| int | height | ||
| ) |
Main constructor. Builds an image from its dimensions.
| rt::image::image | ( | const image & | img | ) |
Copy constructor. Warning: this does not copy the actual data, so any modification to the copy will impact the original. To build a hard copy, use the copy member function.
|
virtual |
Destructor. Will decrease the reference counter of the wrapped data and free it if it goes to 0.
Copy/Past the image's source rectangle to a given destiation at given coordinates.
|
virtual |
Copy/Past time entire image to a given destiation at given coordinates.
|
virtual |
Returns a hard copy of the image.
|
virtual |
Draws a line from \((x1,y1)\) to \((x2,y2)\) of a given color.
|
virtual |
Draws a rectangle (uses draw_line) of a given color.
|
virtual |
Draws a filled rectangle of a given color.
|
virtual |
Returns the color of a pixel.
Reimplemented in rt::bitmap.
|
inlinevirtual |
Returns the height of the image.
|
virtual |
Sets a pixel to a given color.
Reimplemented in rt::bitmap.
|
inlinevirtual |
Returns the width of the image.
|
protected |
Wrapped SDL surface
1.8.15