Talvos  0.1
SPIR-V interpreter and dynamic analysis framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Attributes | List of all members
talvos::Image::Texel Class Reference

This class represents a single texel with four 32-bit component values. More...

#include <talvos/Image.h>

Public Member Functions

 Texel ()
 Create a texel with uninitialized component values. More...
 
 Texel (const Object &Obj)
 Create a texel and copy component values from the data in Obj. More...
 
 Texel (const VkClearColorValue &ClearColor)
 Create a texel and copy component values from ClearColor. More...
 
template<typename T >
get (unsigned C) const
 Get a component value from the texel. More...
 
const uint8_t * getData () const
 Returns a const pointer to the raw data backing the texel. More...
 
template<typename T >
void loadSInt (const T *Data)
 Load signed integer texel components. More...
 
template<typename T >
void loadSFloat (const T *Data)
 Load signed floating point texel components. More...
 
template<typename T >
void loadSNorm (const T *Data)
 Load normalized texel components from signed integer data. More...
 
template<typename T >
void loadUInt (const T *Data)
 Load unsigned integer texel components. More...
 
template<typename T >
void loadUNorm (const T *Data)
 Load normalized texel components from unsigned integer data. More...
 
template<typename T >
void set (unsigned C, T Value)
 Set a component value in the texel. More...
 
template<typename T >
void storeSInt (T *Data) const
 Store signed integer texel components, truncating as necessary. More...
 
template<typename T >
void storeSNorm (T *Data) const
 Store normalized texel components as signed integers. More...
 
template<typename T >
void storeUInt (T *Data) const
 Store unsigned integer texel components, truncating as necessary. More...
 
template<typename T >
void storeUNorm (T *Data) const
 Store normalized texel components as unsigned integers. More...
 
Object toObject (const Type *Ty) const
 Create an object with type Ty from the texel data. More...
 

Private Attributes

uint8_t Data [16]
 The data backing this texel. More...
 

Detailed Description

This class represents a single texel with four 32-bit component values.

Definition at line 28 of file Image.h.

Constructor & Destructor Documentation

talvos::Image::Texel::Texel ( )
inline

Create a texel with uninitialized component values.

Definition at line 32 of file Image.h.

talvos::Image::Texel::Texel ( const Object Obj)

Create a texel and copy component values from the data in Obj.

The type of Obj must be a 32-bit scalar or a vector with no more than four 32-bit elements.

Definition at line 24 of file Image.cpp.

talvos::Image::Texel::Texel ( const VkClearColorValue &  ClearColor)

Create a texel and copy component values from ClearColor.

Definition at line 31 of file Image.cpp.

Member Function Documentation

template<typename T >
T talvos::Image::Texel::get ( unsigned  C) const
inline

Get a component value from the texel.

T must be a 32-bit type, and C must be less than 4.

Definition at line 44 of file Image.h.

const uint8_t* talvos::Image::Texel::getData ( ) const
inline

Returns a const pointer to the raw data backing the texel.

Definition at line 52 of file Image.h.

template<typename T >
void talvos::Image::Texel::loadSFloat ( const T *  Data)

Load signed floating point texel components.

Definition at line 36 of file Image.cpp.

template<typename T >
void talvos::Image::Texel::loadSInt ( const T *  Data)

Load signed integer texel components.

Definition at line 44 of file Image.cpp.

template<typename T >
void talvos::Image::Texel::loadSNorm ( const T *  Data)

Load normalized texel components from signed integer data.

Definition at line 52 of file Image.cpp.

template<typename T >
void talvos::Image::Texel::loadUInt ( const T *  Data)

Load unsigned integer texel components.

Definition at line 60 of file Image.cpp.

template<typename T >
void talvos::Image::Texel::loadUNorm ( const T *  Data)

Load normalized texel components from unsigned integer data.

Definition at line 68 of file Image.cpp.

template<typename T >
void talvos::Image::Texel::set ( unsigned  C,
Value 
)
inline

Set a component value in the texel.

T must be a 32-bit type, and C must be less than 4.

Definition at line 71 of file Image.h.

template<typename T >
void talvos::Image::Texel::storeSInt ( T *  Data) const

Store signed integer texel components, truncating as necessary.

Definition at line 76 of file Image.cpp.

template<typename T >
void talvos::Image::Texel::storeSNorm ( T *  Data) const

Store normalized texel components as signed integers.

Definition at line 89 of file Image.cpp.

template<typename T >
void talvos::Image::Texel::storeUInt ( T *  Data) const

Store unsigned integer texel components, truncating as necessary.

Definition at line 106 of file Image.cpp.

template<typename T >
void talvos::Image::Texel::storeUNorm ( T *  Data) const

Store normalized texel components as unsigned integers.

Definition at line 118 of file Image.cpp.

Object talvos::Image::Texel::toObject ( const Type Ty) const

Create an object with type Ty from the texel data.

Ty must be a 32-bit scalar or a vector with no more than four 32-bit elements.

Definition at line 135 of file Image.cpp.

Member Data Documentation

uint8_t talvos::Image::Texel::Data[16]
private

The data backing this texel.

Definition at line 97 of file Image.h.