37 static const char*
getName(StorageType);
38 static StorageType storageTypeFromName(
const char *
name);
40 static const char* getStorageString(StorageType);
44 {
return (t ==
INT8 || t == FIXED8) ? 1 :
45 ((t ==
INT16 || t == FLOAT16 || t == FIXED16) ? 2 : 4); }
67 return myBuffer() != 0;
92 void readIn(
const void*
src,
bool blocking =
true);
97 void writeOut(
void*
dst,
bool blocking =
true)
const;
102 template <
typename T>
112 int64 totalMemory()
const;
152 return indexToPos(x, y, z, pos, myWidth, myHeight);
157 static bool indexToPos(
int x,
int y,
int z,
UT_Vector3F& pos,
int w,
int h);
176 template <
typename T>
188 template <
typename T>
194 template <CE_Image::StorageType STORAGE>
250 template <CE_Image::StorageType STORAGE,
typename SCALAR_TYPE>
263 return SCALAR_TYPE(v);
267 template <
typename SCALAR_TYPE>
271 CE_Image::StorageType::FIXED8;
285 return SCALAR_TYPE(v) / SCALAR_TYPE(ONE_POINT);
289 template <
typename SCALAR_TYPE>
293 CE_Image::StorageType::FIXED16;
307 return SCALAR_TYPE(v) / SCALAR_TYPE(ONE_POINT);
312 template <CE_Image::StorageType FROM, CE_Image::StorageType TO>
329 template <CE_Image::StorageType STORAGE>
static SYS_FORCE_INLINE CE_SCALAR_TYPE toCEImage(SCALAR_TYPE v)
static SYS_FORCE_INLINE SCALAR_TYPE fromCEImage(CE_SCALAR_TYPE v)
typename CE_StorageTypeTraits< STORAGE >::DataType FROM_SCALAR_TYPE
static bool storesIntegers(StorageType t)
static bool isFixedPoint(StorageType t)
getFileOption("OpenEXR:storage") storage
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
typename CE_StorageTypeTraits< STORAGE >::DataType CE_SCALAR_TYPE
typename CE_StorageTypeTraits< TO >::DataType TO_SCALAR_TYPE
GLdouble GLdouble GLdouble z
void swap(T &lhs, T &rhs)
static SYS_FORCE_INLINE TO_SCALAR_TYPE convert(FROM_SCALAR_TYPE v)
int getWidth() const
Returns the image's width.
__hostdev__ void setValue(uint32_t offset, bool v)
bool indexToPos(int x, int y, int z, UT_Vector3F &pos) const
int getChannels() const
Returns the number of channels per pixel.
GLint GLsizei GLsizei height
Type traits for a given storage type...
static SYS_FORCE_INLINE CE_SCALAR_TYPE toCEImage(SCALAR_TYPE v)
void CE_API CEfillFlatStorageFromVoxelArray(void *dest, const UT_VoxelArray< T > &src, CE_Image::StorageType storage)
typename CE_StorageTypeTraits< FROM >::DataType FROM_SCALAR_TYPE
void CE_API CEfillVoxelArrayFromFlatStorage(UT_VoxelArray< T > &dest, const void *src, CE_Image::StorageType storage)
PXL_API const char * getName(const ColorSpace *space)
Return the name of the color space.
UT_Vector3T< T > SYSclamp(const UT_Vector3T< T > &v, const UT_Vector3T< T > &min, const UT_Vector3T< T > &max)
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
cl::Buffer myBuffer
OpenCL descriptor for the actual GPU buffer.
GLuint const GLchar * name
int getHeight() const
Returns the image's height.
typename CE_StorageTypeTraits< STORAGE >::DataType CE_SCALAR_TYPE
static const int DataSize
static SYS_FORCE_INLINE SCALAR_TYPE fromCEImage(CE_SCALAR_TYPE v)
GLfloat GLfloat GLfloat GLfloat h
SIM_API const UT_StringHolder force
static SYS_FORCE_INLINE SCALAR_TYPE fromCEImage(CE_SCALAR_TYPE v)
int myWidth
Sizes of the buffer.
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
Kernel functor interface.
static SYS_FORCE_INLINE TO_SCALAR_TYPE convert(FROM_SCALAR_TYPE v)
static int getBytes(StorageType t)
Kernel interface that implements cl_kernel.
GLubyte GLubyte GLubyte GLubyte w
StorageType getStorage() const
Identifies the type of data stored for each channel of every pixel.
static SYS_FORCE_INLINE CE_SCALAR_TYPE toCEImage(SCALAR_TYPE v)
typename CE_StorageTypeTraits< STORAGE >::DataType CE_SCALAR_TYPE
const cl::Buffer & buffer() const
Returns this buffer descriptor.
Templated function for converting between different storage types.
ImageBuf OIIO_API channels(const ImageBuf &src, int nchannels, cspan< int > channelorder, cspan< float > channelvalues={}, cspan< std::string > newchannelnames={}, bool shuffle_channel_names=false, int nthreads=0)
typename CE_StorageTypeTraits< STORAGE >::DataType TO_SCALAR_TYPE