Loading...
Searching...
No Matches
juce::OpenGLImageType Class Reference

Detailed Description

A type of ImagePixelData that stores its image data in an OpenGL framebuffer, allowing a JUCE Image object to wrap a framebuffer.

By creating an Image from an instance of an OpenGLFrameBufferImage, you can then use a Graphics object to draw into the framebuffer using normal JUCE 2D operations.

OpenGLFrameBuffer only supports RGBA framebuffers, so single channel images keep their image data in CPU memory instead, and upload it to a texture when drawn. For these images getFrameBufferFrom() will return nullptr.

A request for an Image::RGB image is promoted to Image::ARGB, and will use a framebuffer in the same way as an Image::ARGB request.

See also
Image, ImageType, ImagePixelData, OpenGLFrameBuffer

The documentation for this class was generated from the following file:
Inheritance diagram for juce::OpenGLImageType:

Public Member Functions

 OpenGLImageType ()
 ~OpenGLImageType () override
ImagePixelData::Ptr create (Image::PixelFormat format, int width, int height, bool shouldClearImage) const override
 Creates a new image of this type, and the specified parameters.
int getTypeID () const override
 Must return a unique number to identify this type.
Public Member Functions inherited from juce::ImageType
 ImageType ()
virtual ~ImageType ()
virtual Image convert (const Image &source) const
 Returns an image which is a copy of the source image, but using this type of storage mechanism.

Static Public Member Functions

static OpenGLFrameBuffergetFrameBufferFrom (const Image &)

Constructors and Destructors

◆ OpenGLImageType()

juce::OpenGLImageType::OpenGLImageType ( )

◆ ~OpenGLImageType()

juce::OpenGLImageType::~OpenGLImageType ( )
override

Member Functions

◆ create()

ImagePixelData::Ptr juce::OpenGLImageType::create ( Image::PixelFormat ,
int width,
int height,
bool shouldClearImage ) const
overridevirtual

Creates a new image of this type, and the specified parameters.

Implements juce::ImageType.

◆ getTypeID()

int juce::OpenGLImageType::getTypeID ( ) const
overridevirtual

Must return a unique number to identify this type.

Implements juce::ImageType.

◆ getFrameBufferFrom()

OpenGLFrameBuffer * juce::OpenGLImageType::getFrameBufferFrom ( const Image & )
static