Antkeeper  0.0.1
Public Member Functions | Protected Member Functions | Friends | List of all members
gl::image Class Referenceabstract

#include <image.hpp>

Inheritance diagram for gl::image:
gl::image_1d gl::image_2d gl::image_3d gl::image_cube

Public Member Functions

virtual ~image ()=0
 Destructs an image. More...
 
 image (const image &)=delete
 
 image (image &&)=delete
 
imageoperator= (const image &)=delete
 
imageoperator= (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
 

Detailed Description

Definition at line 36 of file image.hpp.

Constructor & Destructor Documentation

◆ ~image()

gl::image::~image ( )
pure virtual

Destructs an image.

Definition at line 240 of file image.cpp.

◆ image() [1/3]

gl::image::image ( const image )
delete

◆ image() [2/3]

gl::image::image ( image &&  )
delete

◆ image() [3/3]

gl::image::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 
)
protected

Constructs an image.

Parameters
dimensionalityImage dimensionality, on [1, 3].
formatFormat and type of the texel blocks that will be contained in the image.
widthWidth of the image.
heightHeight of the image.
depthDepth of the image.
mip_levelsNumber of levels of detail available for minified sampling of the image.
array_layersNumber of layers in the image.
flagsImage 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.

Definition at line 35 of file image.cpp.

Member Function Documentation

◆ copy()

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.

Parameters
src_mip_levelSource image level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image.
src_xSource image texel offset in the X-direction.
src_ySource image texel offset in the Y-direction.
src_zSource image texel offset in the Z-direction.
dst_imageDestination image.
dst_mip_levelDestination image level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image.
dst_xDestination image texel offset in the X-direction.
dst_yDestination image texel offset in the Y-direction.
dst_zDestination image texel offset in the Z-direction.
widthWidth of the subimage to copy.
heightHeight of the subimage to copy.
depthDepth of the subimage to copy.

Definition at line 432 of file image.cpp.

◆ generate_mipmaps()

void gl::image::generate_mipmaps ( )

Generates mip subimages.

Definition at line 468 of file image.cpp.

◆ get_array_layers()

constexpr std::uint32_t gl::image::get_array_layers ( ) const
inlineconstexprnoexcept

Returns the number of layers in the image.

Definition at line 186 of file image.hpp.

◆ get_dimensionality()

constexpr std::uint8_t gl::image::get_dimensionality ( ) const
inlineconstexprnoexcept

Returns the dimensionality of the image.

Definition at line 144 of file image.hpp.

◆ get_dimensions()

constexpr const std::array<std::uint32_t, 3>& gl::image::get_dimensions ( ) const
inlineconstexprnoexcept

Returns the dimensions of the image.

Definition at line 174 of file image.hpp.

◆ get_flags()

constexpr std::uint8_t gl::image::get_flags ( ) const
inlineconstexprnoexcept

Returns the image flags.

Definition at line 192 of file image.hpp.

◆ get_format()

constexpr format gl::image::get_format ( ) const
inlineconstexprnoexcept

Returns the format and type of the texel blocks contained in the image.

Definition at line 168 of file image.hpp.

◆ get_mip_levels()

constexpr std::uint32_t gl::image::get_mip_levels ( ) const
inlineconstexprnoexcept

Returns the number of levels of detail available for minified sampling of the image.

Definition at line 180 of file image.hpp.

◆ is_1d()

constexpr bool gl::image::is_1d ( ) const
inlineconstexprnoexcept

Returns true if the image is 1D, false otherwise.

Definition at line 150 of file image.hpp.

◆ is_2d()

constexpr bool gl::image::is_2d ( ) const
inlineconstexprnoexcept

Returns true if the image is 2D, false otherwise.

Definition at line 156 of file image.hpp.

◆ is_3d()

constexpr bool gl::image::is_3d ( ) const
inlineconstexprnoexcept

Returns true if the image is 3D, false otherwise.

Definition at line 162 of file image.hpp.

◆ is_cube_compatible()

constexpr bool gl::image::is_cube_compatible ( ) const
inlineconstexprnoexcept

Returns true if the image is cube map compatible, false otherwise.

Definition at line 198 of file image.hpp.

◆ operator=() [1/2]

image& gl::image::operator= ( const image )
delete

◆ operator=() [2/2]

image& gl::image::operator= ( image &&  )
delete

◆ read()

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.

Parameters
mip_levelLevel-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image.
offset_xTexel offset in the X-direction.
offset_yTexel offset in the Y-direction.
offset_zTexel offset in the Z-direction.
widthWidth of the subimage.
heightHeight of the subimage.
depthDepth of the subimage.
formatFormat of the image data.
dataBuffer 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.

Definition at line 245 of file image.cpp.

◆ write()

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.

Parameters
mip_levelLevel-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image.
offset_xTexel offset in the X-direction.
offset_yTexel offset in the Y-direction.
offset_zTexel offset in the Z-direction.
widthWidth of the subimage.
heightHeight of the subimage.
depthDepth of the subimage.
formatFormat of the image data.
dataImage 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.

Definition at line 289 of file image.cpp.

Friends And Related Function Documentation

◆ image_view

friend class image_view
friend

Definition at line 250 of file image.hpp.


The documentation for this class was generated from the following files: