HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
imagebufalgo_util.h File Reference
#include <functional>
#include <OpenImageIO/parallel.h>
#include <OpenImageIO/imagebufalgo.h>
+ Include dependency graph for imagebufalgo_util.h:

Go to the source code of this file.

Namespaces

 ImageBufAlgo
 

Macros

#define OIIO_DISPATCH_TYPES(ret, name, func, type, R,...)
 
#define OIIO_DISPATCH_TYPES2_HELP(ret, name, func, Rtype, Atype, R,...)
 
#define OIIO_DISPATCH_TYPES2(ret, name, func, Rtype, Atype, R,...)
 
#define OIIO_DISPATCH_COMMON_TYPES(ret, name, func, type, R,...)
 
#define OIIO_DISPATCH_COMMON_TYPES2_HELP(ret, name, func, Rtype, Atype, R, A,...)
 
#define OIIO_DISPATCH_COMMON_TYPES2(ret, name, func, Rtype, Atype, R, A,...)
 
#define OIIO_DISPATCH_COMMON_TYPES2_CONST(ret, name, func, Rtype, Atype, R, A,...)
 
#define OIIO_DISPATCH_COMMON_TYPES3_HELP2(ret, name, func, Rtype, Atype, Btype, R, A, B,...)
 
#define OIIO_DISPATCH_COMMON_TYPES3_HELP(ret, name, func, Rtype, Atype, Btype, R, A, B,...)
 
#define OIIO_DISPATCH_COMMON_TYPES3(ret, name, func, Rtype, Atype, Btype, R, A, B,...)
 
#define IBA_FIX_PERCHAN_LEN(av, len, missing, zdef)
 
#define IBA_FIX_PERCHAN_LEN_DEF(av, len)   IBA_FIX_PERCHAN_LEN (av, len, 0.0f, av.size() ? av.back() : 0.0f);
 

Enumerations

enum  ImageBufAlgo::IBAprep_flags {
  ImageBufAlgo::IBAprep_DEFAULT = 0, ImageBufAlgo::IBAprep_REQUIRE_ALPHA = 1<<0, ImageBufAlgo::IBAprep_REQUIRE_Z = 1<<1, ImageBufAlgo::IBAprep_REQUIRE_SAME_NCHANNELS = 1<<2,
  ImageBufAlgo::IBAprep_NO_COPY_ROI_FULL = 1<<3, ImageBufAlgo::IBAprep_NO_SUPPORT_VOLUME = 1<<4, ImageBufAlgo::IBAprep_NO_COPY_METADATA = 1<<8, ImageBufAlgo::IBAprep_COPY_ALL_METADATA = 1<<9,
  ImageBufAlgo::IBAprep_CLAMP_MUTUAL_NCHANNELS = 1<<10, ImageBufAlgo::IBAprep_SUPPORT_DEEP = 1<<11, ImageBufAlgo::IBAprep_DEEP_MIXED = 1<<12, ImageBufAlgo::IBAprep_DST_FLOAT_PIXELS = 1<<13,
  ImageBufAlgo::IBAprep_MINIMIZE_NCHANNELS = 1<<14, ImageBufAlgo::IBAprep_REQUIRE_MATCHING_CHANNELS = 1<<15, ImageBufAlgo::IBAprep_MERGE_METADATA = 1 << 16
}
 

Functions

void ImageBufAlgo::parallel_image (ROI roi, parallel_options opt, std::function< void(ROI)> f)
 
void ImageBufAlgo::parallel_image (ROI roi, std::function< void(ROI)> f)
 
template<class Func >
void ImageBufAlgo::parallel_image (Func f, ROI roi, int nthreads=0, SplitDir splitdir=Split_Y)
 
bool OIIO_API ImageBufAlgo::IBAprep (ROI &roi, ImageBuf *dst, const ImageBuf *A=NULL, const ImageBuf *B=NULL, const ImageBuf *C=NULL, ImageSpec *force_spec=NULL, int prepflags=0)
 
bool ImageBufAlgo::IBAprep (ROI &roi, ImageBuf *dst, const ImageBuf *A, const ImageBuf *B, ImageSpec *force_spec, int prepflags=0)
 
bool ImageBufAlgo::IBAprep (ROI &roi, ImageBuf *dst, const ImageBuf *A, const ImageBuf *B, int prepflags)
 
bool ImageBufAlgo::IBAprep (ROI &roi, ImageBuf *dst, const ImageBuf *A, int prepflags)
 
TypeDesc::BASETYPE OIIO_API ImageBufAlgo::type_merge (TypeDesc::BASETYPE a, TypeDesc::BASETYPE b)
 
TypeDesc ImageBufAlgo::type_merge (TypeDesc a, TypeDesc b)
 
TypeDesc ImageBufAlgo::type_merge (TypeDesc a, TypeDesc b, TypeDesc c)
 

Macro Definition Documentation

#define IBA_FIX_PERCHAN_LEN (   av,
  len,
  missing,
  zdef 
)
Value:
if (av.size() < len) { \
int nc = len; \
float *vals = OIIO_ALLOCA(float, nc); \
for (int i = 0; i < nc; ++i) \
vals[i] = i < av.size() ? av[i] : (i ? vals[i-1] : zdef); \
av = cspan<float>(vals, nc); \
}
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
#define OIIO_ALLOCA(type, size)
Definition: platform.h:318
Definition: span.h:73
IMATH_NAMESPACE::V2f float
* for(int i=0;i< n_subtasks;++i)*tasks.push(pool-> push(myfunc))
Definition: UT_RTreeImpl.h:685

Definition at line 500 of file imagebufalgo_util.h.

#define IBA_FIX_PERCHAN_LEN_DEF (   av,
  len 
)    IBA_FIX_PERCHAN_LEN (av, len, 0.0f, av.size() ? av.back() : 0.0f);

Definition at line 511 of file imagebufalgo_util.h.

#define OIIO_DISPATCH_COMMON_TYPES (   ret,
  name,
  func,
  type,
  R,
  ... 
)
Value:
switch (type.basetype) { \
case TypeDesc::FLOAT : \
ret = func<float> (R, __VA_ARGS__); break; \
case TypeDesc::UINT8 : \
ret = func<unsigned char> (R, __VA_ARGS__); break; \
case TypeDesc::HALF : \
ret = func<half> (R, __VA_ARGS__); break; \
ret = func<unsigned short> (R, __VA_ARGS__); break; \
default: { \
/* other types: punt and convert to float, then copy back */ \
ImageBuf Rtmp; \
if ((R).initialized()) \
Rtmp.copy (R, TypeDesc::FLOAT); \
ret = func<float> (Rtmp, __VA_ARGS__); \
if (ret) \
(R).copy (Rtmp); \
else \
(R).errorfmt("{}", Rtmp.geterror()); \
} \
}
32-bit IEEE floating point values, (C/C++ float).
Definition: typedesc.h:82
16-bit IEEE floating point values (OpenEXR half).
Definition: typedesc.h:81
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
GLenum func
Definition: glcorearb.h:783
if(num_boxed_items<=0)
Definition: UT_RTreeImpl.h:697
type
Definition: core.h:1059

Definition at line 269 of file imagebufalgo_util.h.

#define OIIO_DISPATCH_COMMON_TYPES2 (   ret,
  name,
  func,
  Rtype,
  Atype,
  R,
  A,
  ... 
)

Definition at line 314 of file imagebufalgo_util.h.

#define OIIO_DISPATCH_COMMON_TYPES2_CONST (   ret,
  name,
  func,
  Rtype,
  Atype,
  R,
  A,
  ... 
)
Value:
switch (Rtype.basetype) { \
OIIO_DISPATCH_COMMON_TYPES2_HELP(ret,name,func,float,Atype,R,A,__VA_ARGS__); \
break; \
OIIO_DISPATCH_COMMON_TYPES2_HELP(ret,name,func,unsigned char,Atype,R,A,__VA_ARGS__); \
break; \
OIIO_DISPATCH_COMMON_TYPES2_HELP(ret,name,func,half,Atype,R,A,__VA_ARGS__); \
break; \
OIIO_DISPATCH_COMMON_TYPES2_HELP(ret,name,func,unsigned short,Atype,R,A,__VA_ARGS__); \
break; \
default: { \
/* other types: punt and convert to float, then copy back */ \
ImageBuf Rtmp; \
if ((R).initialized()) \
Rtmp.copy (R, TypeDesc::FLOAT); \
OIIO_DISPATCH_COMMON_TYPES2_HELP(ret,name,func,float,Atype,Rtmp,A,__VA_ARGS__); \
} }
32-bit IEEE floating point values, (C/C++ float).
Definition: typedesc.h:82
16-bit IEEE floating point values (OpenEXR half).
Definition: typedesc.h:81
imath_half_bits_t half
if we're in a C-only context, alias the half bits type to half
Definition: half.h:266
#define OIIO_DISPATCH_COMMON_TYPES2_HELP(ret, name, func, Rtype, Atype, R, A,...)
GLuint const GLchar * name
Definition: glcorearb.h:786
GLenum func
Definition: glcorearb.h:783
if(num_boxed_items<=0)
Definition: UT_RTreeImpl.h:697

Definition at line 373 of file imagebufalgo_util.h.

#define OIIO_DISPATCH_COMMON_TYPES2_HELP (   ret,
  name,
  func,
  Rtype,
  Atype,
  R,
  A,
  ... 
)
Value:
switch (Atype.basetype) { \
case TypeDesc::FLOAT : \
ret = func<Rtype,float> (R, A, __VA_ARGS__); break; \
case TypeDesc::UINT8 : \
ret = func<Rtype,unsigned char> (R, A, __VA_ARGS__); break; \
case TypeDesc::HALF : \
ret = func<Rtype,half> (R, A, __VA_ARGS__); break; \
ret = func<Rtype,unsigned short> (R, A, __VA_ARGS__); break; \
default: { \
/* other types: punt and convert to float, then copy back */ \
ImageBuf Atmp; \
Atmp.copy (A, TypeDesc::FLOAT); \
ret = func<Rtype,float> (R, Atmp, __VA_ARGS__); \
} \
}
32-bit IEEE floating point values, (C/C++ float).
Definition: typedesc.h:82
16-bit IEEE floating point values (OpenEXR half).
Definition: typedesc.h:81
GLenum func
Definition: glcorearb.h:783

Definition at line 293 of file imagebufalgo_util.h.

#define OIIO_DISPATCH_COMMON_TYPES3 (   ret,
  name,
  func,
  Rtype,
  Atype,
  Btype,
  R,
  A,
  B,
  ... 
)

Definition at line 446 of file imagebufalgo_util.h.

#define OIIO_DISPATCH_COMMON_TYPES3_HELP (   ret,
  name,
  func,
  Rtype,
  Atype,
  Btype,
  R,
  A,
  B,
  ... 
)
Value:
switch (Btype.basetype) { \
OIIO_DISPATCH_COMMON_TYPES3_HELP2(ret,name,func,Rtype,Atype,float,R,A,B,__VA_ARGS__); \
break; \
OIIO_DISPATCH_COMMON_TYPES3_HELP2(ret,name,func,Rtype,Atype,unsigned char,R,A,B,__VA_ARGS__); \
break; \
OIIO_DISPATCH_COMMON_TYPES3_HELP2(ret,name,func,Rtype,Atype,half,R,A,B,__VA_ARGS__); \
break; \
OIIO_DISPATCH_COMMON_TYPES3_HELP2(ret,name,func,Rtype,Atype,unsigned short,R,A,B,__VA_ARGS__); \
break; \
default: { \
/* other types: punt and convert to float */ \
ImageBuf Btmp; \
Btmp.copy (B, TypeDesc::FLOAT); \
OIIO_DISPATCH_COMMON_TYPES3_HELP2(ret,name,func,Rtype,Atype,float,R,A,Btmp,__VA_ARGS__); \
} \
}
32-bit IEEE floating point values, (C/C++ float).
Definition: typedesc.h:82
16-bit IEEE floating point values (OpenEXR half).
Definition: typedesc.h:81
imath_half_bits_t half
if we're in a C-only context, alias the half bits type to half
Definition: half.h:266
#define OIIO_DISPATCH_COMMON_TYPES3_HELP2(ret, name, func, Rtype, Atype, Btype, R, A, B,...)
GLuint const GLchar * name
Definition: glcorearb.h:786
GLenum func
Definition: glcorearb.h:783

Definition at line 421 of file imagebufalgo_util.h.

#define OIIO_DISPATCH_COMMON_TYPES3_HELP2 (   ret,
  name,
  func,
  Rtype,
  Atype,
  Btype,
  R,
  A,
  B,
  ... 
)
Value:
switch (Rtype.basetype) { \
case TypeDesc::FLOAT : \
ret = func<float,Atype,Btype> (R,A,B,__VA_ARGS__); break; \
case TypeDesc::UINT8 : \
ret = func<unsigned char,Atype,Btype> (R,A,B,__VA_ARGS__); break; \
case TypeDesc::HALF : \
ret = func<half,Atype,Btype> (R,A,B,__VA_ARGS__); break; \
ret = func<unsigned short,Atype,Btype> (R,A,B,__VA_ARGS__); break; \
default: { \
/* other types: punt and convert to float, then copy back */ \
ImageBuf Rtmp; \
if ((R).initialized()) \
Rtmp.copy (R, TypeDesc::FLOAT); \
ret = func<float,Atype,Btype> (R,A,B,__VA_ARGS__); \
if (ret) \
(R).copy (Rtmp); \
else \
(R).errorfmt("{}", Rtmp.geterror()); \
} \
}
32-bit IEEE floating point values, (C/C++ float).
Definition: typedesc.h:82
16-bit IEEE floating point values (OpenEXR half).
Definition: typedesc.h:81
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
GLenum func
Definition: glcorearb.h:783
if(num_boxed_items<=0)
Definition: UT_RTreeImpl.h:697

Definition at line 397 of file imagebufalgo_util.h.

#define OIIO_DISPATCH_TYPES (   ret,
  name,
  func,
  type,
  R,
  ... 
)
Value:
switch (type.basetype) { \
case TypeDesc::FLOAT : \
ret = func<float> (R, __VA_ARGS__); break; \
case TypeDesc::UINT8 : \
ret = func<unsigned char> (R, __VA_ARGS__); break; \
case TypeDesc::HALF : \
ret = func<half> (R, __VA_ARGS__); break; \
ret = func<unsigned short> (R, __VA_ARGS__); break; \
case TypeDesc::INT8 : \
ret = func<char> (R, __VA_ARGS__); break; \
case TypeDesc::INT16 : \
ret = func<short> (R, __VA_ARGS__); break; \
case TypeDesc::UINT : \
ret = func<unsigned int> (R, __VA_ARGS__); break; \
case TypeDesc::INT : \
ret = func<int> (R, __VA_ARGS__); break; \
ret = func<double> (R, __VA_ARGS__); break; \
default: \
(R).errorfmt("{}: Unsupported pixel data format '{}'", name, type); \
ret = false; \
}
32-bit IEEE floating point values, (C/C++ float).
Definition: typedesc.h:82
64-bit IEEE floating point values, (C/C++ double).
Definition: typedesc.h:83
16-bit IEEE floating point values (OpenEXR half).
Definition: typedesc.h:81
GLuint const GLchar * name
Definition: glcorearb.h:786
GLenum func
Definition: glcorearb.h:783
type
Definition: core.h:1059

Definition at line 180 of file imagebufalgo_util.h.

#define OIIO_DISPATCH_TYPES2 (   ret,
  name,
  func,
  Rtype,
  Atype,
  R,
  ... 
)

Definition at line 232 of file imagebufalgo_util.h.

#define OIIO_DISPATCH_TYPES2_HELP (   ret,
  name,
  func,
  Rtype,
  Atype,
  R,
  ... 
)
Value:
switch (Atype.basetype) { \
case TypeDesc::FLOAT : \
ret = func<Rtype,float> (R, __VA_ARGS__); break; \
case TypeDesc::UINT8 : \
ret = func<Rtype,unsigned char> (R, __VA_ARGS__); break; \
case TypeDesc::HALF : \
ret = func<Rtype,half> (R, __VA_ARGS__); break; \
ret = func<Rtype,unsigned short> (R, __VA_ARGS__); break; \
case TypeDesc::INT8 : \
ret = func<Rtype,char> (R, __VA_ARGS__); break; \
case TypeDesc::INT16 : \
ret = func<Rtype,short> (R, __VA_ARGS__); break; \
case TypeDesc::UINT : \
ret = func<Rtype,unsigned int> (R, __VA_ARGS__); break; \
case TypeDesc::INT : \
ret = func<Rtype,int> (R, __VA_ARGS__); break; \
ret = func<Rtype,double> (R, __VA_ARGS__); break; \
default: \
(R).errorfmt("{}: Unsupported pixel data format '{}'", name, Atype); \
ret = false; \
}
32-bit IEEE floating point values, (C/C++ float).
Definition: typedesc.h:82
64-bit IEEE floating point values, (C/C++ double).
Definition: typedesc.h:83
16-bit IEEE floating point values (OpenEXR half).
Definition: typedesc.h:81
GLuint const GLchar * name
Definition: glcorearb.h:786
GLenum func
Definition: glcorearb.h:783

Definition at line 206 of file imagebufalgo_util.h.