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

OpenCL Image2D wrapper. More...

#include <OpenCLFramework/clfImage2D.hh>

+ Inheritance diagram for BIAS::clfImage2D:
+ Collaboration diagram for BIAS::clfImage2D:

Public Member Functions

void Allocate (BIAS::ImageBase::EStorageType st, BIAS::ImageBase::EColorModel cm, unsigned int width, unsigned int height, unsigned int stride=0, bool readonly=false, bool writeonly=false, const void *hostptr=NULL, bool copy=false)
 Allocation of a memory buffer as 2D image, either call directly or use wrapper for BIAS::ImageBase. More...
 
void AllocateFromBiasImage (const BIAS::ImageBase &image, bool readonly=false, bool writeonly=false, bool copy=false)
 Allocation of a memory buffer as 2D image, either call directly or use wrapper for BIAS::ImageBase. More...
 
void AllocateFromBiasTemplate (const BIAS::ImageBase &image, bool readonly=false, bool writeonly=false)
 
void AllocateFromTemplate (const clfImage2D &src, bool readonly=false, bool writeonly=false)
 
void AllocateFromTexture2D (BIAS::glfTexture2D &tex, bool readonly=false, bool writeonly=false)
 Allocation of a memory buffer from a GL Texture2D (works only on shared context!) More...
 
BIAS::ImageBase::EColorModel ColorModel () const
 
void CopyToBiasImage (BIAS::ImageBase &image, unsigned int originX=0, unsigned int originY=0, unsigned int regionX=0, unsigned int regionY=0)
 
void CopyToBiasImageUncheckedRGBAToRGB (BIAS::ImageBase &image)
 
void CopyToImage (clfImage2D &outputimage, unsigned int srcoriginX=0, unsigned int srcoriginY=0, unsigned int dstoriginX=0, unsigned int dstoriginY=0, unsigned int regionX=0, unsigned int regionY=0, bool blocking=true)
 
unsigned int GetBitDepth () const
 
BIAS::ImageBase::EColorModel GetColorModel () const
 
void GetImageDim (unsigned int &width, unsigned int &height) const
 
BIAS::MetaDataGetMetaData ()
 
BIAS::ImageBase::EStorageType GetStorageType () const
 
std::vector< std::string > GetSupportedImageFormats (bool readonly=false, bool writeonly=false)
 
BIAS::glfTexture2DGetTexture ()
 
unsigned int GLId ()
 
unsigned int Height () const
 
bool Initialized ()
 
bool IsReadOnly ()
 
bool IsSharedGL ()
 
bool IsSpare ()
 
bool IsSpareInUse ()
 
bool IsWriteOnly ()
 
void LockSpare ()
 
void * MapImage (bool write=false, unsigned int originX=0, unsigned int originY=0, unsigned int regionX=0, unsigned int regionY=0)
 
void ReadFromImage (void *data, unsigned int originX=0, unsigned int originY=0, unsigned int regionX=0, unsigned int regionY=0)
 read from image to host memory More...
 
void SetBitDepth (unsigned int bitdepth)
 
void SetIsSpare (bool spare)
 
void SetMetaData (const BIAS::MetaData &m)
 
void SetStorageAndColorModelInfo (const BIAS::ImageBase::EStorageType &st, const BIAS::ImageBase::EColorModel &cm)
 
unsigned int Size ()
 
BIAS::ImageBase::EStorageType StorageType () const
 
unsigned int Stride () const
 
void UnLockSpare ()
 
void UnMap (void *data)
 
unsigned int Width () const
 
void WriteToImage (const void *data, unsigned int originX=0, unsigned int originY=0, unsigned int regionX=0, unsigned int regionY=0, bool blocking=true)
 write from host memory to image More...
 
virtual ~clfImage2D ()
 

Protected Member Functions

 clfImage2D (cl::Context *context, cl::CommandQueue *queue)
 
int DetermineMemFlags_ (bool readonly, bool writeonly, const void *hostptr=NULL, bool copy=false)
 
cl::Image2D & image () const
 
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 Image2D wrapper.

An clfImage2D 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 46 of file clfImage2D.hh.

Constructor & Destructor Documentation

clfImage2D::~clfImage2D ( )
virtual

Definition at line 59 of file clfImage2D.cpp.

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

Member Function Documentation

void clfImage2D::Allocate ( BIAS::ImageBase::EStorageType  st,
BIAS::ImageBase::EColorModel  cm,
unsigned int  width,
unsigned int  height,
unsigned int  stride = 0,
bool  readonly = false,
bool  writeonly = false,
const void *  hostptr = NULL,
bool  copy = false 
)
void clfImage2D::AllocateFromBiasImage ( const BIAS::ImageBase image,
bool  readonly = false,
bool  writeonly = false,
bool  copy = false 
)
void clfImage2D::AllocateFromBiasTemplate ( const BIAS::ImageBase image,
bool  readonly = false,
bool  writeonly = false 
)
void clfImage2D::AllocateFromTemplate ( const clfImage2D src,
bool  readonly = false,
bool  writeonly = false 
)
void clfImage2D::AllocateFromTexture2D ( BIAS::glfTexture2D tex,
bool  readonly = false,
bool  writeonly = false 
)
BIAS::ImageBase::EColorModel BIAS::clfImage2D::ColorModel ( ) const
inline
void clfImage2D::CopyToBiasImage ( BIAS::ImageBase image,
unsigned int  originX = 0,
unsigned int  originY = 0,
unsigned int  regionX = 0,
unsigned int  regionY = 0 
)
void clfImage2D::CopyToBiasImageUncheckedRGBAToRGB ( BIAS::ImageBase image)
void clfImage2D::CopyToImage ( clfImage2D outputimage,
unsigned int  srcoriginX = 0,
unsigned int  srcoriginY = 0,
unsigned int  dstoriginX = 0,
unsigned int  dstoriginY = 0,
unsigned int  regionX = 0,
unsigned int  regionY = 0,
bool  blocking = true 
)
int BIAS::clfMemory::DetermineMemFlags_ ( bool  readonly,
bool  writeonly,
const void *  hostptr = NULL,
bool  copy = false 
)
protectedinherited
unsigned int BIAS::clfImage2D::GetBitDepth ( ) const
inline
BIAS::ImageBase::EColorModel BIAS::clfImage2D::GetColorModel ( ) const
inline

Definition at line 118 of file clfImage2D.hh.

Referenced by BIAS::clfColorConversion::RGBAToPackedGrey().

void BIAS::clfImage2D::GetImageDim ( unsigned int &  width,
unsigned int &  height 
) const
inline

Definition at line 110 of file clfImage2D.hh.

Referenced by BIAS::clfColorConversion::Clear(), BIAS::clfFilter< InputStorageType, OutputStorageType >::Clear(), BIAS::clfTVL1Flow::ComputeFlow_(), BIAS::clfImageOperator::CutOffMinThreshold(), BIAS::clfImageOperator::Difference(), BIAS::clfRecursiveGauss::Filter(), BIAS::clfSimpleFilter::Filter(), BIAS::clfGradientGauss< InputStorageType, OutputStorageType >::Filter(), BIAS::clfStructureTensor::Filter(), BIAS::clfExtractLocalMaxima::Filter(), BIAS::clfScaleImage::Filter(), BIAS::clfResampleImage::Filter(), BIAS::clfFilter< InputStorageType, OutputStorageType >::Filter_(), BIAS::clfRecursiveGauss::FilterGrey(), BIAS::clfRecursiveGauss::FilterGreyColPacked(), BIAS::clfSimpleFilter::FilterScale(), BIAS::clfRecursiveGauss::FilterX(), BIAS::clfRecursiveGauss::FilterY(), BIAS::clfColorConversion::FloatGreyToFloatGrey(), BIAS::clfColorConversion::FloatGreyToRGBA(), BIAS::clfUnifiedMultilateralFilter::Init(), BIAS::clfColorConversion::RGBToFloatLuv(), BIAS::clfColorConversion::RGBToGrey(), BIAS::clfColorConversion::RGBToRGBA(), BIAS::clfColorConversion::ScaleColorOfRGBPlusDepth(), BIAS::clfColorConversion::UCharBayerToRGBA(), BIAS::clfColorConversion::UCharGreyToFloatGrey(), BIAS::clfColorConversion::UCharRGBAToYUV420P(), BIAS::clfColorConversion::UCharRGBDVSToRGBA(), BIAS::clfColorConversion::UCharRGBToFloatGreyNormalized(), BIAS::clfColorConversion::UCharYUYV422DPXToRGBA(), BIAS::clfColorConversion::UCharYUYV422ToRGBA(), and BIAS::clfTVL1Flow::Warp_().

BIAS::MetaData* BIAS::clfImage2D::GetMetaData ( )
inline

Definition at line 134 of file clfImage2D.hh.

BIAS::ImageBase::EStorageType BIAS::clfImage2D::GetStorageType ( ) const
inline

Definition at line 122 of file clfImage2D.hh.

Referenced by BIAS::clfColorConversion::RGBAToPackedGrey().

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

Definition at line 356 of file clfImage2D.cpp.

BIAS::glfTexture2D* BIAS::clfImage2D::GetTexture ( )
inline

Definition at line 142 of file clfImage2D.hh.

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::clfImage2D::Height ( ) const
inline
cl::Image2D & clfImage2D::image ( ) const
protected
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::clfImage2D::IsSpare ( )
bool BIAS::clfImage2D::IsSpareInUse ( )
bool BIAS::clfMemory::IsWriteOnly ( )
inherited

Definition at line 67 of file clfMemory.cpp.

References BIAS::clfMemory::buffer_.

void BIAS::clfImage2D::LockSpare ( )
void * clfImage2D::MapImage ( bool  write = false,
unsigned int  originX = 0,
unsigned int  originY = 0,
unsigned int  regionX = 0,
unsigned int  regionY = 0 
)

Definition at line 259 of file clfImage2D.cpp.

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

Referenced by CopyToBiasImageUncheckedRGBAToRGB().

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

read from image to host memory

Definition at line 216 of file clfImage2D.cpp.

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

Referenced by CopyToBiasImage().

void BIAS::clfImage2D::SetBitDepth ( unsigned int  bitdepth)
inline

Definition at line 130 of file clfImage2D.hh.

void BIAS::clfImage2D::SetIsSpare ( bool  spare)
void BIAS::clfImage2D::SetMetaData ( const BIAS::MetaData m)
inline

Definition at line 138 of file clfImage2D.hh.

Referenced by AllocateFromBiasImage(), AllocateFromBiasTemplate(), and CopyToImage().

void clfImage2D::SetStorageAndColorModelInfo ( const BIAS::ImageBase::EStorageType st,
const BIAS::ImageBase::EColorModel cm 
)

Definition at line 346 of file clfImage2D.cpp.

References BIAS::clfMemory::IsSharedGL().

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

Definition at line 40 of file clfMemory.hh.

BIAS::ImageBase::EStorageType BIAS::clfImage2D::StorageType ( ) const
inline
unsigned int BIAS::clfImage2D::Stride ( ) const
inline

Definition at line 75 of file clfImage2D.hh.

void BIAS::clfImage2D::UnLockSpare ( )
void BIAS::clfMemory::UnMap ( void *  data)
inherited
unsigned int BIAS::clfImage2D::Width ( ) const
inline
void clfImage2D::WriteToImage ( const void *  data,
unsigned int  originX = 0,
unsigned int  originY = 0,
unsigned int  regionX = 0,
unsigned int  regionY = 0,
bool  blocking = true 
)

write from host memory to image

Definition at line 195 of file clfImage2D.cpp.

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

Referenced by BIAS::clfTVL1Flow::AddImage(), and BIAS::clfUnifiedMultilateralFilter::SetImage().

Friends And Related Function Documentation

friend class clfContext
friend

Definition at line 159 of file clfImage2D.hh.

friend class clfProgram
friend

Definition at line 160 of file clfImage2D.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: