#include <display2d.h>
Draw an image with 2D textures Currently support any native image type (ie. unsigned char, unsigned short, and others) use update and display when image is changed:
unsigned char* image = new unsigned char [100*100]; // fill the data Display::Image disp; disp.update(image); disp.display();
If an image needs to be updated very fast (eg. playing a movie) transfers to the texture memory can become a bottleneck In this case, Display::ImageDrawPixels<T> might be more suitable as it directly writes the image in the frame buffer.
Public Member Functions | |
Image () | |
~Image () | |
template<typename DataType> | |
void | update (const DataType *image, unsigned int width, unsigned int height) |
void | display () const |
Classes | |
struct | OpenGLArgs |
OpenGL constants. |
Display::Image::Image | ( | ) |
Display::Image::~Image | ( | ) |
void Image< DataType >::update | ( | const DataType * | image, | |
unsigned int | width, | |||
unsigned int | height | |||
) | [inline] |
Update the viewer with a new 2D image
void Display::Image::display | ( | ) | const |
Draw the image on a centered unit square use glTranslate/glScale to move the image around