Radium Engine  1.5.20
Loading...
Searching...
No Matches
Ra::Engine::Data::ImageParameters Struct Reference

#include <Engine/Data/Texture.hpp>

+ Collaboration diagram for Ra::Engine::Data::ImageParameters:

Public Types

using ImageType = std::shared_ptr<void>
 Types for texels variant.
 
using CubeMapType = std::array<std::shared_ptr<void>, 6>
 

Public Member Functions

template<typename TexelType >
bool isTexelOfType () const
 check which type is held by texels
 
ImageType getImage () const
 
void setImage (ImageType image)
 
const void * getTexels () const
 
const CubeMapType getCubeMap () const
 
void setCubeMap (CubeMapType cubeMap)
 

Public Attributes

GLenum target { GL_TEXTURE_2D }
 
size_t width { 1 }
 
size_t height { 1 }
 
size_t depth { 1 }
 
GLenum format { GL_RGB }
 
GLenum internalFormat { GL_RGB }
 OpenGL internal format (WARNING, for Integer textures, must be GL_XXX_INTEGER)
 
GLenum type { GL_UNSIGNED_BYTE }
 
bool isLinear { false }
 set to true when linearize texture rgb component. If true, linearize has no effect.
 
std::variant< ImageType, CubeMapTypetexels { nullptr }
 

Detailed Description

ImageParameters stores the infomation needed to upload a image to the GPU as a texture. The actual data is stored as a std::variant, so this image parameter can store either a single image or a cube map as an array of 6 images. The stored shared_ptr is void, and must correspond to the format described by the other ImageParameters data member. Its perfectly fine to have nullptr texels to represent GPU only texture.

Definition at line 40 of file Texture.hpp.

Member Typedef Documentation

◆ CubeMapType

◆ ImageType

Types for texels variant.

Definition at line 42 of file Texture.hpp.

Member Function Documentation

◆ getCubeMap()

const CubeMapType Ra::Engine::Data::ImageParameters::getCubeMap ( ) const
inline

get cube map array of shared ptr throws std::bad_variant_access if !isTexelOfType<CubeMapType>() see std::get

Definition at line 65 of file Texture.hpp.

+ Here is the call graph for this function:

◆ getImage()

ImageType Ra::Engine::Data::ImageParameters::getImage ( ) const
inline

Definition at line 51 of file Texture.hpp.

◆ getTexels()

const void * Ra::Engine::Data::ImageParameters::getTexels ( ) const
inline

get texels raw pointer throws std::bad_variant_access if !isTexelOfType<ImageType>() see std::get

Definition at line 60 of file Texture.hpp.

+ Here is the call graph for this function:

◆ isTexelOfType()

template<typename TexelType >
bool Ra::Engine::Data::ImageParameters::isTexelOfType ( ) const
inline

check which type is held by texels

Definition at line 47 of file Texture.hpp.

◆ setCubeMap()

void Ra::Engine::Data::ImageParameters::setCubeMap ( CubeMapType cubeMap)
inline

Definition at line 69 of file Texture.hpp.

◆ setImage()

void Ra::Engine::Data::ImageParameters::setImage ( ImageType image)
inline

Definition at line 55 of file Texture.hpp.

Member Data Documentation

◆ depth

size_t Ra::Engine::Data::ImageParameters::depth { 1 }

Definition at line 74 of file Texture.hpp.

◆ format

GLenum Ra::Engine::Data::ImageParameters::format { GL_RGB }

Definition at line 75 of file Texture.hpp.

◆ height

size_t Ra::Engine::Data::ImageParameters::height { 1 }

Definition at line 73 of file Texture.hpp.

◆ internalFormat

GLenum Ra::Engine::Data::ImageParameters::internalFormat { GL_RGB }

OpenGL internal format (WARNING, for Integer textures, must be GL_XXX_INTEGER)

Definition at line 77 of file Texture.hpp.

◆ isLinear

bool Ra::Engine::Data::ImageParameters::isLinear { false }

set to true when linearize texture rgb component. If true, linearize has no effect.

Definition at line 80 of file Texture.hpp.

◆ target

GLenum Ra::Engine::Data::ImageParameters::target { GL_TEXTURE_2D }

Definition at line 71 of file Texture.hpp.

◆ texels

std::variant<ImageType, CubeMapType> Ra::Engine::Data::ImageParameters::texels { nullptr }

Definition at line 81 of file Texture.hpp.

◆ type

GLenum Ra::Engine::Data::ImageParameters::type { GL_UNSIGNED_BYTE }

Definition at line 78 of file Texture.hpp.

◆ width

size_t Ra::Engine::Data::ImageParameters::width { 1 }

Definition at line 72 of file Texture.hpp.


The documentation for this struct was generated from the following file: