DISTRHO Plugin Framework
 All Classes Functions Variables Enumerations Enumerator Groups Pages
Public Member Functions | Protected Member Functions | List of all members
Image Class Reference

#include <Image.hpp>

Inheritance diagram for Image:
ImageBase

Public Member Functions

 Image ()
 
 Image (const char *const rawData, const uint width, const uint height, const GLenum format=GL_BGRA, const GLenum type=GL_UNSIGNED_BYTE)
 
 Image (const char *const rawData, const Size< uint > &size, const GLenum format=GL_BGRA, const GLenum type=GL_UNSIGNED_BYTE)
 
 Image (const Image &image)
 
 ~Image () override
 
void loadFromMemory (const char *const rawData, const uint width, const uint height, const GLenum format=GL_BGRA, const GLenum type=GL_UNSIGNED_BYTE) noexcept
 
void loadFromMemory (const char *const rawData, const Size< uint > &size, const GLenum format=GL_BGRA, const GLenum type=GL_UNSIGNED_BYTE) noexcept
 
GLenum getFormat () const noexcept
 
GLenum getType () const noexcept
 
Imageoperator= (const Image &image) noexcept
 
- Public Member Functions inherited from ImageBase
virtual ~ImageBase ()
 
bool isValid () const noexcept
 
uint getWidth () const noexcept
 
uint getHeight () const noexcept
 
const Size< uint > & getSize () const noexcept
 
const char * getRawData () const noexcept
 
void draw ()
 
void drawAt (const int x, const int y)
 
void drawAt (const Point< int > &pos)
 
ImageBaseoperator= (const ImageBase &image) noexcept
 
bool operator== (const ImageBase &image) const noexcept
 
bool operator!= (const ImageBase &image) const noexcept
 

Protected Member Functions

void _drawAt (const Point< int > &pos) override
 
- Protected Member Functions inherited from ImageBase
 ImageBase ()
 
 ImageBase (const char *const rawData, const uint width, const uint height)
 
 ImageBase (const char *const rawData, const Size< uint > &size)
 
 ImageBase (const ImageBase &image)
 

Additional Inherited Members

- Protected Attributes inherited from ImageBase
const char * fRawData
 
Size< uint > fSize
 

Detailed Description

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.

Constructor & Destructor Documentation

Image::Image ( )

Constructor for a null Image.

Image::Image ( const char *const  rawData,
const uint  width,
const uint  height,
const GLenum  format = GL_BGRA,
const GLenum  type = GL_UNSIGNED_BYTE 
)

Constructor using raw image data.

Note
rawData must remain valid for the lifetime of this Image.
Image::Image ( const char *const  rawData,
const Size< uint > &  size,
const GLenum  format = GL_BGRA,
const GLenum  type = GL_UNSIGNED_BYTE 
)

Constructor using raw image data.

Note
rawData must remain valid for the lifetime of this Image.
Image::Image ( const Image image)

Constructor using another image data.

Image::~Image ( )
override

Destructor.

Member Function Documentation

void Image::loadFromMemory ( const char *const  rawData,
const uint  width,
const uint  height,
const GLenum  format = GL_BGRA,
const GLenum  type = GL_UNSIGNED_BYTE 
)
noexcept

Load image data from memory.

Note
rawData must remain valid for the lifetime of this Image.
void Image::loadFromMemory ( const char *const  rawData,
const Size< uint > &  size,
const GLenum  format = GL_BGRA,
const GLenum  type = GL_UNSIGNED_BYTE 
)
noexcept

Load image data from memory.

Note
rawData must remain valid for the lifetime of this Image.
GLenum Image::getFormat ( ) const
noexcept

Get the image format.

GLenum Image::getType ( ) const
noexcept

Get the image type.

Image& Image::operator= ( const Image image)
noexcept

TODO document this.


The documentation for this class was generated from the following file: