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

## 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

The documentation for this class was generated from the following file:

- juce_graphics/images/juce_Image.h

Inheritance diagram for juce::ImagePixelData:

## 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
virtual std::unique_ptr< LowLevelGraphicsContext > | createLowLevelContext ()=0
| Creates a context that will draw into this image.
virtual Ptr | clone ()=0
| Creates a copy of this image.
virtual std::unique_ptr< ImageType > | createType () const =0
| Creates an instance of the type of this image.
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 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.
void | moveImageSection (Point< int > destTopLeft, Rectangle< int > sourceRect)
| Copies a section of the image to somewhere else within itself.
virtual void | applyGaussianBlurEffectInArea (Rectangle< int > bounds, float radius)
| Applies a native blur effect to this image, if available.
void | applyGaussianBlurEffect (float radius)
virtual void | applySingleChannelBoxBlurEffectInArea (Rectangle< int > bounds, int radius)
| Applies a native blur effect to this image, if available.
void | applySingleChannelBoxBlurEffect (int radius)
virtual void | multiplyAllAlphasInArea (Rectangle< int > bounds, float amount)
| Multiples all alpha-channel values in the image by the specified amount.
void | multiplyAllAlphas (float amount)
virtual void | desaturateInArea (Rectangle< int > bounds)
| Changes all the colours to be shades of grey, based on their current luminosity.
void | desaturate ()
void | sendDataChangeMessage ()
virtual NativeExtensions | getNativeExtensions ()
Public Member Functions inherited from juce::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< Listener > | listeners

## Additional Inherited Members

Protected Member Functions inherited from juce::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.
ReferenceCountedObject & | operator= (const ReferenceCountedObject &) noexcept
| Copying from another object does not affect this one's reference-count.
ReferenceCountedObject & | operator= (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.

## Member Typedef Documentation

## BackupExtensions

using juce::ImagePixelData::BackupExtensions = ImagePixelDataBackupExtensions

## NativeExtensions

using juce::ImagePixelData::NativeExtensions = ImagePixelDataNativeExtensions

## Ptr

using juce::ImagePixelData::Ptr = ReferenceCountedObjectPtr<ImagePixelData>

## Constructors and Destructors

## ImagePixelData()

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

References height, and width.

Referenced by getNativeExtensions(), juce::ImagePixelData::Listener::imageDataBeingDeleted(), and juce::ImagePixelData::Listener::imageDataChanged().

## ~ImagePixelData()

juce::ImagePixelData::~ImagePixelData | ( |  | ) |

override

## Member Functions

## createLowLevelContext()

virtual std::unique_ptr< LowLevelGraphicsContext > juce::ImagePixelData::createLowLevelContext | ( |  | ) |

pure virtual

Creates a context that will draw into this image.

## clone()

virtual Ptr juce::ImagePixelData::clone | ( |  | ) |

pure virtual

Creates a copy of this image.

## createType()

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

pure virtual

Creates an instance of the type of this image.

## getBackupExtensions() [1/2]

virtual BackupExtensions * juce::ImagePixelData::getBackupExtensions | ( |  | ) |

inline virtual

Returns a raw pointer to an instance of ImagePixelDataBackupExtensions if this ImagePixelData provides this extension, or nullptr otherwise.

## getBackupExtensions() [2/2]

virtual const BackupExtensions * juce::ImagePixelData::getBackupExtensions | ( |  | ) | const

inline virtual

## initialiseBitmapData()

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

pure virtual

Initialises a BitmapData object.

References x, and y.

## getSharedCount()

virtual int juce::ImagePixelData::getSharedCount | ( |  | ) | const

virtual noexcept

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.

## moveImageSection()

void juce::ImagePixelData::moveImageSection | ( | Point< int > | destTopLeft,
|  | Rectangle< int > | sourceRect )

Copies a section of the image to somewhere else within itself.

References moveImageSection().

Referenced by moveImageSection().

## applyGaussianBlurEffectInArea()

virtual void juce::ImagePixelData::applyGaussianBlurEffectInArea | ( | Rectangle< int > | bounds,
|  | float | radius )

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.

References applyGaussianBlurEffectInArea().

Referenced by applyGaussianBlurEffect(), and applyGaussianBlurEffectInArea().

## applyGaussianBlurEffect()

void juce::ImagePixelData::applyGaussianBlurEffect | ( | float | radius | ) |

inline

See also
  applyGaussianBlurEffectInArea()

References applyGaussianBlurEffect(), applyGaussianBlurEffectInArea(), height, and width.

Referenced by applyGaussianBlurEffect().

## applySingleChannelBoxBlurEffectInArea()

virtual void juce::ImagePixelData::applySingleChannelBoxBlurEffectInArea | ( | Rectangle< int > | bounds,
|  | int | radius )

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.

Referenced by applySingleChannelBoxBlurEffect().

## applySingleChannelBoxBlurEffect()

void juce::ImagePixelData::applySingleChannelBoxBlurEffect | ( | int | radius | ) |

inline

See also
  applySingleChannelBoxBlurEffectInArea()

References applySingleChannelBoxBlurEffectInArea(), height, and width.

## multiplyAllAlphasInArea()

virtual void juce::ImagePixelData::multiplyAllAlphasInArea | ( | Rectangle< int > | bounds,
|  | float | amount )

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.

Referenced by multiplyAllAlphas().

## multiplyAllAlphas()

void juce::ImagePixelData::multiplyAllAlphas | ( | float | amount | ) |

inline

See also
  multiplyAllAlphasInArea()

References height, multiplyAllAlphasInArea(), and width.

## desaturateInArea()

virtual void juce::ImagePixelData::desaturateInArea | ( | Rectangle< int > | bounds | ) |

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.

Referenced by desaturate().

## desaturate()

void juce::ImagePixelData::desaturate | ( |  | ) |

inline

See also
  desaturateInArea()

References desaturateInArea(), height, and width.

## sendDataChangeMessage()

void juce::ImagePixelData::sendDataChangeMessage | ( |  | ) |

## getNativeExtensions()

virtual NativeExtensions juce::ImagePixelData::getNativeExtensions | ( |  | ) |

virtual

References ImagePixelData().

## Member Data Documentation

## pixelFormat

const Image::PixelFormat juce::ImagePixelData::pixelFormat

The pixel format of the image data.

## width

const int juce::ImagePixelData::width

Referenced by applyGaussianBlurEffect(), applySingleChannelBoxBlurEffect(), desaturate(), ImagePixelData(), and multiplyAllAlphas().

## height

const int juce::ImagePixelData::height

Referenced by applyGaussianBlurEffect(), applySingleChannelBoxBlurEffect(), desaturate(), ImagePixelData(), and multiplyAllAlphas().

## userData

NamedValueSet juce::ImagePixelData::userData

User-defined settings that are attached to this image.

See also
  Image::getProperties().

## listeners

ListenerList<Listener> juce::ImagePixelData::listeners

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited