JUCE  v6.1.6 (6.0.8-1114)
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::ImagePixelData Class Referenceabstract

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

#include <juce_Image.h>

Inheritance diagram for juce::ImagePixelData:
Collaboration diagram for juce::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 Ptr clone ()=0
 Creates a copy of this image. More...
 
virtual std::unique_ptr< LowLevelGraphicsContextcreateLowLevelContext ()=0
 Creates a context that will draw into this image. More...
 
virtual std::unique_ptr< ImageTypecreateType () const =0
 Creates an instance of the type of this image. More...
 
void decReferenceCount () noexcept
 Decreases the object's reference count. More...
 
bool decReferenceCountWithoutDeleting () noexcept
 Decreases the object's reference count. More...
 
int getReferenceCount () const noexcept
 Returns the object's current reference count. More...
 
virtual int getSharedCount () const noexcept
 Returns the number of Image objects which are currently referring to the same internal shared image data. More...
 
void incReferenceCount () noexcept
 Increments the object's reference count. More...
 
virtual void initialiseBitmapData (Image::BitmapData &, int x, int y, Image::BitmapData::ReadWriteMode)=0
 Initialises a BitmapData object. More...
 
void sendDataChangeMessage ()
 

Public Attributes

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

Protected Member Functions

void resetReferenceCount () noexcept
 Resets the reference count to zero without deleting the object. More...
 

Private Attributes

Atomic< intrefCount { 0 }
 

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

@tags{Graphics}

Member Typedef Documentation

◆ Ptr

Constructor & Destructor Documentation

◆ ImagePixelData()

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

◆ ~ImagePixelData()

juce::ImagePixelData::~ImagePixelData ( )
override

Member Function Documentation

◆ clone()

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

Creates a copy of this image.

◆ createLowLevelContext()

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

Creates a context that will draw into this image.

◆ createType()

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

Creates an instance of the type of this image.

◆ decReferenceCount()

void juce::ReferenceCountedObject::decReferenceCount ( )
inlinenoexceptinherited

Decreases the object's reference count.

If the count gets to zero, the object will be deleted.

References jassert.

◆ decReferenceCountWithoutDeleting()

bool juce::ReferenceCountedObject::decReferenceCountWithoutDeleting ( )
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.

◆ getReferenceCount()

int juce::ReferenceCountedObject::getReferenceCount ( ) const
inlinenoexceptinherited

Returns the object's current reference count.

◆ getSharedCount()

virtual int juce::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.

◆ incReferenceCount()

void juce::ReferenceCountedObject::incReferenceCount ( )
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.

Referenced by juce::ReferenceCountedObjectPtr< juce::ReferenceCountedObject >::operator=().

◆ initialiseBitmapData()

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

Initialises a BitmapData object.

◆ resetReferenceCount()

void juce::ReferenceCountedObject::resetReferenceCount ( )
inlineprotectednoexceptinherited

Resets the reference count to zero without deleting the object.

You should probably never need to use this!

◆ sendDataChangeMessage()

void juce::ImagePixelData::sendDataChangeMessage ( )

Member Data Documentation

◆ height

const int juce::ImagePixelData::height

◆ listeners

ListenerList<Listener> juce::ImagePixelData::listeners

◆ pixelFormat

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

The pixel format of the image data.

◆ refCount

Atomic<int> juce::ReferenceCountedObject::refCount { 0 }
privateinherited

◆ userData

NamedValueSet juce::ImagePixelData::userData

User-defined settings that are attached to this image.

See also
Image::getProperties().

◆ width

const int juce::ImagePixelData::width

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