25 #ifndef CLFIMAGE3D_HH_
26 #define CLFIMAGE3D_HH_
28 #include <bias_config.h>
29 #include <Base/Common/BIASpragmaStart.hh>
30 #include <OpenCLFramework/clfOpenCL.hh>
31 #include <OpenCLFramework/clfMemory.hh>
32 #include <OpenGLFramework/Base/glfTexture3D.hh>
55 unsigned int width,
unsigned int height,
unsigned int levels,
unsigned int stride=0,
56 bool readonly=
false,
bool writeonly=
false,
const void *hostptr = NULL,
bool copy =
false);
61 void AllocateFromBiasTemplate(
const BIAS::ImageBase &image,
unsigned int levels,
bool readonly=
false,
bool writeonly=
false);
63 void AllocateFromTemplate(
const clfImage3D &src,
bool readonly=
false,
bool writeonly=
false);
68 void AllocateFromTexture3D(
BIAS::glfTexture3D &tex,
bool readonly=
false,
bool writeonly=
false);
70 inline unsigned int Width() {
return width_; }
71 inline unsigned int Height() {
return height_; }
72 inline unsigned int Levels() {
return depth_; }
73 inline unsigned int Stride() {
return stride_; }
77 void WriteToImage(
const void *data,
78 unsigned int originX=0,
unsigned int originY=0,
unsigned int originZ=0,
79 unsigned int regionX=0,
unsigned int regionY=0,
unsigned int regionZ=0);
82 void ReadFromImage(
void *data,
83 unsigned int originX=0,
unsigned int originY=0,
unsigned int originZ=0,
84 unsigned int regionX=0,
unsigned int regionY=0,
unsigned int regionZ=0);
87 unsigned int srcoriginX=0,
unsigned int srcoriginY=0,
unsigned int srcoriginZ=0,
88 unsigned int dstoriginX=0,
unsigned int dstoriginY=0,
unsigned int dstoriginZ=0,
89 unsigned int regionX=0,
unsigned int regionY=0,
unsigned int regionZ=0);
91 void* MapImage(
bool write =
false,
92 unsigned int originX=0,
unsigned int originY=0,
unsigned int originZ=0,
93 unsigned int regionX=0,
unsigned int regionY=0,
unsigned int regionZ=0
97 unsigned int originX=0,
unsigned int originY=0,
98 unsigned int regionX=0,
unsigned int regionY=0
101 std::vector<std::string> GetSupportedImageFormats(
bool readonly=
false,
bool writeonly=
false);
103 void GetImageDim(
unsigned int &width,
unsigned int &height,
unsigned int &levels) {
110 clfImage3D(cl::Context *context, cl::CommandQueue *queue);
111 cl::Image3D& image();
118 bool GetFormatSupported_(cl::ImageFormat test,
bool readonly,
bool writeonly);
119 void MakeDim_(cl::size_t<3> &dest,
int x,
int y,
int z);
121 unsigned int width_, height_, depth_, stride_, slideStride_;
126 static std::vector<cl::ImageFormat> imageFormatsReadable_;
127 static std::vector<cl::ImageFormat> imageFormatsWritable_;
128 static std::vector<cl::ImageFormat> imageFormatsReadWrite_;
132 #include <Base/Common/BIASpragmaEnd.hh>
EColorModel
These are the most often used color models.
void GetImageDim(unsigned int &width, unsigned int &height, unsigned int &levels)
unsigned int SlideStride()
This is the base class for images in BIAS.