16class ImageSourceListener;
17class ImageSourceProviderListener;
92 const Rect& texture_uv,
#define UExport
Definition Exports.h:25
User-defined image source to display custom images on a web-page.
Definition ImageSource.h:71
virtual ~ImageSource()=default
virtual uint32_t height() const =0
Get the height of the image in pixels.
ImageSource(const ImageSource &)=delete
virtual void Invalidate()=0
Invalidate the image.
virtual uint32_t width() const =0
Get the width of the image in pixels.
void operator=(const ImageSource &)=delete
virtual Rect texture_uv() const =0
Get the UV coordinates of the texture.
static RefPtr< ImageSource > CreateFromBitmap(RefPtr< Bitmap > bitmap)
Create an ImageSource from a Bitmap.
static RefPtr< ImageSource > CreateFromTexture(uint32_t width, uint32_t height, uint32_t texture_id, const Rect &texture_uv, RefPtr< Bitmap > bitmap=nullptr)
Create an ImageSource from a GPU texture with optional backing bitmap.
virtual void AddListener(ImageSourceListener *listener)=0
Add a listener to the image source.
virtual uint32_t texture_id() const =0
Get the GPU texture identifier to bind when drawing the quad for this image.
virtual void RemoveListener(ImageSourceListener *listener)=0
Remove a listener from the image source.
virtual RefPtr< Bitmap > bitmap()=0
Get the backing bitmap for this image source.
Listener for ImageSource events.
Definition ImageSource.h:164
virtual void OnInvalidateImageSource(ImageSource *image_source)=0
Called when the image source is invalidated.
virtual ~ImageSourceListener()=default
Maps image sources to string identifiers.
Definition ImageSource.h:181
virtual void RemoveListener(ImageSourceProviderListener *listener)=0
Remove a listener from the provider.
virtual void AddImageSource(const String &id, RefPtr< ImageSource > image_source)=0
Add an ImageSource to the provider.
virtual RefPtr< ImageSource > GetImageSource(const String &id)=0
Get an ImageSource by its identifier.
virtual void RemoveImageSource(const String &id)=0
Remove an ImageSource from the provider.
static ImageSourceProvider & instance()
Get the ImageSourceProvider singleton.
virtual void AddListener(ImageSourceProviderListener *listener)=0
Add a listener to the provider.
virtual ~ImageSourceProvider()=default
Listener for ImageSourceProvider events.
Definition ImageSource.h:236
virtual ~ImageSourceProviderListener()=default
virtual void OnAddImageSource(const String &id, RefPtr< ImageSource > image_source)=0
Called when an ImageSource is added to the provider.
virtual void OnRemoveImageSource(const String &id)=0
Called when an ImageSource is removed from the provider.
Interface for all ref-counted objects that will be managed using the RefPtr<> smart pointer.
Definition RefPtr.h:47
A nullable smart pointer.
Definition RefPtr.h:79
Unicode string container with conversions for UTF-8, UTF-16, and UTF-32.
Definition String.h:34
Float Rectangle Helper.
Definition Geometry.h:419