Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
BIAS::clfImage3D Class Reference

OpenCL Image3D wrapper. More...

#include <OpenCLFramework/clfImage3D.hh>

+ Inheritance diagram for BIAS::clfImage3D:
+ Collaboration diagram for BIAS::clfImage3D:

Public Member Functions

void Allocate (BIAS::ImageBase::EStorageType st, BIAS::ImageBase::EColorModel cm, unsigned int width, unsigned int height, unsigned int levels, unsigned int stride=0, bool readonly=false, bool writeonly=false, const void *hostptr=NULL, bool copy=false)
 Allocation of a memory buffer as 3D image, either call directly or use wrapper for BIAS::ImageBase. More...
 
void AllocateFromBiasTemplate (const BIAS::ImageBase &image, unsigned int levels, bool readonly=false, bool writeonly=false)
 Allocation of a memory buffer as 3D image (2d+level), biasimage is used as template for one level. More...
 
void AllocateFromTemplate (const clfImage3D &src, bool readonly=false, bool writeonly=false)
 
void AllocateFromTexture3D (BIAS::glfTexture3D &tex, bool readonly=false, bool writeonly=false)
 Allocation of a memory buffer from a GL Texture3D (works only on shared context!) More...
 
void CopyToBiasImage (BIAS::ImageBase &image, unsigned int level, unsigned int originX=0, unsigned int originY=0, unsigned int regionX=0, unsigned int regionY=0)
 
void CopyToImage (clfImage3D &outputimage, unsigned int srcoriginX=0, unsigned int srcoriginY=0, unsigned int srcoriginZ=0, unsigned int dstoriginX=0, unsigned int dstoriginY=0, unsigned int dstoriginZ=0, unsigned int regionX=0, unsigned int regionY=0, unsigned int regionZ=0)
 
void GetImageDim (unsigned int &width, unsigned int &height, unsigned int &levels)
 
std::vector< std::string > GetSupportedImageFormats (bool readonly=false, bool writeonly=false)
 
unsigned int GLId ()
 
unsigned int Height ()
 
bool Initialized ()
 
bool IsReadOnly ()
 
bool IsSharedGL ()
 
bool IsWriteOnly ()
 
unsigned int Levels ()
 
void * MapImage (bool write=false, unsigned int originX=0, unsigned int originY=0, unsigned int originZ=0, unsigned int regionX=0, unsigned int regionY=0, unsigned int regionZ=0)
 
void ReadFromImage (void *data, unsigned int originX=0, unsigned int originY=0, unsigned int originZ=0, unsigned int regionX=0, unsigned int regionY=0, unsigned int regionZ=0)
 read from image to host memory More...
 
unsigned int Size ()
 
unsigned int SlideStride ()
 
unsigned int Stride ()
 
void UnMap (void *data)
 
unsigned int Width ()
 
void WriteToImage (const void *data, unsigned int originX=0, unsigned int originY=0, unsigned int originZ=0, unsigned int regionX=0, unsigned int regionY=0, unsigned int regionZ=0)
 write from host memory to image More...
 
virtual ~clfImage3D ()
 

Protected Member Functions

 clfImage3D (cl::Context *context, cl::CommandQueue *queue)
 
int DetermineMemFlags_ (bool readonly, bool writeonly, const void *hostptr=NULL, bool copy=false)
 
cl::Image3D & image ()
 
cl::Memory & memory ()
 

Protected Attributes

cl::Memory buffer_
 
cl::Context * context_
 
unsigned int glid_
 
bool initialized_
 
cl::CommandQueue * queue_
 
bool sharedGL_
 
unsigned int size_
 

Friends

class clfContext
 
class clfProgram
 

Detailed Description

OpenCL Image3D wrapper.

An clfImage3D is used for both cl::Images, host and GL objects. All buffers are created from a valid clfContext, hence the constructor is protected.

Author
fkellner 06/11

Definition at line 45 of file clfImage3D.hh.

Constructor & Destructor Documentation

clfImage3D::~clfImage3D ( )
virtual

Definition at line 57 of file clfImage3D.cpp.

clfImage3D::clfImage3D ( cl::Context *  context,
cl::CommandQueue *  queue 
)
protected

Member Function Documentation

void clfImage3D::Allocate ( BIAS::ImageBase::EStorageType  st,
BIAS::ImageBase::EColorModel  cm,
unsigned int  width,
unsigned int  height,
unsigned int  levels,
unsigned int  stride = 0,
bool  readonly = false,
bool  writeonly = false,
const void *  hostptr = NULL,
bool  copy = false 
)
void clfImage3D::AllocateFromBiasTemplate ( const BIAS::ImageBase image,
unsigned int  levels,
bool  readonly = false,
bool  writeonly = false 
)

Allocation of a memory buffer as 3D image (2d+level), biasimage is used as template for one level.

Definition at line 111 of file clfImage3D.cpp.

References Allocate(), BIAS::ImageBase::GetColorModel(), BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetStorageType(), and BIAS::ImageBase::GetWidth().

void clfImage3D::AllocateFromTemplate ( const clfImage3D src,
bool  readonly = false,
bool  writeonly = false 
)

Definition at line 118 of file clfImage3D.cpp.

References Allocate().

void clfImage3D::AllocateFromTexture3D ( BIAS::glfTexture3D tex,
bool  readonly = false,
bool  writeonly = false 
)
void clfImage3D::CopyToBiasImage ( BIAS::ImageBase image,
unsigned int  level,
unsigned int  originX = 0,
unsigned int  originY = 0,
unsigned int  regionX = 0,
unsigned int  regionY = 0 
)
void clfImage3D::CopyToImage ( clfImage3D outputimage,
unsigned int  srcoriginX = 0,
unsigned int  srcoriginY = 0,
unsigned int  srcoriginZ = 0,
unsigned int  dstoriginX = 0,
unsigned int  dstoriginY = 0,
unsigned int  dstoriginZ = 0,
unsigned int  regionX = 0,
unsigned int  regionY = 0,
unsigned int  regionZ = 0 
)

Definition at line 191 of file clfImage3D.cpp.

References image(), and BIAS::clfMemory::queue_.

int BIAS::clfMemory::DetermineMemFlags_ ( bool  readonly,
bool  writeonly,
const void *  hostptr = NULL,
bool  copy = false 
)
protectedinherited
void BIAS::clfImage3D::GetImageDim ( unsigned int &  width,
unsigned int &  height,
unsigned int &  levels 
)
inline

Definition at line 103 of file clfImage3D.hh.

std::vector< std::string > clfImage3D::GetSupportedImageFormats ( bool  readonly = false,
bool  writeonly = false 
)

Definition at line 273 of file clfImage3D.cpp.

unsigned int BIAS::clfMemory::GLId ( )
inherited

Definition at line 47 of file clfMemory.cpp.

References BIAS::clfMemory::glid_, and BIAS::clfMemory::sharedGL_.

unsigned int BIAS::clfImage3D::Height ( )
inline

Definition at line 71 of file clfImage3D.hh.

cl::Image3D & clfImage3D::image ( )
protected

Definition at line 140 of file clfImage3D.cpp.

References BIAS::clfMemory::buffer_.

Referenced by CopyToImage(), MapImage(), ReadFromImage(), and WriteToImage().

bool BIAS::clfMemory::Initialized ( )
inlineinherited

Definition at line 37 of file clfMemory.hh.

bool BIAS::clfMemory::IsReadOnly ( )
inherited
bool BIAS::clfMemory::IsSharedGL ( )
inlineinherited
bool BIAS::clfMemory::IsWriteOnly ( )
inherited

Definition at line 67 of file clfMemory.cpp.

References BIAS::clfMemory::buffer_.

unsigned int BIAS::clfImage3D::Levels ( )
inline

Definition at line 72 of file clfImage3D.hh.

void * clfImage3D::MapImage ( bool  write = false,
unsigned int  originX = 0,
unsigned int  originY = 0,
unsigned int  originZ = 0,
unsigned int  regionX = 0,
unsigned int  regionY = 0,
unsigned int  regionZ = 0 
)

Definition at line 218 of file clfImage3D.cpp.

References image(), and BIAS::clfMemory::queue_.

cl::Memory & BIAS::clfMemory::memory ( )
protectedinherited
void clfImage3D::ReadFromImage ( void *  data,
unsigned int  originX = 0,
unsigned int  originY = 0,
unsigned int  originZ = 0,
unsigned int  regionX = 0,
unsigned int  regionY = 0,
unsigned int  regionZ = 0 
)

read from image to host memory

Definition at line 168 of file clfImage3D.cpp.

References image(), and BIAS::clfMemory::queue_.

Referenced by CopyToBiasImage().

unsigned int BIAS::clfMemory::Size ( )
inlineinherited

Definition at line 40 of file clfMemory.hh.

unsigned int BIAS::clfImage3D::SlideStride ( )
inline

Definition at line 74 of file clfImage3D.hh.

unsigned int BIAS::clfImage3D::Stride ( )
inline

Definition at line 73 of file clfImage3D.hh.

void BIAS::clfMemory::UnMap ( void *  data)
inherited
unsigned int BIAS::clfImage3D::Width ( )
inline

Definition at line 70 of file clfImage3D.hh.

void clfImage3D::WriteToImage ( const void *  data,
unsigned int  originX = 0,
unsigned int  originY = 0,
unsigned int  originZ = 0,
unsigned int  regionX = 0,
unsigned int  regionY = 0,
unsigned int  regionZ = 0 
)

write from host memory to image

Definition at line 144 of file clfImage3D.cpp.

References image(), and BIAS::clfMemory::queue_.

Friends And Related Function Documentation

friend class clfContext
friend

Definition at line 114 of file clfImage3D.hh.

friend class clfProgram
friend

Definition at line 115 of file clfImage3D.hh.

Member Data Documentation

cl::Memory BIAS::clfMemory::buffer_
protectedinherited
cl::Context* BIAS::clfMemory::context_
protectedinherited
unsigned int BIAS::clfMemory::glid_
protectedinherited
bool BIAS::clfMemory::initialized_
protectedinherited
cl::CommandQueue* BIAS::clfMemory::queue_
protectedinherited
bool BIAS::clfMemory::sharedGL_
protectedinherited
unsigned int BIAS::clfMemory::size_
protectedinherited

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