Blowbox 2017
A 3D Game Engine by Riko Ophorst using DirectX 12
image.h
1 #pragma once
2 
3 #include "util/resolution.h"
4 #include "util/string.h"
5 
6 namespace blowbox
7 {
20  {
21  PixelComposition_R,
22  PixelComposition_RG,
23  PixelComposition_RGB,
24  PixelComposition_RGBA,
25  PixelComposition_UNKNOWN
26  };
27 
36  class Image
37  {
38  public:
43  Image(const String& image_file_path);
44 
49  ~Image();
50 
56  unsigned char* const GetPixelData() const;
57 
62  const Resolution& GetResolution() const;
63 
69 
70  private:
73  unsigned char* pixel_data_;
75  };
76 }
Image(const String &image_file_path)
Constructs an Image object by loading it from disk.
Definition: image.cc:11
unsigned char * pixel_data_
The actual pixel data of the image. This pointer is owned, generated and destroyed by stb_image...
Definition: image.h:73
const Resolution & GetResolution() const
Returns the resolution of the image.
Definition: image.cc:37
String image_file_path_
The file path that links to the image that was used to load this image from disk. ...
Definition: image.h:71
const PixelComposition & GetPixelComposition() const
Returns the pixel composition of the image. Every pixel is composed of a number of channels...
Definition: image.cc:43
~Image()
Destructs the Image object.
Definition: image.cc:25
eastl::string String
Typedef for wrapping the EASTL string.
Definition: string.h:13
Stores resolution information in pixels.
Definition: resolution.h:12
Resolution resolution_
The resolution of the image is stored here.
Definition: image.h:72
PixelComposition pixel_composition_
The per pixel composition of the pixel data. Refer to blowbox::PixelComposition.
Definition: image.h:74
The main Blowbox namespace.
Definition: image.cc:8
PixelComposition
An enumeration of all different pixel compositions.
Definition: image.h:19
Load and access image files with the use of blowbox::Image.
Definition: image.h:36
unsigned char *const GetPixelData() const
Returns the pixel data that is contained within the image. If you want to know how the pixels are com...
Definition: image.cc:31