|
@ -20,6 +20,8 @@ |
|
|
#ifndef ANTKEEPER_IMAGE_HPP
|
|
|
#ifndef ANTKEEPER_IMAGE_HPP
|
|
|
#define ANTKEEPER_IMAGE_HPP
|
|
|
#define ANTKEEPER_IMAGE_HPP
|
|
|
|
|
|
|
|
|
|
|
|
#include <cstdlib>
|
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* Stores basic image data. |
|
|
* Stores basic image data. |
|
|
*/ |
|
|
*/ |
|
@ -65,6 +67,9 @@ public: |
|
|
|
|
|
|
|
|
/// @copydoc image::get_pixels() const
|
|
|
/// @copydoc image::get_pixels() const
|
|
|
void* get_pixels(); |
|
|
void* get_pixels(); |
|
|
|
|
|
|
|
|
|
|
|
/// Returns the size of the image, in bytes.
|
|
|
|
|
|
std::size_t get_size() const; |
|
|
|
|
|
|
|
|
private: |
|
|
private: |
|
|
void allocate_pixels(); |
|
|
void allocate_pixels(); |
|
@ -75,6 +80,7 @@ private: |
|
|
unsigned int height; |
|
|
unsigned int height; |
|
|
unsigned int channels; |
|
|
unsigned int channels; |
|
|
void* pixels; |
|
|
void* pixels; |
|
|
|
|
|
std::size_t size; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
inline bool image::is_hdr() const |
|
|
inline bool image::is_hdr() const |
|
@ -107,5 +113,9 @@ inline void* image::get_pixels() |
|
|
return pixels; |
|
|
return pixels; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#endif // ANTKEEPER_IMAGE_HPP
|
|
|
|
|
|
|
|
|
inline std::size_t image::get_size() const |
|
|
|
|
|
{ |
|
|
|
|
|
return size; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endif // ANTKEEPER_IMAGE_HPP
|