This is a base class for holding image data in implementation-specific ways. More...
#include <juce_Image.h>
Classes | |
| struct | Listener |
| Used to receive callbacks for image data changes. More... | |
Public Types | |
| using | BackupExtensions = ImagePixelDataBackupExtensions |
| using | NativeExtensions = ImagePixelDataNativeExtensions |
| using | Ptr = ReferenceCountedObjectPtr< ImagePixelData > |
Public Member Functions | |
| ImagePixelData (Image::PixelFormat, int width, int height) | |
| ~ImagePixelData () override | |
| void | applyGaussianBlurEffect (float radius) |
| virtual void | applyGaussianBlurEffectInArea (Rectangle< int > bounds, float radius) |
| Applies a native blur effect to this image, if available. | |
| void | applySingleChannelBoxBlurEffect (int radius) |
| virtual void | applySingleChannelBoxBlurEffectInArea (Rectangle< int > bounds, int radius) |
| Applies a native blur effect to this image, if available. | |
| virtual Ptr | clone ()=0 |
| Creates a copy of this image. | |
| virtual std::unique_ptr< LowLevelGraphicsContext > | createLowLevelContext ()=0 |
| Creates a context that will draw into this image. | |
| virtual std::unique_ptr< ImageType > | createType () const =0 |
| Creates an instance of the type of this image. | |
| void | decReferenceCount () noexcept |
| Decreases the object's reference count. | |
| bool | decReferenceCountWithoutDeleting () noexcept |
| Decreases the object's reference count. | |
| void | desaturate () |
| virtual void | desaturateInArea (Rectangle< int > bounds) |
| Changes all the colours to be shades of grey, based on their current luminosity. | |
| virtual BackupExtensions * | getBackupExtensions () |
| Returns a raw pointer to an instance of ImagePixelDataBackupExtensions if this ImagePixelData provides this extension, or nullptr otherwise. | |
| virtual const BackupExtensions * | getBackupExtensions () const |
| virtual NativeExtensions | getNativeExtensions () |
| int | getReferenceCount () const noexcept |
| Returns the object's current reference count. | |
| virtual int | getSharedCount () const noexcept |
| Returns the number of Image objects which are currently referring to the same internal shared image data. | |
| void | incReferenceCount () noexcept |
| Increments the object's reference count. | |
| virtual void | initialiseBitmapData (Image::BitmapData &, int x, int y, Image::BitmapData::ReadWriteMode)=0 |
| Initialises a BitmapData object. | |
| void | moveImageSection (Point< int > destTopLeft, Rectangle< int > sourceRect) |
| Copies a section of the image to somewhere else within itself. | |
| void | multiplyAllAlphas (float amount) |
| virtual void | multiplyAllAlphasInArea (Rectangle< int > bounds, float amount) |
| Multiples all alpha-channel values in the image by the specified amount. | |
| void | sendDataChangeMessage () |
Public Attributes | |
| const int | height |
| ListenerList< Listener > | listeners |
| const Image::PixelFormat | pixelFormat |
| The pixel format of the image data. | |
| NamedValueSet | userData |
| User-defined settings that are attached to this image. | |
| const int | width |
Protected Member Functions | |
| void | resetReferenceCount () noexcept |
| Resets the reference count to zero without deleting the object. | |
Private Member Functions | |
| virtual void | moveValidatedImageSection (Point< int > destTopLeft, Rectangle< int > sourceRect) |
Private Attributes | |
| Atomic< int > | refCount { 0 } |
This is a base class for holding image data in implementation-specific ways.
You may never need to use this class directly - it's used internally by the Image class to store the actual image data. To access pixel data directly, you should use Image::BitmapData rather than this class.
ImagePixelData objects are created indirectly, by subclasses of ImageType.
@tags{Graphics}
| juce::ImagePixelData::ImagePixelData | ( | Image::PixelFormat | , |
| int | width, | ||
| int | height | ||
| ) |
|
override |
|
inline |
|
virtual |
Applies a native blur effect to this image, if available.
This blur applies to all channels of the input image. It may be more expensive to calculate than a box blur, but should produce higher-quality results.
The default implementation will modify the image pixel-by-pixel on the CPU, which will be slow. Native image types may provide optimised implementations.
Reimplemented in juce::Direct2DPixelData.
|
inline |
|
virtual |
Applies a native blur effect to this image, if available.
This is intended for blurring single-channel images, which is useful when rendering drop shadows. This is implemented as several box-blurs in series. The results should be visually similar to a Gaussian blur, but less accurate.
The default implementation will modify the image pixel-by-pixel on the CPU, which will be slow. Native image types may provide optimised implementations.
Reimplemented in juce::Direct2DPixelData.
|
pure virtual |
Creates a copy of this image.
Implemented in juce::Direct2DPixelData.
|
pure virtual |
Creates a context that will draw into this image.
Implemented in juce::Direct2DPixelData.
Referenced by juce::RenderingHelpers::SoftwareRendererSavedState::beginTransparencyLayer().
|
pure virtual |
Creates an instance of the type of this image.
Implemented in juce::Direct2DPixelData.
|
inlinenoexceptinherited |
Decreases the object's reference count.
If the count gets to zero, the object will be deleted.
References jassert.
|
inlinenoexceptinherited |
Decreases the object's reference count.
If the count gets to zero, the object will not be deleted, but this method will return true, allowing the caller to take care of deletion.
References jassert.
|
inline |
|
virtual |
Changes all the colours to be shades of grey, based on their current luminosity.
The default implementation will modify the image pixel-by-pixel on the CPU, which will be slow. Native image types may provide optimised implementations.
Reimplemented in juce::Direct2DPixelData.
|
inlinevirtual |
Returns a raw pointer to an instance of ImagePixelDataBackupExtensions if this ImagePixelData provides this extension, or nullptr otherwise.
Reimplemented in juce::Direct2DPixelData.
|
inlinevirtual |
Reimplemented in juce::Direct2DPixelData.
|
virtual |
intentionally not callable from user code
Reimplemented in juce::Direct2DPixelData.
|
inlinenoexceptinherited |
Returns the object's current reference count.
|
virtualnoexcept |
Returns the number of Image objects which are currently referring to the same internal shared image data.
This is different to the reference count as an instance of ImagePixelData can internally depend on another ImagePixelData via it's member variables.
|
inlinenoexceptinherited |
Increments the object's reference count.
This is done automatically by the smart pointer, but is public just in case it's needed for nefarious purposes.
|
pure virtual |
Initialises a BitmapData object.
Implemented in juce::Direct2DPixelData.
| void juce::ImagePixelData::moveImageSection | ( | Point< int > | destTopLeft, |
| Rectangle< int > | sourceRect | ||
| ) |
Copies a section of the image to somewhere else within itself.
|
privatevirtual |
Reimplemented in juce::Direct2DPixelData.
|
inline |
|
virtual |
Multiples all alpha-channel values in the image by the specified amount.
The default implementation will modify the image pixel-by-pixel on the CPU, which will be slow. Native image types may provide optimised implementations.
Reimplemented in juce::Direct2DPixelData.
|
inlineprotectednoexceptinherited |
Resets the reference count to zero without deleting the object.
You should probably never need to use this!
| void juce::ImagePixelData::sendDataChangeMessage | ( | ) |
| const int juce::ImagePixelData::height |
| ListenerList<Listener> juce::ImagePixelData::listeners |
| const Image::PixelFormat juce::ImagePixelData::pixelFormat |
The pixel format of the image data.
|
privateinherited |
| NamedValueSet juce::ImagePixelData::userData |
User-defined settings that are attached to this image.
| const int juce::ImagePixelData::width |