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::ImageView Class Reference

This class represents a view into a range of image subresources. More...

#include <talvos/Image.h>

Public Member Functions

 ImageView (const Image &Img, VkImageViewType Type, VkFormat Format, VkImageSubresourceRange Range)
 Create an image view. More...
 
uint32_t getBaseArrayLayer () const
 Returns the base array layer of the image view. More...
 
uint32_t getBaseMipLevel () const
 Returns the base mip level of the image view. More...
 
uint32_t getDepth (uint32_t Level=0) const
 Get the depth of the image view at the specified mip level. More...
 
VkFormat getFormat () const
 Returns the format of the image. More...
 
uint32_t getHeight (uint32_t Level=0) const
 Get the height of the image view at the specified mip level. More...
 
const ImagegetImage () const
 Returns the image that the image view corresponds to. More...
 
uint32_t getNumArrayLayers () const
 Returns the number of array layers in the image view. More...
 
uint32_t getNumMipLevels () const
 Returns the number of mip levels in the image view. More...
 
uint64_t getTexelAddress (uint32_t X, uint32_t Y=0, uint32_t Z=0, uint32_t Layer=0, uint32_t MipLevel=0) const
 Returns the address in memory of the texel at the specified coordinate. More...
 
VkImageViewType getType () const
 Returns the type of the image view. More...
 
uint32_t getWidth (uint32_t Level=0) const
 Get the width of the image view at the specified mip level. More...
 
bool is1D () const
 Returns true if this image view corresponds to a 1D image. More...
 
bool is2D () const
 Returns true if this image view corresponds to a 2D image. More...
 
bool is3D () const
 Returns true if this image view corresponds to a 3D image. More...
 
bool isCube () const
 Returns true if this image view corresponds to a cube map. More...
 
void read (Image::Texel &T, uint32_t X, uint32_t Y=0, uint32_t Z=0, uint32_t Layer=0, uint32_t MipLevel=0) const
 Read a texel from the image view at the specified coordinate. More...
 
void write (const Image::Texel &T, uint32_t X, uint32_t Y=0, uint32_t Z=0, uint32_t Layer=0, uint32_t MipLevel=0) const
 Write a texel to the image view at the specified coordinate. More...
 

Private Attributes

const ImageImg
 The image that the image corresponds to. More...
 
VkImageViewType Type
 The type of the image view. More...
 
VkFormat Format
 The format of the image view. More...
 
uint32_t BaseArrayLayer
 The base array layer. More...
 
uint32_t NumArrayLayers
 The number of array layers. More...
 
uint32_t BaseMipLevel
 The base mip level. More...
 
uint32_t NumMipLevels
 The number of mip levels. More...
 

Detailed Description

This class represents a view into a range of image subresources.

Definition at line 178 of file Image.h.

Constructor & Destructor Documentation

talvos::ImageView::ImageView ( const Image Img,
VkImageViewType  Type,
VkFormat  Format,
VkImageSubresourceRange  Range 
)

Create an image view.

Definition at line 450 of file Image.cpp.

Member Function Documentation

uint32_t talvos::ImageView::getBaseArrayLayer ( ) const
inline

Returns the base array layer of the image view.

Definition at line 186 of file Image.h.

uint32_t talvos::ImageView::getBaseMipLevel ( ) const
inline

Returns the base mip level of the image view.

Definition at line 189 of file Image.h.

uint32_t talvos::ImageView::getDepth ( uint32_t  Level = 0) const

Get the depth of the image view at the specified mip level.

Definition at line 465 of file Image.cpp.

VkFormat talvos::ImageView::getFormat ( ) const
inline

Returns the format of the image.

Definition at line 195 of file Image.h.

uint32_t talvos::ImageView::getHeight ( uint32_t  Level = 0) const

Get the height of the image view at the specified mip level.

Definition at line 470 of file Image.cpp.

const Image& talvos::ImageView::getImage ( ) const
inline

Returns the image that the image view corresponds to.

Definition at line 201 of file Image.h.

uint32_t talvos::ImageView::getNumArrayLayers ( ) const
inline

Returns the number of array layers in the image view.

Definition at line 204 of file Image.h.

uint32_t talvos::ImageView::getNumMipLevels ( ) const
inline

Returns the number of mip levels in the image view.

Definition at line 207 of file Image.h.

uint64_t talvos::ImageView::getTexelAddress ( uint32_t  X,
uint32_t  Y = 0,
uint32_t  Z = 0,
uint32_t  Layer = 0,
uint32_t  MipLevel = 0 
) const

Returns the address in memory of the texel at the specified coordinate.

Definition at line 475 of file Image.cpp.

VkImageViewType talvos::ImageView::getType ( ) const
inline

Returns the type of the image view.

Definition at line 214 of file Image.h.

uint32_t talvos::ImageView::getWidth ( uint32_t  Level = 0) const

Get the width of the image view at the specified mip level.

Definition at line 482 of file Image.cpp.

bool talvos::ImageView::is1D ( ) const

Returns true if this image view corresponds to a 1D image.

Definition at line 487 of file Image.cpp.

bool talvos::ImageView::is2D ( ) const

Returns true if this image view corresponds to a 2D image.

Definition at line 492 of file Image.cpp.

bool talvos::ImageView::is3D ( ) const

Returns true if this image view corresponds to a 3D image.

Definition at line 497 of file Image.cpp.

bool talvos::ImageView::isCube ( ) const

Returns true if this image view corresponds to a cube map.

Definition at line 499 of file Image.cpp.

void talvos::ImageView::read ( Image::Texel T,
uint32_t  X,
uint32_t  Y = 0,
uint32_t  Z = 0,
uint32_t  Layer = 0,
uint32_t  MipLevel = 0 
) const

Read a texel from the image view at the specified coordinate.

Definition at line 505 of file Image.cpp.

void talvos::ImageView::write ( const Image::Texel T,
uint32_t  X,
uint32_t  Y = 0,
uint32_t  Z = 0,
uint32_t  Layer = 0,
uint32_t  MipLevel = 0 
) const

Write a texel to the image view at the specified coordinate.

Definition at line 511 of file Image.cpp.

Member Data Documentation

uint32_t talvos::ImageView::BaseArrayLayer
private

The base array layer.

Definition at line 245 of file Image.h.

uint32_t talvos::ImageView::BaseMipLevel
private

The base mip level.

Definition at line 247 of file Image.h.

VkFormat talvos::ImageView::Format
private

The format of the image view.

Definition at line 243 of file Image.h.

const Image& talvos::ImageView::Img
private

The image that the image corresponds to.

Definition at line 240 of file Image.h.

uint32_t talvos::ImageView::NumArrayLayers
private

The number of array layers.

Definition at line 246 of file Image.h.

uint32_t talvos::ImageView::NumMipLevels
private

The number of mip levels.

Definition at line 248 of file Image.h.

VkImageViewType talvos::ImageView::Type
private

The type of the image view.

Definition at line 242 of file Image.h.