Argb32Image Class Reference

#include <Pt/Gfx/Argb32Image.h>

ARGB-32 image. More...

Inherits BasicImage< Argb32 >.

Public Member Functions

 Argb32Image (const Argb32 &format=Argb32::get())
 Constructs an empty image.
 Argb32Image (Pt::ssize_t width, Pt::ssize_t height, const Argb32 &format=Argb32::get())
 Constructs an image of the given size.
 Argb32Image (Pt::ssize_t width, Pt::ssize_t height, Pt::ssize_t padding, const Argb32 &format=Argb32::get())
 Constructs an image of the given size with row padding.
 Argb32Image (Pt::uint8_t *data, Pt::ssize_t width, Pt::ssize_t height, const Argb32 &format=Argb32::get())
 Constructs an image over external pixel data.
 Argb32Image (Pt::uint8_t *data, Pt::ssize_t width, Pt::ssize_t height, Pt::ssize_t padding, const Argb32 &format=Argb32::get())
 Constructs an image over external pixel data with row padding.
 Argb32Image (const Argb32Image &image)
 Copy constructor.
void reset (Pt::ssize_t width, Pt::ssize_t height, Pt::ssize_t padding, const Format &format)
 Reset to new size.
void reset (Pt::ssize_t width, Pt::ssize_t height, Pt::ssize_t padding)
 Reset to new size, keep existing format.
void reset (Pt::uint8_t *data, Pt::ssize_t width, Pt::ssize_t height, Pt::ssize_t padding, const Format &format)
 Reset to new data.
void reset (Pt::uint8_t *data, Pt::ssize_t width, Pt::ssize_t height, Pt::ssize_t padding)
 Reset to new data, keep existing format.
void clear ()
 Clears the image.

Detailed Description

Argb32Image is BasicImage with the Argb32 format bound at compile time. Each pixel is 32 bits with 8-bit alpha, red, green, and blue, and the matching cursor is Argb32Pixel. Use this type when the calling code already knows the layout. Use Image when the format comes from a decoder or other runtime input.

Constructors that take width and height allocate. Constructors that take a data pointer wrap the caller buffer; that buffer must remain valid for the lifetime of the image.

Constructor & Destructor Documentation

◆ Argb32Image() [1/6]

Argb32Image ( const Argb32 & format = Argb32::get())
explicit

Creates an image with no pixel data. The format parameter selects the pixel format and defaults to Argb32::get().

◆ Argb32Image() [2/6]

Argb32Image ( Pt::ssize_t width,
Pt::ssize_t height,
const Argb32 & format = Argb32::get() )

Allocates pixel data for width x height pixels. The format parameter selects the pixel format and defaults to Argb32::get().

◆ Argb32Image() [3/6]

Argb32Image ( Pt::ssize_t width,
Pt::ssize_t height,
Pt::ssize_t padding,
const Argb32 & format = Argb32::get() )

Allocates pixel data for width x height pixels. Each row is extended by padding extra bytes beyond the last pixel, which is useful when the image data must be aligned to a specific stride. The format parameter selects the pixel format and defaults to Argb32::get().

◆ Argb32Image() [4/6]

Argb32Image ( Pt::uint8_t * data,
Pt::ssize_t width,
Pt::ssize_t height,
const Argb32 & format = Argb32::get() )

Wraps the caller-supplied data buffer without taking ownership. The buffer must cover at least width x height pixels in Argb32 format and must remain valid for the lifetime of this image. The format parameter selects the pixel format and defaults to Argb32::get().

◆ Argb32Image() [5/6]

Argb32Image ( Pt::uint8_t * data,
Pt::ssize_t width,
Pt::ssize_t height,
Pt::ssize_t padding,
const Argb32 & format = Argb32::get() )

Wraps the caller-supplied data buffer without taking ownership. Each row occupies width pixels plus padding extra bytes. The buffer must be sized accordingly and must remain valid for the lifetime of this image. The format parameter selects the pixel format and defaults to Argb32::get().

◆ Argb32Image() [6/6]

Argb32Image ( const Argb32Image & image)

Creates a deep copy of image, including all pixel data.