NTrace
GPU ray tracing framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FW::Image Class Reference

#include <Image.hpp>

Public Member Functions

 Image (const Vec2i &size, const ImageFormat &format=ImageFormat::ABGR_8888)
 
 Image (const Vec2i &size, const ImageFormat &format, void *ptr, S64 stride)
 
 Image (const Vec2i &size, const ImageFormat &format, Buffer &buffer, S64 ofs, S64 stride)
 
 Image (const Image &other)
 
 ~Image (void)
 
bool contains (const Vec2i &pos, const Vec2i &size) const
 
const Vec2igetSize (void) const
 
const ImageFormatgetFormat (void) const
 
int getBPP (void) const
 
S64 getStride (void) const
 
BuffergetBuffer (void) const
 
S64 getOffset (const Vec2i &pos=0) const
 
const U8getPtr (const Vec2i &pos=0) const
 
U8getMutablePtr (const Vec2i &pos=0)
 
void read (const ImageFormat &format, void *ptr, S64 stride, const Vec2i &pos, const Vec2i &size) const
 
void read (const ImageFormat &format, void *ptr, S64 stride) const
 
void write (const ImageFormat &format, const void *ptr, S64 stride, const Vec2i &pos, const Vec2i &size)
 
void write (const ImageFormat &format, const void *ptr, S64 stride)
 
void set (const Vec2i &dstPos, const Image &src, const Vec2i &srcPos, const Vec2i &size)
 
void set (const Image &src)
 
void clear (U32 abgr=0)
 
void clear (const Vec4f &color)
 
U32 getABGR (const Vec2i &pos) const
 
void setABGR (const Vec2i &pos, U32 value)
 
Vec4f getVec4f (const Vec2i &pos) const
 
void setVec4f (const Vec2i &pos, const Vec4f &value)
 
void getChannels (F32 *values, const Vec2i &pos, int first, int num) const
 
void getChannels (F32 *values, const Vec2i &pos) const
 
const Array< F32 > & getChannels (const Vec2i &pos) const
 
F32 getChannel (const Vec2i &pos, int idx) const
 
void setChannels (const Vec2i &pos, const F32 *values, int first, int num)
 
void setChannels (const Vec2i &pos, const F32 *values)
 
void setChannel (const Vec2i &pos, int idx, F32 value)
 
void flipX (void)
 
void flipY (void)
 
GLuint createGLTexture (ImageFormat::ID desiredFormat=ImageFormat::ID_Max, bool generateMipmaps=true) const
 
ImageFormat chooseCudaFormat (CUDA_ARRAY_DESCRIPTOR *desc=NULL, ImageFormat::ID desiredFormat=ImageFormat::ID_Max) const
 
CUarray createCudaArray (ImageFormat::ID desiredFormat=ImageFormat::ID_Max) const
 
Imagedownscale2x (void) const
 
Imageoperator= (const Image &other)
 

Detailed Description

Definition at line 132 of file Image.hpp.

Constructor & Destructor Documentation

FW::Image::Image ( const Vec2i size,
const ImageFormat format = ImageFormat::ABGR_8888 
)
inline

Definition at line 135 of file Image.hpp.

Image::Image ( const Vec2i size,
const ImageFormat format,
void ptr,
S64  stride 
)

Definition at line 239 of file Image.cpp.

Image::Image ( const Vec2i size,
const ImageFormat format,
Buffer buffer,
S64  ofs,
S64  stride 
)

Definition at line 260 of file Image.cpp.

FW::Image::Image ( const Image other)
inline

Definition at line 138 of file Image.hpp.

Image::~Image ( void  )

Definition at line 274 of file Image.cpp.

Member Function Documentation

ImageFormat Image::chooseCudaFormat ( CUDA_ARRAY_DESCRIPTOR *  desc = NULL,
ImageFormat::ID  desiredFormat = ImageFormat::ID_Max 
) const

Definition at line 531 of file Image.cpp.

void FW::Image::clear ( U32  abgr = 0)
inline

Definition at line 160 of file Image.hpp.

void FW::Image::clear ( const Vec4f color)
inline

Definition at line 161 of file Image.hpp.

bool FW::Image::contains ( const Vec2i pos,
const Vec2i size 
) const
inline

Definition at line 141 of file Image.hpp.

CUarray Image::createCudaArray ( ImageFormat::ID  desiredFormat = ImageFormat::ID_Max) const

Definition at line 608 of file Image.cpp.

GLuint Image::createGLTexture ( ImageFormat::ID  desiredFormat = ImageFormat::ID_Max,
bool  generateMipmaps = true 
) const

Definition at line 475 of file Image.cpp.

Image * Image::downscale2x ( void  ) const

Definition at line 673 of file Image.cpp.

void Image::flipX ( void  )

Definition at line 440 of file Image.cpp.

void Image::flipY ( void  )

Definition at line 459 of file Image.cpp.

U32 Image::getABGR ( const Vec2i pos) const

Definition at line 282 of file Image.cpp.

int FW::Image::getBPP ( void  ) const
inline

Definition at line 145 of file Image.hpp.

Buffer& FW::Image::getBuffer ( void  ) const
inline

Definition at line 148 of file Image.hpp.

F32 FW::Image::getChannel ( const Vec2i pos,
int  idx 
) const
inline

Definition at line 170 of file Image.hpp.

void FW::Image::getChannels ( F32 values,
const Vec2i pos,
int  first,
int  num 
) const
inline

Definition at line 167 of file Image.hpp.

void FW::Image::getChannels ( F32 values,
const Vec2i pos 
) const
inline

Definition at line 168 of file Image.hpp.

const Array<F32>& FW::Image::getChannels ( const Vec2i pos) const
inline

Definition at line 169 of file Image.hpp.

const ImageFormat& FW::Image::getFormat ( void  ) const
inline

Definition at line 144 of file Image.hpp.

U8* FW::Image::getMutablePtr ( const Vec2i pos = 0)
inline

Definition at line 151 of file Image.hpp.

S64 FW::Image::getOffset ( const Vec2i pos = 0) const
inline

Definition at line 149 of file Image.hpp.

const U8* FW::Image::getPtr ( const Vec2i pos = 0) const
inline

Definition at line 150 of file Image.hpp.

const Vec2i& FW::Image::getSize ( void  ) const
inline

Definition at line 143 of file Image.hpp.

S64 FW::Image::getStride ( void  ) const
inline

Definition at line 146 of file Image.hpp.

Vec4f Image::getVec4f ( const Vec2i pos) const

Definition at line 369 of file Image.cpp.

Image& FW::Image::operator= ( const Image other)
inline

Definition at line 185 of file Image.hpp.

void FW::Image::read ( const ImageFormat format,
void ptr,
S64  stride,
const Vec2i pos,
const Vec2i size 
) const
inline

Definition at line 153 of file Image.hpp.

void FW::Image::read ( const ImageFormat format,
void ptr,
S64  stride 
) const
inline

Definition at line 154 of file Image.hpp.

void FW::Image::set ( const Vec2i dstPos,
const Image src,
const Vec2i srcPos,
const Vec2i size 
)
inline

Definition at line 157 of file Image.hpp.

void FW::Image::set ( const Image src)
inline

Definition at line 158 of file Image.hpp.

void Image::setABGR ( const Vec2i pos,
U32  value 
)

Definition at line 329 of file Image.cpp.

void FW::Image::setChannel ( const Vec2i pos,
int  idx,
F32  value 
)
inline

Definition at line 173 of file Image.hpp.

void FW::Image::setChannels ( const Vec2i pos,
const F32 values,
int  first,
int  num 
)
inline

Definition at line 171 of file Image.hpp.

void FW::Image::setChannels ( const Vec2i pos,
const F32 values 
)
inline

Definition at line 172 of file Image.hpp.

void Image::setVec4f ( const Vec2i pos,
const Vec4f value 
)

Definition at line 406 of file Image.cpp.

void FW::Image::write ( const ImageFormat format,
const void ptr,
S64  stride,
const Vec2i pos,
const Vec2i size 
)
inline

Definition at line 155 of file Image.hpp.

void FW::Image::write ( const ImageFormat format,
const void ptr,
S64  stride 
)
inline

Definition at line 156 of file Image.hpp.


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