A drawable object which is a bitmap image. More...
Inherits Drawable.
Classes | |
| class | ValueTreeWrapper |
| Internally-used class for wrapping a DrawableImage's state into a ValueTree. More... | |
Public Member Functions | |
| DrawableImage () | |
| DrawableImage (const DrawableImage &other) | |
| ~DrawableImage () | |
| Destructor. | |
| void | setImage (const Image &imageToUse) |
| Sets the image that this drawable will render. | |
| const Image & | getImage () const noexcept |
| Returns the current image. | |
| void | setOpacity (float newOpacity) |
| Sets the opacity to use when drawing the image. | |
| float | getOpacity () const noexcept |
| Returns the image's opacity. | |
| void | setOverlayColour (const Colour &newOverlayColour) |
| Sets a colour to draw over the image's alpha channel. | |
| const Colour & | getOverlayColour () const noexcept |
| Returns the overlay colour. | |
| void | setBoundingBox (const RelativeParallelogram &newBounds) |
| Sets the bounding box within which the image should be displayed. | |
| const RelativeParallelogram & | getBoundingBox () const noexcept |
| Returns the position to which the image's top-left corner should be remapped in the target coordinate space when rendering this object. | |
| void | paint (Graphics &g) |
| bool | hitTest (int x, int y) |
| Drawable * | createCopy () const |
| Rectangle< float > | getDrawableBounds () const |
| void | refreshFromValueTree (const ValueTree &tree, ComponentBuilder &builder) |
| ValueTree | createValueTree (ComponentBuilder::ImageProvider *imageProvider) const |
Static Public Attributes | |
| static const Identifier | valueTreeType |
A drawable object which is a bitmap image.
| DrawableImage::DrawableImage | ( | const DrawableImage & | other | ) |
Destructor.
| void DrawableImage::setImage | ( | const Image & | imageToUse | ) |
Sets the image that this drawable will render.
| const Image& DrawableImage::getImage | ( | ) | const |
Returns the current image.
| void DrawableImage::setOpacity | ( | float | newOpacity | ) |
Sets the opacity to use when drawing the image.
| float DrawableImage::getOpacity | ( | ) | const |
Returns the image's opacity.
| void DrawableImage::setOverlayColour | ( | const Colour & | newOverlayColour | ) |
Sets a colour to draw over the image's alpha channel.
By default this is transparent so isn't drawn, but if you set a non-transparent colour here, then it will be overlaid on the image, using the image's alpha channel as a mask.
This is handy for doing things like darkening or lightening an image by overlaying it with semi-transparent black or white.
| const Colour& DrawableImage::getOverlayColour | ( | ) | const |
Returns the overlay colour.
| void DrawableImage::setBoundingBox | ( | const RelativeParallelogram & | newBounds | ) |
Sets the bounding box within which the image should be displayed.
| const RelativeParallelogram& DrawableImage::getBoundingBox | ( | ) | const |
Returns the position to which the image's top-left corner should be remapped in the target coordinate space when rendering this object.
| void DrawableImage::paint | ( | Graphics & | g | ) | [virtual] |
Reimplemented from Component.
| bool DrawableImage::hitTest | ( | int | x, |
| int | y | ||
| ) | [virtual] |
Reimplemented from Component.
| Drawable* DrawableImage::createCopy | ( | ) | const [virtual] |
Implements Drawable.
| Rectangle<float> DrawableImage::getDrawableBounds | ( | ) | const [virtual] |
Implements Drawable.
| void DrawableImage::refreshFromValueTree | ( | const ValueTree & | tree, |
| ComponentBuilder & | builder | ||
| ) |
| ValueTree DrawableImage::createValueTree | ( | ComponentBuilder::ImageProvider * | imageProvider | ) | const [virtual] |
Implements Drawable.
const Identifier DrawableImage::valueTreeType [static] |