18 #define OPENIMAGEIO_IMAGEIO_H
23 # pragma warning(disable : 4251)
75 namespace Filesystem {
113 : xbegin(xbegin), xend(xend), ybegin(ybegin), yend(yend),
149 return (
a.xbegin ==
b.xbegin &&
a.xend ==
b.xend &&
150 a.ybegin ==
b.ybegin &&
a.yend ==
b.yend &&
151 a.zbegin ==
b.zbegin &&
a.zend ==
b.zend &&
152 a.chbegin ==
b.chbegin &&
a.chend ==
b.chend);
156 return (
a.xbegin !=
b.xbegin ||
a.xend !=
b.xend ||
157 a.ybegin !=
b.ybegin ||
a.yend !=
b.yend ||
158 a.zbegin !=
b.zbegin ||
a.zend !=
b.zend ||
159 a.chbegin !=
b.chbegin ||
a.chend !=
b.chend);
163 constexpr
bool contains (
int x,
int y,
int z=0,
int ch=0) const noexcept {
170 return (other.xbegin >=
xbegin && other.xend <=
xend &&
171 other.ybegin >=
ybegin && other.yend <=
yend &&
172 other.zbegin >=
zbegin && other.zend <=
zend &&
189 return (
A.defined() &&
B.defined())
194 : (
A.defined() ?
A :
B);
199 return (
A.defined() &&
B.defined())
204 : (
A.defined() ?
A :
B);
351 void set_format (
TypeDesc fmt) noexcept;
362 void default_channel_names () noexcept;
367 size_t channel_bytes() const noexcept {
return format.size(); }
374 size_t channel_bytes (
int chan,
bool native=
false) const noexcept;
381 size_t pixel_bytes (
bool native=false) const noexcept;
388 size_t pixel_bytes (
int chbegin,
int chend,
bool native=false) const noexcept;
431 bool size_t_safe() const noexcept {
433 return image_bytes() < big && scanline_bytes() < big &&
444 xstride = nchannels * channelsize;
446 ystride = xstride *
width;
448 zstride = ystride *
height;
457 auto_stride (xstride, ystride, zstride,
format.size(),
465 xstride = nchannels *
format.size();
510 bool casesensitive=
false);
520 bool casesensitive=
false);
523 bool casesensitive=
false)
const;
578 bool casesensitive=
false)
const;
585 bool casesensitive =
false)
const;
617 bool casesensitive =
false)
const;
644 static std::string metadata_val (
const ParamValue &p,
bool human=
false);
657 std::string serialize (SerialFormat
format,
658 SerialVerbose verbose = SerialDetailed)
const;
661 std::string to_xml ()
const;
664 void from_xml (
const char *xml);
669 std::pair<string_view, int>
670 decode_compression_metadata(
string_view defaultcomp =
"",
671 int defaultqual = -1)
const;
677 int zbegin,
int zend) noexcept {
678 return (tile_width &&
679 ((xbegin-
x) % tile_width) == 0 &&
680 ((ybegin-
y) % tile_height) == 0 &&
681 ((zbegin-
z) % tile_depth) == 0 &&
682 (((xend-
x) % tile_width) == 0 || (xend-
x) ==
width) &&
683 (((yend-
y) % tile_height) == 0 || (yend-
y) ==
height) &&
684 (((zend-
z) % tile_depth) == 0 || (zend-
z) ==
depth));
690 return chan >= 0 && chan < (
int)channelformats.
size()
691 ? channelformats[chan] :
format;
697 return chan >= 0 && chan < (
int)channelnames.
size()
706 formats = channelformats;
707 if ((
int)formats.size() < nchannels)
708 formats.resize (nchannels,
format);
722 return ROI (full_x, full_x+full_width, full_y, full_y+full_height,
723 full_z, full_z+full_depth, 0, nchannels);
745 full_width =
r.width();
746 full_height =
r.height();
747 full_depth =
r.depth();
819 return {
this, name };
823 return {
this, name };
952 ioproxy, plugin_searchpath);
956 static unique_ptr create (
const std::string&
filename,
bool do_open,
960 static unique_ptr create (
const std::string&
filename,
961 const std::string& plugin_searchpath);
974 virtual const char *format_name (
void)
const = 0;
1035 virtual bool valid_file (
const std::string&
filename)
const;
1101 return open(name,newspec);
1106 return open(name,newspec);
1124 virtual ImageSpec spec (
int subimage,
int miplevel=0);
1134 virtual ImageSpec spec_dimensions (
int subimage,
int miplevel=0);
1162 virtual bool close () = 0;
1190 return subimage == current_subimage() && miplevel == current_miplevel();
1196 bool ok = seek_subimage (subimage, miplevel);
1206 return seek_subimage (subimage, 0 , newspec);
1277 return read_scanline (y, z,
TypeFloat, data);
1313 virtual bool read_scanlines (
int subimage,
int miplevel,
1314 int ybegin,
int yend,
int z,
1315 int chbegin,
int chend,
1320 #ifndef OIIO_DOXYGEN
1325 OIIO_DEPRECATED(
"replace with version that takes subimage & miplevel parameters (2.0)")
1326 bool read_scanlines (
int ybegin,
int yend,
int z,
1331 bool read_scanlines (
int ybegin,
int yend,
int z,
1332 int chbegin,
int chend,
1365 virtual bool read_tile (
int x,
int y,
int z,
TypeDesc format,
1366 void *data,
stride_t xstride=AutoStride,
1373 AutoStride, AutoStride, AutoStride);
1421 virtual bool read_tiles (
int subimage,
int miplevel,
int xbegin,
int xend,
1422 int ybegin,
int yend,
int zbegin,
int zend,
1423 int chbegin,
int chend,
TypeDesc format,
void *data,
1427 #ifndef OIIO_DOXYGEN
1432 OIIO_DEPRECATED(
"replace with version that takes subimage & miplevel parameters (2.0)")
1433 bool read_tiles (
int xbegin,
int xend,
int ybegin,
int yend,
1434 int zbegin,
int zend,
TypeDesc format,
void *data,
1438 bool read_tiles (
int xbegin,
int xend,
int ybegin,
int yend,
1439 int zbegin,
int zend,
int chbegin,
int chend,
1479 virtual bool read_image (
int subimage,
int miplevel,
1480 int chbegin,
int chend,
1486 void *progress_callback_data=NULL);
1488 #ifndef OIIO_DOXYGEN
1493 OIIO_DEPRECATED(
"replace with version that takes subimage & miplevel parameters (2.0)")
1494 virtual
bool read_image (
TypeDesc format,
void *data,
1499 void *progress_callback_data=NULL);
1501 virtual
bool read_image (
int chbegin,
int chend,
1507 void *progress_callback_data=NULL);
1509 bool read_image (
float *data) {
1510 return read_image (current_subimage(), current_miplevel(),
1529 virtual bool read_native_deep_scanlines (
int subimage,
int miplevel,
1530 int ybegin,
int yend,
int z,
1531 int chbegin,
int chend,
1554 virtual bool read_native_deep_tiles (
int subimage,
int miplevel,
1555 int xbegin,
int xend,
1556 int ybegin,
int yend,
1557 int zbegin,
int zend,
1558 int chbegin,
int chend,
1570 virtual bool read_native_deep_image (
int subimage,
int miplevel,
1573 #ifndef OIIO_DOXYGEN
1575 OIIO_DEPRECATED(
"replace with version that takes subimage & miplevel parameters (2.0)")
1576 bool read_native_deep_scanlines (
int ybegin,
int yend,
int z,
1577 int chbegin,
int chend,
DeepData &deepdata) {
1578 return read_native_deep_scanlines (current_subimage(), current_miplevel(),
1580 chbegin, chend, deepdata);
1582 OIIO_DEPRECATED(
"replace with version that takes subimage & miplevel parameters (2.0)")
1583 bool read_native_deep_tiles (
int xbegin,
int xend,
int ybegin,
int yend,
1584 int zbegin,
int zend,
int chbegin,
int chend,
1586 return read_native_deep_tiles (current_subimage(), current_miplevel(),
1587 xbegin, xend, ybegin, yend,
1588 zbegin, zend, chbegin, chend, deepdata);
1590 OIIO_DEPRECATED(
"replace with version that takes subimage & miplevel parameters (2.0)")
1592 return read_native_deep_image (current_subimage(), current_miplevel(),
1631 virtual bool read_native_scanline (
int subimage,
int miplevel,
1632 int y,
int z,
void *data) = 0;
1635 virtual bool read_native_scanlines (
int subimage,
int miplevel,
1636 int ybegin,
int yend,
int z,
1640 virtual bool read_native_scanlines (
int subimage,
int miplevel,
1641 int ybegin,
int yend,
int z,
1642 int chbegin,
int chend,
void *data);
1648 virtual bool read_native_tile (
int subimage,
int miplevel,
1649 int x,
int y,
int z,
void *data);
1658 virtual bool read_native_tiles (
int subimage,
int miplevel,
1659 int xbegin,
int xend,
int ybegin,
int yend,
1660 int zbegin,
int zend,
void *data);
1670 virtual bool read_native_tiles (
int subimage,
int miplevel,
1671 int xbegin,
int xend,
int ybegin,
int yend,
1672 int zbegin,
int zend,
1673 int chbegin,
int chend,
void *data);
1679 virtual int send_to_input (
const char *format, ...);
1680 int send_to_client (
const char *format, ...);
1705 std::string
geterror(
bool clear =
true)
const;
1712 template<
typename... Args>
1721 template<
typename... Args>
1729 template<
typename... Args>
1737 template<
typename... Args>
1739 void fmterror(const
char* fmt, const Args&...
args)
const {
1754 void threads(
int n);
1758 int threads()
const;
1764 void unlock()
const;
1765 bool try_lock()
const;
1774 void*
operator new (
size_t size);
1775 void operator delete (
void *
ptr);
1799 bool ioproxy_opened()
const;
1802 void ioproxy_clear();
1807 void ioproxy_retrieve_from_config(
const ImageSpec& config);
1820 bool ioread(
void*
buf,
size_t itemsize,
size_t nitems = 1);
1825 bool ioseek(int64_t pos,
int origin =
SEEK_SET);
1828 int64_t iotell()
const;
1868 ROI range = {0, 65535, 0, 65535, 0, 1, 0, 4},
1869 uint64_t
flags = 0);
1884 static void impl_deleter(Impl*);
1885 std::unique_ptr<Impl, decltype(&impl_deleter)> m_impl;
1890 static unique_ptr create (const std::
string&
filename,
bool do_open,
1891 const std::
string& plugin_searchpath);
1945 const std::wstring& plugin_searchpath = {}) {
1951 static unique_ptr create (
const std::string &filename,
1952 const std::string &plugin_searchpath);
1957 static void destroy (ImageOutput *
x);
1962 virtual ~ImageOutput ();
1965 virtual const char *format_name (
void)
const = 0;
2105 enum OpenMode { Create, AppendSubimage, AppendMIPLevel };
2123 virtual bool open (
const std::string &filename,
const ImageSpec &newspec,
2124 OpenMode
mode=Create) = 0;
2154 virtual bool open (
const std::string &filename,
2159 return open (filename, specs[0]);
2176 virtual bool close () = 0;
2233 virtual bool write_scanline (
int y,
int z,
TypeDesc format,
2234 const void *data,
stride_t xstride=AutoStride);
2251 virtual bool write_scanlines (
int ybegin,
int yend,
int z,
2277 virtual bool write_tile (
int x,
int y,
int z,
TypeDesc format,
2278 const void *data,
stride_t xstride=AutoStride,
2316 virtual bool write_tiles (
int xbegin,
int xend,
int ybegin,
int yend,
2317 int zbegin,
int zend,
TypeDesc format,
2318 const void *data,
stride_t xstride=AutoStride,
2348 virtual bool write_rectangle (
int xbegin,
int xend,
int ybegin,
int yend,
2349 int zbegin,
int zend,
TypeDesc format,
2350 const void *data,
stride_t xstride=AutoStride,
2377 virtual bool write_image (
TypeDesc format,
const void *data,
2382 void *progress_callback_data=
nullptr);
2393 virtual bool write_deep_scanlines (
int ybegin,
int yend,
int z,
2416 virtual bool write_deep_tiles (
int xbegin,
int xend,
int ybegin,
int yend,
2417 int zbegin,
int zend,
2425 virtual bool write_deep_image (
const DeepData &deepdata);
2474 virtual int send_to_output (
const char *format, ...);
2475 int send_to_client (
const char *format, ...);
2500 std::string
geterror(
bool clear =
true)
const;
2507 template<
typename... Args>
2516 template<
typename... Args>
2524 template<
typename... Args>
2532 template<
typename... Args>
2534 void fmterror(const
char* fmt, const Args&...
args)
const {
2550 void threads(
int n);
2554 int threads()
const;
2558 void*
operator new (
size_t size);
2559 void operator delete (
void *
ptr);
2563 typedef ImageOutput* (*Creator)();
2650 ROI range = {0, 65535, 0, 65535, 0, 1, 0, 4},
2651 uint64_t
flags = 0);
2656 Disallow1Channel = 1,
2657 Disallow2Channel = 2,
2658 Disallow1or2Channel = Disallow1Channel | Disallow2Channel,
2659 Strict = (uint64_t(1) << 32)
2675 const void *to_native_scanline (
TypeDesc format,
2676 const void *data,
stride_t xstride,
2677 std::vector<unsigned char> &scratch,
2678 unsigned int dither=0,
2679 int yorigin=0,
int zorigin=0);
2680 const void *to_native_tile (
TypeDesc format,
const void *data,
2683 std::vector<unsigned char> &scratch,
2684 unsigned int dither=0,
2685 int xorigin=0,
int yorigin=0,
int zorigin=0);
2686 const void *to_native_rectangle (
int xbegin,
int xend,
int ybegin,
int yend,
2687 int zbegin,
int zend,
2691 std::vector<unsigned char> &scratch,
2692 unsigned int dither=0,
2693 int xorigin=0,
int yorigin=0,
int zorigin=0);
2701 bool copy_to_image_buffer (
int xbegin,
int xend,
int ybegin,
int yend,
2702 int zbegin,
int zend,
TypeDesc format,
2703 const void *data,
stride_t xstride,
2711 bool copy_tile_to_image_buffer (
int x,
int y,
int z,
TypeDesc format,
2712 const void *data,
stride_t xstride,
2733 bool ioproxy_opened()
const;
2736 void ioproxy_clear();
2741 void ioproxy_retrieve_from_config(
const ImageSpec& config);
2754 bool iowrite(
const void*
buf,
size_t itemsize,
size_t nitems = 1);
2759 bool ioseek(int64_t pos,
int origin =
SEEK_SET);
2762 int64_t iotell()
const;
2766 template<
typename Str,
typename... Args>
2770 return iowrite(s.data(), s.size());
2783 static void impl_deleter(Impl*);
2784 std::unique_ptr<Impl, decltype(&impl_deleter)> m_impl;
3034 std::string valstr =
val;
3035 const char *
s = valstr.c_str();
3221 const char **input_extensions,
3223 const char **output_extensions,
3224 const char *lib_version);
3233 inline std::map<std::string, std::vector<std::string>>
3236 std::map<std::string, std::vector<std::string>> map;
3240 if (format_exts.size() != 2)
3293 return convert_image(nchannels, width, height, depth, src, src_type,
3294 src_xstride, src_ystride, src_zstride, dst, dst_type,
3295 dst_xstride, dst_ystride, dst_zstride);
3308 stride_t dst_zstride,
int nthreads=0);
3316 int ,
int ,
int nthreads=0)
3319 src, src_type, src_xstride, src_ystride, src_zstride,
3320 dst, dst_type, dst_xstride, dst_ystride, dst_zstride, nthreads);
3331 float ditheramplitude,
3332 int alpha_channel = -1,
int z_channel = -1,
3333 unsigned int ditherseed = 1,
3334 int chorigin=0,
int xorigin=0,
3335 int yorigin=0,
int zorigin=0);
3343 int chbegin,
int chend,
3346 int alpha_channel = -1,
int z_channel = -1);
3387 template<
typename... Args>
3394 template<
typename... Args>
3402 template<
typename... Args>
3411 template<
typename T1,
typename... Args>
3425 #if FMT_VERSION >= 100000
int tile_width
tile width (0 for a non-tiled image)
int nchannels
number of image channels, e.g., 4 for RGBA
static void auto_stride(stride_t &xstride, TypeDesc format, int nchannels) noexcept
32-bit IEEE floating point values, (C/C++ float).
std::unique_ptr< ImageOutput > unique_ptr
unique_ptr to an ImageOutput.
GLuint GLsizei const GLchar * message
OIIO_API bool wrap_periodic_pow2(int &coord, int origin, int width)
OIIO_API std::string geterror(bool clear=true)
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
OIIO_API bool has_error()
Is there a pending global error message waiting to be retrieved?
void set_roi(const ROI &r) noexcept
GLenum GLuint GLenum GLsizei const GLchar * buf
string_view channel_name(int chan) const
OpenChecks
Bit field definitions for the flags argument to check_open().
GT_API const UT_StringHolder filename
bool convert_types(TypeDesc src_type, const void *src, TypeDesc dst_type, void *dst, int n=1)
DEPRECATED(2.1): old name.
virtual bool open(const std::string &filename, int subimages OIIO_MAYBE_UNUSED, const ImageSpec *specs)
OIIO_UTIL_API std::vector< string_view > splitsv(string_view str, string_view sep="", int maxsplit=-1)
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
ImageOutput *(* Creator)()
const ImageSpec & spec(void) const
constexpr imagesize_t npixels() const noexcept
Total number of pixels in the region.
bool undefined() const noexcept
that also have some descendant prim *whose name begins with which in turn has a child named baz where *the predicate and *a name There is also one special expression _ which means *the weaker expression when composing expressions together See with
GLsizei const GLfloat * value
constexpr bool contains(int x, int y, int z=0, int ch=0) const noexcept
Test if the coordinate is within the ROI.
friend constexpr bool operator==(const ROI &a, const ROI &b) noexcept
Test equality of two ROIs.
void get_channelformats(std::vector< TypeDesc > &formats) const
ROI roi_full() const noexcept
Return full/display window for this ImageSpec expressed as a ROI.
GLdouble GLdouble GLdouble z
OIIO_NODISCARD std::string format(const Str &fmt, Args &&...args)
GLboolean GLboolean GLboolean GLboolean a
static unique_ptr create(const std::wstring &filename, Filesystem::IOProxy *ioproxy=nullptr, const std::wstring &plugin_searchpath={})
OIIO_API bool wrap_periodic(int &coord, int origin, int width)
TypeDesc channelformat(int chan) const
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
int depth
depth of pixel data, >1 indicates a "volume"
int full_height
height of the full (display) window
std::vector< std::string > channelnames
OIIO_API void declare_imageio_format(const std::string &format_name, ImageInput::Creator input_creator, const char **input_extensions, ImageOutput::Creator output_creator, const char **output_extensions, const char *lib_version)
void copy_dimensions(const ImageSpec &other)
void attribute(string_view name, int value)
Add an int attribute to extra_attribs.
int tile_height
tile height (0 for a non-tiled image)
static constexpr ROI All() noexcept
String-related utilities, all in namespace Strutil.
OIIO_FORMAT_DEPRECATED void error(const char *fmt, const Args &...args) const
friend std::ostream & operator<<(std::ostream &out, const ROI &roi)
Stream output of the range.
constexpr auto in(type t, int set) -> bool
bool valid_tile_range(int xbegin, int xend, int ybegin, int yend, int zbegin, int zend) noexcept
std::map< std::string, std::vector< std::string > > get_extension_map()
#define FMT_END_NAMESPACE
OIIO_API void premult(int nchannels, int width, int height, int depth, int chbegin, int chend, TypeDesc datatype, void *data, stride_t xstride, stride_t ystride, stride_t zstride, int alpha_channel=-1, int z_channel=-1)
OIIO_API void add_dither(int nchannels, int width, int height, int depth, float *data, stride_t xstride, stride_t ystride, stride_t zstride, float ditheramplitude, int alpha_channel=-1, int z_channel=-1, unsigned int ditherseed=1, int chorigin=0, int xorigin=0, int yorigin=0, int zorigin=0)
OIIO_INLINE_CONSTEXPR TypeDesc TypeInt(TypeDesc::INT)
basic_string_view< char > string_view
OIIO_INLINE_CONSTEXPR TypeDesc TypeUnknown(TypeDesc::UNKNOWN)
OIIO_API bool wrap_black(int &coord, int origin, int width)
static void auto_stride(stride_t &xstride, stride_t &ystride, stride_t &zstride, TypeDesc format, int nchannels, int width, int height) noexcept
void errorfmt(const char *fmt, const Args &...args) const
GLint GLsizei GLsizei height
Wrappers and utilities for multithreading.
GLint GLint GLsizei GLint GLenum GLenum type
constexpr int height() const noexcept
Width.
constexpr ROI roi_intersection(const ROI &A, const ROI &B) noexcept
Intersection of two regions.
bool(* ProgressCallback)(void *opaque_data, float portion_done)
OIIO_INLINE_CONSTEXPR TypeDesc TypeFloat(TypeDesc::FLOAT)
constexpr bool defined() const noexcept
Is a region defined?
OIIO_API bool convert_image(int nchannels, int width, int height, int depth, const void *src, TypeDesc src_type, stride_t src_xstride, stride_t src_ystride, stride_t src_zstride, void *dst, TypeDesc dst_type, stride_t dst_xstride, stride_t dst_ystride, stride_t dst_zstride)
constexpr int depth() const noexcept
void set_roi_full(const ROI &r) noexcept
std::string OIIO_UTIL_API replace(string_view str, string_view pattern, string_view replacement, bool global=false)
void fmtdebug(const char *fmt, const Args &...args)
OIIO_API bool parallel_convert_image(int nchannels, int width, int height, int depth, const void *src, TypeDesc src_type, stride_t src_xstride, stride_t src_ystride, stride_t src_zstride, void *dst, TypeDesc dst_type, stride_t dst_xstride, stride_t dst_ystride, stride_t dst_zstride, int nthreads=0)
GLint GLint GLsizei GLint GLenum format
constexpr ROI roi_union(const ROI &A, const ROI &B) noexcept
Union of two regions, the smallest region containing both.
constexpr int nchannels() const noexcept
friend constexpr bool operator!=(const ROI &a, const ROI &b) noexcept
Test inequality of two ROIs.
void attribute(string_view name, unsigned int value)
Add an unsigned int attribute to extra_attribs.
int full_width
width of the full (display) window
OIIO_API void _ImageIO_force_link()
OIIO_API bool wrap_mirror(int &coord, int origin, int width)
GLuint const GLchar * name
OIIO_HOSTDEVICE size_t size() const noexcept
int full_y
origin of the full (display) window
OIIO_INLINE_CONSTEXPR TypeDesc TypeString(TypeDesc::STRING)
void set_format(string_view fmt) noexcept
GLboolean GLboolean GLboolean b
float get_float_attribute(string_view name, float defaultval=0)
Attempt to access an object that no longer exists in Houdini Invalid output Invalid type The attempted operation failed Node initialization script failed Failed to modify node or parameter because of a permission error Possible causes include locked takes
void debug(const char *fmt, Args &&...args)
GLint GLint GLsizei GLsizei GLsizei depth
ROI roi() const noexcept
Return pixel data window for this ImageSpec expressed as a ROI.
OIIO_FORMAT_DEPRECATED void debugf(const char *fmt, const Args &...args)
debug output with printf conventions.
virtual bool set_thumbnail(const ImageBuf &thumb)
GT_API const UT_StringHolder version
ParamValue ImageIOParameter
int full_depth
depth of the full (display) window
OIIO_API bool wrap_clamp(int &coord, int origin, int width)
constexpr auto size() const noexcept-> size_t
std::vector< TypeDesc > channelformats
int x
origin (upper left corner) of pixel data
OIIO_API bool is_imageio_format_name(string_view name)
Is name one of the known format names?
OIIO_API int openimageio_version()
OIIO_API bool getattribute(string_view name, TypeDesc type, void *val)
static void auto_stride(stride_t &xstride, stride_t &ystride, stride_t &zstride, stride_t channelsize, int nchannels, int width, int height) noexcept
constexpr int width() const noexcept
Height.
const stride_t AutoStride
int z
origin (upper left corner) of pixel data
ParamValueList extra_attribs
int full_z
origin of the full (display) window
int width
width of the pixel data window
OIIO_INLINE_CONSTEXPR TypeDesc TypeUInt8(TypeDesc::UINT8)
bool(* wrap_impl)(int &coord, int origin, int width)
OIIO_UTIL_API std::vector< std::string > splits(string_view str, string_view sep="", int maxsplit=-1)
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
constexpr bool contains(const ROI &other) const noexcept
Test if another ROI is entirely within our ROI.
OIIO_API bool attribute(string_view name, TypeDesc type, const void *val)
**If you just want to fire and args
void debugfmt(const char *fmt, Args &&...args)
AttrDelegate< ImageSpec > operator[](string_view name)
ParamValueList ImageIOParameterList
#define OIIO_FORMAT_DEPRECATED
constexpr ROI(int xbegin, int xend, int ybegin, int yend, int zbegin=0, int zend=1, int chbegin=0, int chend=10000) noexcept
int height
height of the pixel data window
#define FMT_BEGIN_NAMESPACE
#define OIIO_NAMESPACE_END
auto sprintf(const S &fmt, const T &...args) -> std::basic_string< Char >
AttrDelegate< const ImageSpec > operator[](string_view name) const
bool iowritefmt(const Str &fmt, Args &&...args)
string_view get_string_attribute(string_view name, string_view defaultval=string_view())
bool open(const std::wstring &filename, const ImageSpec &newspec, OpenMode mode=Create)
Open an ImageOutput using a UTF-16 encoded wstring filename.
std::string OIIO_UTIL_API utf16_to_utf8(const std::wstring &utf16str) noexcept
OIIO_API bool copy_image(int nchannels, int width, int height, int depth, const void *src, stride_t pixelsize, stride_t src_xstride, stride_t src_ystride, stride_t src_zstride, void *dst, stride_t dst_xstride, stride_t dst_ystride, stride_t dst_zstride)
int get_int_attribute(string_view name, int defaultval=0)
const std::string & string() const noexcept
Return a C++ std::string representation of a ustring.
OIIO_API bool convert_pixel_values(TypeDesc src_type, const void *src, TypeDesc dst_type, void *dst, int n=1)
virtual int supports(string_view feature OIIO_MAYBE_UNUSED) const
void attribute(string_view name, float value)
Add a float attribute to extra_attribs.
void errorf(const char *fmt, const Args &...args) const
OpenMode
Modes passed to the open() call.
bool open(const std::wstring &filename, int subimages OIIO_MAYBE_UNUSED, const ImageSpec *specs)
Modes passed to the open() call.
int full_x
origin of the full (display) window
int y
origin (upper left corner) of pixel data
#define OIIO_NAMESPACE_BEGIN