Image
Represents decoded image data loaded from an asset.
An image holds raw pixel data along with its dimensions. Images are typically created through Image::Create and shared between one or more Texture2D instances via stdshared_ptr.
Construction
Constructors
Image()
Constructs an image from initialization parameters.
Prefer Image::Create over direct construction to obtain a stdshared_ptr<Image> that can be shared between textures.
cpp
Image::Image(Parameters params);| Parameter | Description |
|---|---|
| params | Initialization parameters for constructing the image. |
Factories preferred
Creates a shared instance of Image.
cpp
static std::shared_ptr<Image> Image::Create(Parameters params);| Parameter | Description |
|---|---|
| params | Initialization parameters for constructing the image. |
Types
Image::Parameters struct
Parameters for constructing an Image object.
| Parameter | Description |
|---|---|
| data std::vector<uint8_t> | Raw pixel bytes. |
| width unsigned | Image width in pixels. |
| height unsigned | Image height in pixels. |
Properties
data std::vector<uint8_t>
Raw pixel data.
cpp
std::vector<uint8_t> data {};height unsigned
Image height in pixels.
cpp
unsigned height {};width unsigned
Image width in pixels.
cpp
unsigned width {};