Antkeeper
0.0.1
|
#include <image.hpp>
Public Member Functions | |
virtual | ~image ()=0 |
Destructs an image. More... | |
image (const image &)=delete | |
image (image &&)=delete | |
image & | operator= (const image &)=delete |
image & | operator= (image &&)=delete |
void | read (std::uint32_t mip_level, std::uint32_t offset_x, std::uint32_t offset_y, std::uint32_t offset_z, std::uint32_t width, std::uint32_t height, std::uint32_t depth, gl::format format, std::span< std::byte > data) const |
Reads pixel data from the image. More... | |
void | write (std::uint32_t mip_level, std::uint32_t offset_x, std::uint32_t offset_y, std::uint32_t offset_z, std::uint32_t width, std::uint32_t height, std::uint32_t depth, gl::format format, std::span< const std::byte > data) |
Writes pixel data to the image. More... | |
void | copy (std::uint32_t src_mip_level, std::uint32_t src_x, std::uint32_t src_y, std::uint32_t src_z, image &dst_image, std::uint32_t dst_mip_level, std::uint32_t dst_x, std::uint32_t dst_y, std::uint32_t dst_z, std::uint32_t width, std::uint32_t height, std::uint32_t depth) const |
Copies pixel data from this image into another the image. More... | |
void | generate_mipmaps () |
Generates mip subimages. More... | |
constexpr std::uint8_t | get_dimensionality () const noexcept |
Returns the dimensionality of the image. More... | |
constexpr bool | is_1d () const noexcept |
Returns true if the image is 1D, false otherwise. More... | |
constexpr bool | is_2d () const noexcept |
Returns true if the image is 2D, false otherwise. More... | |
constexpr bool | is_3d () const noexcept |
Returns true if the image is 3D, false otherwise. More... | |
constexpr format | get_format () const noexcept |
Returns the format and type of the texel blocks contained in the image. More... | |
constexpr const std::array< std::uint32_t, 3 > & | get_dimensions () const noexcept |
Returns the dimensions of the image. More... | |
constexpr std::uint32_t | get_mip_levels () const noexcept |
Returns the number of levels of detail available for minified sampling of the image. More... | |
constexpr std::uint32_t | get_array_layers () const noexcept |
Returns the number of layers in the image. More... | |
constexpr std::uint8_t | get_flags () const noexcept |
Returns the image flags. More... | |
constexpr bool | is_cube_compatible () const noexcept |
Returns true if the image is cube map compatible, false otherwise. More... | |
Protected Member Functions | |
image (std::uint8_t dimensionality, gl::format format, std::uint32_t width, std::uint32_t height, std::uint32_t depth, std::uint32_t mip_levels, std::uint32_t array_layers, std::uint32_t flags) | |
Constructs an image. More... | |
Friends | |
class | image_view |
|
delete |
|
delete |
|
protected |
Constructs an image.
dimensionality | Image dimensionality, on [1, 3] . |
format | Format and type of the texel blocks that will be contained in the image. |
width | Width of the image. |
height | Height of the image. |
depth | Depth of the image. |
mip_levels | Number of levels of detail available for minified sampling of the image. |
array_layers | Number of layers in the image. |
flags | Image flags. |
@except std::invalid_argument Image constructed with unsupported format. @except std::invalid_argument Image dimensions must be nonzero. @except std::invalid_argument Image mip levels must be nonzero. @except std::out_of_range Image mip levels exceed 1 + log2(max(width, height, depth))
. @except std::invalid_argument Image array layers must be nonzero. @except std::invalid_argument 1D image must have a height and depth of 1
. @except std::invalid_argument 2D image must have a depth of 1
. @except std::invalid_argument 3D image arrays not supported. @except std::invalid_argument Cube compatible image must be 2D. @except std::invalid_argument Cube compatible image width and height must be equal. @except std::invalid_argument Cube compatible image array layers must be a multiple of 6.
void gl::image::copy | ( | std::uint32_t | src_mip_level, |
std::uint32_t | src_x, | ||
std::uint32_t | src_y, | ||
std::uint32_t | src_z, | ||
image & | dst_image, | ||
std::uint32_t | dst_mip_level, | ||
std::uint32_t | dst_x, | ||
std::uint32_t | dst_y, | ||
std::uint32_t | dst_z, | ||
std::uint32_t | width, | ||
std::uint32_t | height, | ||
std::uint32_t | depth | ||
) | const |
Copies pixel data from this image into another the image.
src_mip_level | Source image level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. |
src_x | Source image texel offset in the X-direction. |
src_y | Source image texel offset in the Y-direction. |
src_z | Source image texel offset in the Z-direction. |
dst_image | Destination image. |
dst_mip_level | Destination image level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. |
dst_x | Destination image texel offset in the X-direction. |
dst_y | Destination image texel offset in the Y-direction. |
dst_z | Destination image texel offset in the Z-direction. |
width | Width of the subimage to copy. |
height | Height of the subimage to copy. |
depth | Depth of the subimage to copy. |
void gl::image::generate_mipmaps | ( | ) |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
void gl::image::read | ( | std::uint32_t | mip_level, |
std::uint32_t | offset_x, | ||
std::uint32_t | offset_y, | ||
std::uint32_t | offset_z, | ||
std::uint32_t | width, | ||
std::uint32_t | height, | ||
std::uint32_t | depth, | ||
gl::format | format, | ||
std::span< std::byte > | data | ||
) | const |
Reads pixel data from the image.
mip_level | Level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. |
offset_x | Texel offset in the X-direction. |
offset_y | Texel offset in the Y-direction. |
offset_z | Texel offset in the Z-direction. |
width | Width of the subimage. |
height | Height of the subimage. |
depth | Depth of the subimage. |
format | Format of the image data. |
data | Buffer into which image data will be read. |
@except std::out_of_range Image read operation mip level out of range. @except std::invalid_argument Image read operation used unsupported format.
void gl::image::write | ( | std::uint32_t | mip_level, |
std::uint32_t | offset_x, | ||
std::uint32_t | offset_y, | ||
std::uint32_t | offset_z, | ||
std::uint32_t | width, | ||
std::uint32_t | height, | ||
std::uint32_t | depth, | ||
gl::format | format, | ||
std::span< const std::byte > | data | ||
) |
Writes pixel data to the image.
mip_level | Level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. |
offset_x | Texel offset in the X-direction. |
offset_y | Texel offset in the Y-direction. |
offset_z | Texel offset in the Z-direction. |
width | Width of the subimage. |
height | Height of the subimage. |
depth | Depth of the subimage. |
format | Format of the image data. |
data | Image data to write. |
@except std::out_of_range Image write operation mip level out of range. @except std::invalid_argument Image write operation used unsupported format. @except std::out_of_range Image write operation exceeded image bounds.
|
friend |