Basic Image AlgorithmS Library
2.8.0
|
OpenCL Image2D wrapper. More...
#include <OpenCLFramework/clfImage2D.hh>
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::MetaData * | GetMetaData () |
BIAS::ImageBase::EStorageType | GetStorageType () const |
std::vector< std::string > | GetSupportedImageFormats (bool readonly=false, bool writeonly=false) |
BIAS::glfTexture2D * | GetTexture () |
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 |
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.
Definition at line 46 of file clfImage2D.hh.
|
virtual |
Definition at line 59 of file clfImage2D.cpp.
|
protected |
Definition at line 37 of file clfImage2D.cpp.
References BIAS::ImageBase::CM_invalid, BIAS::clfMemory::context_, and BIAS::ImageBase::ST_invalid.
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 |
||
) |
Allocation of a memory buffer as 2D image, either call directly or use wrapper for BIAS::ImageBase.
Definition at line 62 of file clfImage2D.cpp.
References BIAS::clfMemory::buffer_, BIAS::ImageBase::CM_Grey, BIAS::ImageBase::CM_RGB, BIAS::clfMemory::context_, BIAS::clfMemory::DetermineMemFlags_(), BIAS::ImageBase::GetChannelcount(), BIAS::clfMemory::initialized_, BIAS::clfMemory::sharedGL_, BIAS::clfMemory::size_, BIAS::ImageBase::ST_float, BIAS::ImageBase::ST_int, BIAS::ImageBase::ST_unsignedchar, BIAS::ImageBase::ST_unsignedint, and BIAS::ImageBase::ST_unsignedshortint.
Referenced by AllocateFromBiasImage(), AllocateFromBiasTemplate(), AllocateFromTemplate(), BIAS::clfRecursiveGauss::FilterGreyColPacked(), BIAS::clfUnifiedMultilateralFilter::Init(), BIAS::clfUnifiedMultilateralFilter::InitColorFilter(), BIAS::clfUnifiedMultilateralFilter::InitCredibilityFilter(), BIAS::clfUnifiedMultilateralFilter::InitDepthFilter(), BIAS::clfTVL1Flow::newImage_(), and BIAS::clfColorConversion::RGBAToPackedGrey().
void clfImage2D::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.
Definition at line 123 of file clfImage2D.cpp.
References Allocate(), BIAS::ImageBase::GetBitDepth(), BIAS::ImageBase::GetColorModel(), BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetImageData(), BIAS::ImageBase::GetMetaData(), BIAS::ImageBase::GetStorageType(), BIAS::ImageBase::GetWidth(), BIAS::ImageBase::GetWidthStep(), and SetMetaData().
void clfImage2D::AllocateFromBiasTemplate | ( | const BIAS::ImageBase & | image, |
bool | readonly = false , |
||
bool | writeonly = false |
||
) |
Definition at line 133 of file clfImage2D.cpp.
References Allocate(), BIAS::ImageBase::GetBitDepth(), BIAS::ImageBase::GetColorModel(), BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetMetaData(), BIAS::ImageBase::GetStorageType(), BIAS::ImageBase::GetWidth(), BIAS::ImageBase::GetWidthStep(), and SetMetaData().
Referenced by BIAS::clfUnifiedMultilateralFilter::Init().
void clfImage2D::AllocateFromTemplate | ( | const clfImage2D & | src, |
bool | readonly = false , |
||
bool | writeonly = false |
||
) |
Definition at line 142 of file clfImage2D.cpp.
References Allocate(), image(), _cl_image_format::image_channel_data_type, _cl_image_format::image_channel_order, and BIAS::ImageBase::ST_invalid.
Referenced by BIAS::clfRecursiveGauss::FilterGrey(), BIAS::clfRecursiveGauss::FilterGreyColPacked(), BIAS::clfRecursiveGauss::FilterX(), BIAS::clfRecursiveGauss::FilterY(), and BIAS::clfUnifiedMultilateralFilter::Init().
void clfImage2D::AllocateFromTexture2D | ( | BIAS::glfTexture2D & | tex, |
bool | readonly = false , |
||
bool | writeonly = false |
||
) |
Allocation of a memory buffer from a GL Texture2D (works only on shared context!)
Definition at line 156 of file clfImage2D.cpp.
References BIAS::clfMemory::buffer_, BIAS::ImageBase::CM_RGBA, BIAS::clfMemory::context_, BIAS::clfMemory::DetermineMemFlags_(), BIAS::ImageBase::GetChannelcount(), BIAS::ImageBase::GetStorageSizeByte(), BIAS::glfTexture::GetTextureID(), BIAS::glfTexture::GetTextureTarget(), BIAS::clfMemory::initialized_, BIAS::clfMemory::sharedGL_, BIAS::clfMemory::size_, and BIAS::ImageBase::ST_float.
|
inline |
Definition at line 76 of file clfImage2D.hh.
Referenced by BIAS::clfRecursiveGauss::FilterGreyColPacked(), BIAS::clfUnifiedMultilateralFilter::Init(), BIAS::clfColorConversion::RGBToGrey(), and BIAS::clfColorConversion::ToRGBA().
void clfImage2D::CopyToBiasImage | ( | BIAS::ImageBase & | image, |
unsigned int | originX = 0 , |
||
unsigned int | originY = 0 , |
||
unsigned int | regionX = 0 , |
||
unsigned int | regionY = 0 |
||
) |
Definition at line 283 of file clfImage2D.cpp.
References BIAS::ImageBase::CM_invalid, BIAS::ImageBase::GetChannelcount(), BIAS::ImageBase::GetColorModel(), BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetImageData(), BIAS::ImageBase::GetStorageType(), BIAS::ImageBase::GetWidth(), image(), _cl_image_format::image_channel_data_type, _cl_image_format::image_channel_order, BIAS::ImageBase::Init(), BIAS::ImageBase::IsEmpty(), ReadFromImage(), BIAS::ImageBase::Release(), BIAS::ImageBase::SetColorModel(), BIAS::ImageBase::SetMetaData(), and BIAS::ImageBase::ST_invalid.
Referenced by BIAS::clfUnifiedMultilateralFilter::Compute(), BIAS::clfTVL1Flow::ComputeFlow_(), and BIAS::clfUnifiedMultilateralFilter::GetResult().
void clfImage2D::CopyToBiasImageUncheckedRGBAToRGB | ( | BIAS::ImageBase & | image | ) |
Definition at line 320 of file clfImage2D.cpp.
References BIAS::ImageBase::CM_RGB, BIAS::ImageBase::CM_RGBA, BIAS::ImageBase::GetByteDepth(), BIAS::ImageBase::GetColorModel(), BIAS::ImageBase::GetImageData(), MapImage(), BIAS::ImageBase::SetMetaData(), and BIAS::clfMemory::UnMap().
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 |
||
) |
Definition at line 233 of file clfImage2D.cpp.
References image(), BIAS::clfMemory::queue_, and SetMetaData().
Referenced by BIAS::clfTVL1Flow::ComputeFlow_(), BIAS::clfRecursiveGauss::FilterGreyColPacked(), BIAS::clfUnifiedMultilateralFilter::SetColorImage(), and BIAS::clfUnifiedMultilateralFilter::SetDepthImage().
|
protectedinherited |
Definition at line 73 of file clfMemory.cpp.
Referenced by BIAS::clfImage3D::Allocate(), Allocate(), BIAS::clfBuffer::Allocate(), AllocateFromTexture2D(), BIAS::clfImage3D::AllocateFromTexture3D(), and BIAS::clfBuffer::AllocateFromVertexBuffer().
|
inline |
Definition at line 126 of file clfImage2D.hh.
Referenced by BIAS::clfColorConversion::UCharBayerToRGBA(), and BIAS::clfColorConversion::UCharGreyToFloatGrey().
|
inline |
Definition at line 118 of file clfImage2D.hh.
Referenced by BIAS::clfColorConversion::RGBAToPackedGrey().
|
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_().
|
inline |
Definition at line 134 of file clfImage2D.hh.
|
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.
|
inline |
Definition at line 142 of file clfImage2D.hh.
|
inherited |
Definition at line 47 of file clfMemory.cpp.
References BIAS::clfMemory::glid_, and BIAS::clfMemory::sharedGL_.
|
inline |
Definition at line 74 of file clfImage2D.hh.
Referenced by BIAS::clfUnifiedMultilateralFilter::Compute(), BIAS::clfCopy::Copy(), and BIAS::clfColorConversion::RGBAToPackedGrey().
|
protected |
Definition at line 191 of file clfImage2D.cpp.
References BIAS::clfMemory::buffer_.
Referenced by AllocateFromTemplate(), CopyToBiasImage(), CopyToImage(), BIAS::clfProgram::KernelSetArgument(), MapImage(), ReadFromImage(), and WriteToImage().
|
inlineinherited |
Definition at line 37 of file clfMemory.hh.
|
inherited |
Definition at line 62 of file clfMemory.cpp.
References BIAS::clfMemory::buffer_.
Referenced by BIAS::clfRecursiveGauss::FilterGrey(), and BIAS::clfRecursiveGauss::FilterGreyColPacked().
|
inlineinherited |
Definition at line 38 of file clfMemory.hh.
Referenced by BIAS::clfColorConversion::RGBAToPackedGrey(), BIAS::clfColorConversion::RGBToGrey(), and SetStorageAndColorModelInfo().
bool BIAS::clfImage2D::IsSpare | ( | ) |
bool BIAS::clfImage2D::IsSpareInUse | ( | ) |
|
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().
|
protectedinherited |
Definition at line 43 of file clfMemory.cpp.
References BIAS::clfMemory::buffer_.
Referenced by BIAS::clfContext::AcquireGLObject(), BIAS::clfContext::ReleaseGLObject(), and BIAS::clfMemory::UnMap().
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().
|
inline |
Definition at line 130 of file clfImage2D.hh.
void BIAS::clfImage2D::SetIsSpare | ( | bool | spare | ) |
|
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().
|
inlineinherited |
Definition at line 40 of file clfMemory.hh.
|
inline |
Definition at line 77 of file clfImage2D.hh.
Referenced by BIAS::clfRecursiveGauss::FilterGreyColPacked(), BIAS::clfUnifiedMultilateralFilter::Init(), and BIAS::clfColorConversion::ToRGBA().
|
inline |
Definition at line 75 of file clfImage2D.hh.
void BIAS::clfImage2D::UnLockSpare | ( | ) |
|
inherited |
Definition at line 54 of file clfMemory.cpp.
References BIAS::clfMemory::memory(), and BIAS::clfMemory::queue_.
Referenced by BIAS::clfTrimmedICP::ComputeNearestPoints_(), BIAS::clfTrimmedICP::ComputeOptimalMotion_(), and CopyToBiasImageUncheckedRGBAToRGB().
|
inline |
Definition at line 73 of file clfImage2D.hh.
Referenced by BIAS::clfUnifiedMultilateralFilter::Compute(), BIAS::clfCopy::Copy(), and BIAS::clfColorConversion::RGBAToPackedGrey().
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().
|
friend |
Definition at line 159 of file clfImage2D.hh.
|
friend |
Definition at line 160 of file clfImage2D.hh.
|
protectedinherited |
Definition at line 56 of file clfMemory.hh.
Referenced by BIAS::clfImage3D::Allocate(), Allocate(), BIAS::clfBuffer::Allocate(), AllocateFromTexture2D(), BIAS::clfImage3D::AllocateFromTexture3D(), BIAS::clfBuffer::AllocateFromVertexBuffer(), BIAS::clfBuffer::buffer(), BIAS::clfImage3D::image(), image(), BIAS::clfMemory::IsReadOnly(), BIAS::clfMemory::IsWriteOnly(), and BIAS::clfMemory::memory().
|
protectedinherited |
Definition at line 54 of file clfMemory.hh.
Referenced by BIAS::clfImage3D::Allocate(), Allocate(), BIAS::clfBuffer::Allocate(), AllocateFromTexture2D(), BIAS::clfImage3D::AllocateFromTexture3D(), BIAS::clfBuffer::AllocateFromVertexBuffer(), clfImage2D(), BIAS::clfImage3D::clfImage3D(), and BIAS::clfMemory::clfMemory().
|
protectedinherited |
Definition at line 61 of file clfMemory.hh.
Referenced by BIAS::clfBuffer::AllocateFromVertexBuffer(), BIAS::clfMemory::clfMemory(), and BIAS::clfMemory::GLId().
|
protectedinherited |
Definition at line 59 of file clfMemory.hh.
Referenced by BIAS::clfImage3D::Allocate(), Allocate(), BIAS::clfBuffer::Allocate(), AllocateFromTexture2D(), BIAS::clfImage3D::AllocateFromTexture3D(), BIAS::clfBuffer::AllocateFromVertexBuffer(), and BIAS::clfMemory::clfMemory().
|
protectedinherited |
Definition at line 55 of file clfMemory.hh.
Referenced by BIAS::clfMemory::clfMemory(), BIAS::clfBuffer::CopyBuffer(), BIAS::clfImage3D::CopyToImage(), CopyToImage(), BIAS::clfBuffer::MapBuffer(), BIAS::clfImage3D::MapImage(), MapImage(), BIAS::clfBuffer::ReadFromBuffer(), BIAS::clfImage3D::ReadFromImage(), ReadFromImage(), BIAS::clfMemory::UnMap(), BIAS::clfBuffer::WriteToBuffer(), BIAS::clfImage3D::WriteToImage(), and WriteToImage().
|
protectedinherited |
Definition at line 60 of file clfMemory.hh.
Referenced by BIAS::clfImage3D::Allocate(), Allocate(), BIAS::clfBuffer::Allocate(), AllocateFromTexture2D(), BIAS::clfImage3D::AllocateFromTexture3D(), BIAS::clfBuffer::AllocateFromVertexBuffer(), BIAS::clfMemory::clfMemory(), and BIAS::clfMemory::GLId().
|
protectedinherited |
Definition at line 58 of file clfMemory.hh.
Referenced by BIAS::clfImage3D::Allocate(), Allocate(), BIAS::clfBuffer::Allocate(), AllocateFromTexture2D(), BIAS::clfImage3D::AllocateFromTexture3D(), BIAS::clfBuffer::AllocateFromVertexBuffer(), BIAS::clfMemory::clfMemory(), BIAS::clfBuffer::CopyBuffer(), BIAS::clfBuffer::MapBuffer(), BIAS::clfBuffer::ReadFromBuffer(), and BIAS::clfBuffer::WriteToBuffer().