91 Image (PixelFormat format,
int imageWidth,
int imageHeight,
bool clearImage);
108 Image (PixelFormat format,
int imageWidth,
int imageHeight,
bool clearImage, const
ImageType& type);
136 bool operator== (const
Image& other) const noexcept {
return image == other.image; }
139 bool operator!= (
const Image& other)
const noexcept {
return image != other.image; }
147 inline bool isValid() const noexcept {
return image !=
nullptr; }
155 inline bool isNull() const noexcept {
return image ==
nullptr; }
159 int getWidth() const noexcept;
162 int getHeight() const noexcept;
167 Rectangle<
int> getBounds() const noexcept;
170 PixelFormat getFormat() const noexcept;
173 bool isARGB() const noexcept;
176 bool isRGB() const noexcept;
179 bool isSingleChannel() const noexcept;
182 bool hasAlphaChannel() const noexcept;
199 Image rescaled (
int newWidth,
int newHeight,
200 Graphics::ResamplingQuality quality =
Graphics::mediumResamplingQuality) const;
207 Image createCopy() const;
216 Image convertedToFormat (PixelFormat newFormat) const;
229 void duplicateIfShared();
252 Colour getPixelAt (
int x,
int y) const;
264 void setPixelAt (
int x,
int y,
Colour colour);
276 void multiplyAlphaAt (
int x,
int y,
float multiplier);
286 void multiplyAllAlphas (
float amountToMultiplyBy);
319 BitmapData (
Image& image,
int x,
int y,
int w,
int h, ReadWriteMode mode);
340 Colour getPixelColour (
int x,
int y)
const noexcept;
346 void setPixelColour (
int x,
int y,
Colour colour)
const noexcept;
376 void moveImageSection (
int destX,
int destY,
377 int sourceX,
int sourceY,
378 int width,
int height);
408 int getReferenceCount() const noexcept;
412 ImagePixelData* getPixelData() const noexcept {
return image.get(); }
418 #if JUCE_ALLOW_STATIC_NULL_VARIABLES && ! defined (DOXYGEN)
420 [[deprecated (
"If you need a default-constructed var, just use Image() or {}.")]]
421 static const Image null;
464 virtual int getSharedCount() const noexcept;
468 const
Image::PixelFormat pixelFormat;
469 const
int width, height;
488 void sendDataChangeMessage();
519 virtual Image convert (
const Image& source)
const;
536 int getTypeID()
const override;
554 int getTypeID()
const override;
Represents a colour, also including a transparency value.
A graphics context, used for drawing a component or image.
This is a base class for holding image data in implementation-specific ways.
virtual std::unique_ptr< LowLevelGraphicsContext > createLowLevelContext()=0
Creates a context that will draw into this image.
virtual void initialiseBitmapData(Image::BitmapData &, int x, int y, Image::BitmapData::ReadWriteMode)=0
Initialises a BitmapData object.
virtual std::unique_ptr< ImageType > createType() const =0
Creates an instance of the type of this image.
virtual Ptr clone()=0
Creates a copy of this image.
This base class is for handlers that control a type of image manipulation format, e....
virtual ImagePixelData::Ptr create(Image::PixelFormat, int width, int height, bool shouldClearImage) const =0
Creates a new image of this type, and the specified parameters.
virtual int getTypeID() const =0
Must return a unique number to identify this type.
Used internally by custom image types to manage pixel data lifetime.
Retrieves a section of an image as raw pixel data, so it can be read or written to.
int pixelStride
The number of bytes between each pixel.
uint8 * getPixelPointer(int x, int y) const noexcept
Returns a pointer to a pixel in the image.
int lineStride
The number of bytes between each line.
uint8 * getLinePointer(int y) const noexcept
Returns a pointer to the start of a line in the image.
PixelFormat pixelFormat
The format of the data.
uint8 * data
The raw pixel data, packed according to the image's pixel format.
Rectangle< int > getBounds() const noexcept
Returns the size of the bitmap.
size_t size
The number of valid/allocated bytes after data.
Holds a fixed-size bitmap.
bool isNull() const noexcept
Returns true if this image is not valid.
bool isValid() const noexcept
Returns true if this image isn't null.
@ ARGB
< each pixel is a 4-byte ARGB premultiplied colour value.
@ RGB
< each pixel is a 3-byte packed RGB colour value.
Holds a set of objects and can invoke a member function callback on each object in the set with a sin...
Holds a set of named var objects.
An image storage type which holds the pixels using whatever is the default storage format on the curr...
ImagePixelData::Ptr create(Image::PixelFormat, int width, int height, bool clearImage) const override
Creates a new image of this type, and the specified parameters.
Maintains a set of rectangles as a complex region.
Manages a rectangle and allows geometric operations to be performed on it.
A smart-pointer class which points to a reference-counted object.
A base class which provides methods for reference-counting.
An image storage type which holds the pixels in-memory as a simple block of values.
#define JUCE_LEAK_DETECTOR(OwnerClass)
This macro lets you embed a leak-detecting object inside a class.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
unsigned char uint8
A platform-independent 8-bit unsigned integer type.
Used to receive callbacks for image data changes.