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
}
 

Functions

void ImageBufAlgo::parallel_image (ROI roi, parallel_image_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::BASETYPE ImageBufAlgo::type_merge (TypeDesc::BASETYPE a, TypeDesc::BASETYPE b, TypeDesc::BASETYPE c)
 
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 = 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); \
}
Definition: span.h:47
typedef int(WINAPI *PFNWGLRELEASEPBUFFERDCARBPROC)(HPBUFFERARB hPbuffer
* for(int i=0;i< n_subtasks;++i)*tasks.push(pool-> push(myfunc))
#define ALLOCA(type, size)
Deprecated (for namespace pollution reasons)
Definition: platform.h:194
GLenum GLsizei len
Definition: glew.h:7752

Definition at line 530 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 541 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).error ("%s", Rtmp.geterror()); \
} \
}
GLuint GLuint GLsizei GLenum type
Definition: glew.h:1253
GLenum func
Definition: glcorearb.h:782
OIIO_API bool copy(string_view from, string_view to, std::string &err)
if(rank==1) return rank

Definition at line 299 of file imagebufalgo_util.h.

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

Definition at line 344 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__); \
} }
GLuint const GLchar * name
Definition: glew.h:1814
#define OIIO_DISPATCH_COMMON_TYPES2_HELP(ret, name, func, Rtype, Atype, R, A,...)
GLenum func
Definition: glcorearb.h:782
if(rank==1) return rank
Definition: half.h:91

Definition at line 403 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__); \
} \
}
GLenum func
Definition: glcorearb.h:782

Definition at line 323 of file imagebufalgo_util.h.

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

Definition at line 476 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__); \
} \
}
GLuint const GLchar * name
Definition: glew.h:1814
#define OIIO_DISPATCH_COMMON_TYPES3_HELP2(ret, name, func, Rtype, Atype, Btype, R, A, B,...)
GLenum func
Definition: glcorearb.h:782
Definition: half.h:91

Definition at line 451 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).error ("%s", Rtmp.geterror()); \
} \
}
GLenum func
Definition: glcorearb.h:782
OIIO_API bool copy(string_view from, string_view to, std::string &err)
if(rank==1) return rank

Definition at line 427 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).error ("%s: Unsupported pixel data format '%s'", name, type); \
ret = false; \
}
GLuint const GLchar * name
Definition: glew.h:1814
GLuint GLuint GLsizei GLenum type
Definition: glew.h:1253
GLenum func
Definition: glcorearb.h:782

Definition at line 210 of file imagebufalgo_util.h.

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

Definition at line 262 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).error ("%s: Unsupported pixel data format '%s'", name, Atype); \
ret = false; \
}
GLuint const GLchar * name
Definition: glew.h:1814
GLenum func
Definition: glcorearb.h:782

Definition at line 236 of file imagebufalgo_util.h.