Blowbox 2017
A 3D Game Engine by Riko Ophorst using DirectX 12
|
#include <image.h>
Public Member Functions | |
Image (const String &image_file_path) | |
~Image () | |
unsigned char *const | GetPixelData () const |
const Resolution & | GetResolution () const |
const PixelComposition & | GetPixelComposition () const |
Private Attributes | |
String | image_file_path_ |
Resolution | resolution_ |
unsigned char * | pixel_data_ |
PixelComposition | pixel_composition_ |
Load and access image files with the use of blowbox::Image.
blowbox::Image lets you easily load images that are stored on disk based on a file path that you provide. Supplied file paths are relative to the application's current working directory. The class provides accessor functions for the underlying pixel data. All data is stored on the CPU, no GPU is involved in the Image class whatsoever. Under the hood, stb_image is used to load the images into RAM.
blowbox::Image::Image | ( | const String & | image_file_path | ) |
Constructs an Image object by loading it from disk.
[in] | image_file_path | The file path to the image you want to be loaded. |
blowbox::Image::~Image | ( | ) |
const PixelComposition & blowbox::Image::GetPixelComposition | ( | ) | const |
Returns the pixel composition of the image. Every pixel is composed of a number of channels. This function helps find out what that is.
unsigned char *const blowbox::Image::GetPixelData | ( | ) | const |
Returns the pixel data that is contained within the image. If you want to know how the pixels are composed, use Image::GetPixelComposition().
const Resolution & blowbox::Image::GetResolution | ( | ) | const |
Returns the resolution of the image.
|
private |
The file path that links to the image that was used to load this image from disk.
|
private |
The per pixel composition of the pixel data. Refer to blowbox::PixelComposition.
|
private |
The actual pixel data of the image. This pointer is owned, generated and destroyed by stb_image. We are only allowed to read from it.
|
private |
The resolution of the image is stored here.