Loading...
Searching...
No Matches
ImagePixelData Class Referenceabstract

This is a base class for holding image data in implementation-specific ways. More...

#include <juce_Image.h>

Inheritance diagram for ImagePixelData:

Classes

struct  Listener
 Used to receive callbacks for image data changes. More...
 

Public Types

using Ptr = ReferenceCountedObjectPtr<ImagePixelData>
 

Public Member Functions

 ImagePixelData (Image::PixelFormat, int width, int height)
 
 ~ImagePixelData () override
 
virtual std::unique_ptr< LowLevelGraphicsContextcreateLowLevelContext ()=0
 Creates a context that will draw into this image.
 
virtual Ptr clone ()=0
 Creates a copy of this image.
 
virtual std::unique_ptr< ImageTypecreateType () const =0
 Creates an instance of the type of this image.
 
virtual void initialiseBitmapData (Image::BitmapData &, int x, int y, Image::BitmapData::ReadWriteMode)=0
 Initialises a BitmapData object.
 
virtual int getSharedCount () const noexcept
 Returns the number of Image objects which are currently referring to the same internal shared image data.
 
virtual void applyGaussianBlurEffect (float radius, Image &result)
 Applies a native blur effect to this image, if available.
 
virtual void applySingleChannelBoxBlurEffect (int radius, Image &result)
 Applies a native blur effect to this image, if available.
 
void sendDataChangeMessage ()
 
- Public Member Functions inherited from ReferenceCountedObject
void incReferenceCount () noexcept
 Increments the object's reference count.
 
void decReferenceCount () noexcept
 Decreases the object's reference count.
 
bool decReferenceCountWithoutDeleting () noexcept
 Decreases the object's reference count.
 
int getReferenceCount () const noexcept
 Returns the object's current reference count.
 

Public Attributes

const Image::PixelFormat pixelFormat
 The pixel format of the image data.
 
const int width
 
const int height
 
NamedValueSet userData
 User-defined settings that are attached to this image.
 
ListenerList< Listenerlisteners
 

Additional Inherited Members

- Protected Member Functions inherited from ReferenceCountedObject
 ReferenceCountedObject ()=default
 Creates the reference-counted object (with an initial ref count of zero).
 
 ReferenceCountedObject (const ReferenceCountedObject &) noexcept
 Copying from another object does not affect this one's reference-count.
 
 ReferenceCountedObject (ReferenceCountedObject &&) noexcept
 Copying from another object does not affect this one's reference-count.
 
ReferenceCountedObjectoperator= (const ReferenceCountedObject &) noexcept
 Copying from another object does not affect this one's reference-count.
 
ReferenceCountedObjectoperator= (ReferenceCountedObject &&) noexcept
 Copying from another object does not affect this one's reference-count.
 
virtual ~ReferenceCountedObject ()
 Destructor.
 
void resetReferenceCount () noexcept
 Resets the reference count to zero without deleting the object.
 

Detailed Description

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.

See also
Image, ImageType

Member Typedef Documentation

◆ Ptr

Constructor & Destructor Documentation

◆ ImagePixelData()

ImagePixelData::ImagePixelData ( Image::PixelFormat ,
int width,
int height )

◆ ~ImagePixelData()

ImagePixelData::~ImagePixelData ( )
override

Member Function Documentation

◆ createLowLevelContext()

virtual std::unique_ptr< LowLevelGraphicsContext > ImagePixelData::createLowLevelContext ( )
pure virtual

Creates a context that will draw into this image.

◆ clone()

virtual Ptr ImagePixelData::clone ( )
pure virtual

Creates a copy of this image.

◆ createType()

virtual std::unique_ptr< ImageType > ImagePixelData::createType ( ) const
pure virtual

Creates an instance of the type of this image.

◆ initialiseBitmapData()

virtual void ImagePixelData::initialiseBitmapData ( Image::BitmapData & ,
int x,
int y,
Image::BitmapData::ReadWriteMode  )
pure virtual

Initialises a BitmapData object.

◆ getSharedCount()

virtual int ImagePixelData::getSharedCount ( ) const
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.

◆ applyGaussianBlurEffect()

virtual void ImagePixelData::applyGaussianBlurEffect ( float radius,
Image & result )
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.

Implementations should attempt to re-use the storage provided in the result out-parameter when possible.

If native blurs are unsupported, or if creating a blur fails for any other reason, the result out-parameter will be reset to an invalid image.

◆ applySingleChannelBoxBlurEffect()

virtual void ImagePixelData::applySingleChannelBoxBlurEffect ( int radius,
Image & result )
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.

Implementations should attempt to re-use the storage provided in the result out-parameter when possible.

If native blurs are unsupported, or if creating a blur fails for any other reason, the result out-parameter will be reset to an invalid image.

◆ sendDataChangeMessage()

void ImagePixelData::sendDataChangeMessage ( )

Member Data Documentation

◆ pixelFormat

const Image::PixelFormat ImagePixelData::pixelFormat

The pixel format of the image data.

◆ width

const int ImagePixelData::width

◆ height

const int ImagePixelData::height

◆ userData

NamedValueSet ImagePixelData::userData

User-defined settings that are attached to this image.

See also
Image::getProperties().

◆ listeners

ListenerList<Listener> ImagePixelData::listeners

The documentation for this class was generated from the following file:
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram