DISTRHO Plugin Framework
|
#include <OpenGL.hpp>
Public Member Functions | |
OpenGLImage () | |
OpenGLImage (const char *rawData, uint width, uint height, ImageFormat format=kImageFormatBGRA) | |
OpenGLImage (const char *rawData, const Size< uint > &size, ImageFormat format=kImageFormatBGRA) | |
OpenGLImage (const OpenGLImage &image) | |
~OpenGLImage () override | |
void | loadFromMemory (const char *rawData, const Size< uint > &size, ImageFormat format=kImageFormatBGRA) noexcept override |
void | drawAt (const GraphicsContext &context, const Point< int > &pos) override |
OpenGLImage & | operator= (const OpenGLImage &image) noexcept |
void | loadFromMemory (const char *rdata, uint w, uint h, ImageFormat fmt=kImageFormatBGRA) |
void | draw (const GraphicsContext &context) |
void | drawAt (const GraphicsContext &context, int x, int y) |
OpenGLImage (const char *rawData, uint width, uint height, GLenum glFormat) | |
OpenGLImage (const char *rawData, const Size< uint > &size, GLenum glFormat) | |
void | draw () |
void | drawAt (int x, int y) |
void | drawAt (const Point< int > &pos) |
DISTRHO_DEPRECATED GLenum | getType () const noexcept |
![]() | |
virtual | ~ImageBase () |
bool | isValid () const noexcept |
bool | isInvalid () const noexcept |
uint | getWidth () const noexcept |
uint | getHeight () const noexcept |
const Size< uint > & | getSize () const noexcept |
const char * | getRawData () const noexcept |
ImageFormat | getFormat () const noexcept |
void | loadFromMemory (const char *rawData, uint width, uint height, ImageFormat format=kImageFormatBGRA) noexcept |
void | draw (const GraphicsContext &context) |
void | drawAt (const GraphicsContext &context, int x, int y) |
ImageBase & | operator= (const ImageBase &image) noexcept |
bool | operator== (const ImageBase &image) const noexcept |
bool | operator!= (const ImageBase &image) const noexcept |
Additional Inherited Members | |
![]() | |
ImageBase () | |
ImageBase (const char *rawData, uint width, uint height, ImageFormat format) | |
ImageBase (const char *rawData, const Size< uint > &size, ImageFormat format) | |
ImageBase (const ImageBase &image) | |
![]() | |
const char * | rawData |
Size< uint > | size |
ImageFormat | format |
OpenGL Image class.
This is an Image class that handles raw image data in pixels. You can init the image data on the contructor or later on by calling loadFromMemory().
To generate raw data useful for this class see the utils/png2rgba.py script. Be careful when using a PNG without alpha channel, for those the format is 'GL_BGR' instead of the default 'GL_BGRA'.
Images are drawn on screen via 2D textures.
OpenGLImage::OpenGLImage | ( | ) |
Constructor for a null Image.
OpenGLImage::OpenGLImage | ( | const char * | rawData, |
uint | width, | ||
uint | height, | ||
ImageFormat | format = kImageFormatBGRA |
||
) |
Constructor using raw image data.
OpenGLImage::OpenGLImage | ( | const char * | rawData, |
const Size< uint > & | size, | ||
ImageFormat | format = kImageFormatBGRA |
||
) |
Constructor using raw image data.
OpenGLImage::OpenGLImage | ( | const OpenGLImage & | image | ) |
Constructor using another image data.
|
override |
Destructor.
|
explicit |
Constructor using raw image data, specifying an OpenGL image format.
|
explicit |
Constructor using raw image data, specifying an OpenGL image format.
|
overridevirtualnoexcept |
Load image data from memory.
Reimplemented from ImageBase.
|
overridevirtual |
Draw this image at position pos using the graphics context context.
Implements ImageBase.
|
noexcept |
TODO document this.
void OpenGLImage::draw | ( | ) |
Draw this image at (0, 0) point using the current OpenGL context. DEPRECATED This function does not take into consideration the current graphics context and only works in OpenGL.
void OpenGLImage::drawAt | ( | int | x, |
int | y | ||
) |
Draw this image at (x, y) point using the current OpenGL context. DEPRECATED This function does not take into consideration the current graphics context and only works in OpenGL.
void OpenGLImage::drawAt | ( | const Point< int > & | pos | ) |
Draw this image at position pos using the current OpenGL context. DEPRECATED This function does not take into consideration the current graphics context and only works in OpenGL.
|
inlinenoexcept |
Get the image type. DEPRECATED Type is always assumed to be GL_UNSIGNED_BYTE.