HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
openexr_part.h
Go to the documentation of this file.
1 /*
2 ** SPDX-License-Identifier: BSD-3-Clause
3 ** Copyright Contributors to the OpenEXR Project.
4 */
5 
6 #ifndef OPENEXR_PART_H
7 #define OPENEXR_PART_H
8 
9 #include "openexr_context.h"
10 
11 #include "openexr_attr.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 /** @file */
18 
19 /**
20  * @defgroup PartInfo Part related definitions.
21  *
22  * A part is a separate entity in the OpenEXR file. This was
23  * formalized in the OpenEXR 2.0 timeframe to allow there to be a
24  * clear set of eyes for stereo, or just a simple list of AOVs within
25  * a single OpenEXR file. Prior, it was managed by name convention,
26  * but with a multi-part file, they are clearly separate types, and
27  * can have separate behavior.
28  *
29  * This is a set of functions to query, or set up when writing, that
30  * set of parts within a file. This remains backward compatible to
31  * OpenEXR files from before this change, in that a file with a single
32  * part is a subset of a multi-part file. As a special case, creating
33  * a file with a single part will write out as if it is a file which
34  * is not multi-part aware, so as to be compatible with those old
35  * libraries.
36  *
37  * @{
38  */
39 
40 /** @brief Query how many parts are in the file. */
42 
43 /** @brief Query the part name for the specified part.
44  *
45  * NB: If this file is a single part file and name has not been set, this
46  * will return `NULL`.
47  */
49 exr_get_name (exr_const_context_t ctxt, int part_index, const char** out);
50 
51 /** @brief Query the storage type for the specified part. */
54 
55 /** @brief Define a new part in the file. */
57  exr_context_t ctxt,
58  const char* partname,
60  int* new_index);
61 
62 /** @brief Query how many levels are in the specified part.
63  *
64  * If the part is a tiled part, fill in how many tile levels are present.
65  *
66  * Return `ERR_SUCCESS` on success, an error otherwise (i.e. if the part
67  * is not tiled).
68  *
69  * It is valid to pass `NULL` to either of the @p levelsx or @p levelsy
70  * arguments, which enables testing if this part is a tiled part, or
71  * if you don't need both (i.e. in the case of a mip-level tiled
72  * image)
73  */
76  int part_index,
77  int32_t* levelsx,
78  int32_t* levelsy);
79 
80 /** @brief Query the tile size for a particular level in the specified part.
81  *
82  * If the part is a tiled part, fill in the tile size for the
83  * specified part/level.
84  *
85  * Return `ERR_SUCCESS` on success, an error otherwise (i.e. if the
86  * part is not tiled).
87  *
88  * It is valid to pass `NULL` to either of the @p tilew or @p tileh
89  * arguments, which enables testing if this part is a tiled part, or
90  * if you don't need both (i.e. in the case of a mip-level tiled
91  * image)
92  */
95  int part_index,
96  int levelx,
97  int levely,
98  int32_t* tilew,
99  int32_t* tileh);
100 
101 /** @brief Query the data sizes for a particular level in the specified part.
102  *
103  * If the part is a tiled part, fill in the width/height for the
104  * specified levels.
105  *
106  * Return `ERR_SUCCESS` on success, an error otherwise (i.e. if the part
107  * is not tiled).
108  *
109  * It is valid to pass `NULL` to either of the @p levw or @p levh
110  * arguments, which enables testing if this part is a tiled part, or
111  * if you don't need both for some reason.
112  */
114  exr_const_context_t ctxt,
115  int part_index,
116  int levelx,
117  int levely,
118  int32_t* levw,
119  int32_t* levh);
120 
121 /** Return the number of chunks contained in this part of the file.
122  *
123  * As in the technical documentation for OpenEXR, the chunk is the
124  * generic term for a pixel data block. This is the atomic unit that
125  * this library uses to negotiate data to and from a context.
126  *
127  * This should be used as a basis for splitting up how a file is
128  * processed. Depending on the compression, a different number of
129  * scanlines are encoded in each chunk, and since those need to be
130  * encoded/decoded as a block, the chunk should be the basis for I/O
131  * as well.
132  */
134 exr_get_chunk_count (exr_const_context_t ctxt, int part_index, int32_t* out);
135 
136 /** Return the number of scanlines chunks for this file part.
137  *
138  * When iterating over a scanline file, this may be an easier metric
139  * for multi-threading or other access than only negotiating chunk
140  * counts, and so is provided as a utility.
141  */
143  exr_const_context_t ctxt, int part_index, int32_t* out);
144 
145 /** Return the maximum unpacked size of a chunk for the file part.
146  *
147  * This may be used ahead of any actual reading of data, so can be
148  * used to pre-allocate buffers for multiple threads in one block or
149  * whatever your application may require.
150  */
152  exr_const_context_t ctxt, int part_index, uint64_t* out);
153 
154 /** @brief Retrieve the zip compression level used for the specified part.
155  *
156  * This only applies when the compression method involves using zip
157  * compression (zip, zips, some modes of DWAA/DWAB).
158  *
159  * This value is NOT persisted in the file, and only exists for the
160  * lifetime of the context, so will be at the default value when just
161  * reading a file.
162  */
164  exr_const_context_t ctxt, int part_index, int* level);
165 
166 /** @brief Set the zip compression method used for the specified part.
167  *
168  * This only applies when the compression method involves using zip
169  * compression (zip, zips, some modes of DWAA/DWAB).
170  *
171  * This value is NOT persisted in the file, and only exists for the
172  * lifetime of the context, so this value will be ignored when
173  * reading a file.
174  */
177 
178 /** @brief Retrieve the dwa compression level used for the specified part.
179  *
180  * This only applies when the compression method is DWAA/DWAB.
181  *
182  * This value is NOT persisted in the file, and only exists for the
183  * lifetime of the context, so will be at the default value when just
184  * reading a file.
185  */
187  exr_const_context_t ctxt, int part_index, float* level);
188 
189 /** @brief Set the dwa compression method used for the specified part.
190  *
191  * This only applies when the compression method is DWAA/DWAB.
192  *
193  * This value is NOT persisted in the file, and only exists for the
194  * lifetime of the context, so this value will be ignored when
195  * reading a file.
196  */
199 
200 /**************************************/
201 
202 /** @defgroup PartMetadata Functions to get and set metadata for a particular part.
203  * @{
204  *
205  */
206 
207 /** @brief Query the count of attributes in a part. */
209  exr_const_context_t ctxt, int part_index, int32_t* count);
210 
212 {
213  EXR_ATTR_LIST_FILE_ORDER, /**< Order they appear in the file */
214  EXR_ATTR_LIST_SORTED_ORDER /**< Alphabetically sorted */
216 
217 /** @brief Query a particular attribute by index. */
219  exr_const_context_t ctxt,
220  int part_index,
222  int32_t idx,
223  const exr_attribute_t** outattr);
224 
225 /** @brief Query a particular attribute by name. */
227  exr_const_context_t ctxt,
228  int part_index,
229  const char* name,
230  const exr_attribute_t** outattr);
231 
232 /** @brief Query the list of attributes in a part.
233  *
234  * This retrieves a list of attributes currently defined in a part.
235  *
236  * If outlist is `NULL`, this function still succeeds, filling only the
237  * count. In this manner, the user can allocate memory for the list of
238  * attributes, then re-call this function to get the full list.
239  */
241  exr_const_context_t ctxt,
242  int part_index,
244  int32_t* count,
245  const exr_attribute_t** outlist);
246 
247 /** Declare an attribute within the specified part.
248  *
249  * Only valid when a file is opened for write.
250  */
252  exr_context_t ctxt,
253  int part_index,
254  const char* name,
255  const char* type,
256  exr_attribute_t** newattr);
257 
258 /** @brief Declare an attribute within the specified part.
259  *
260  * Only valid when a file is opened for write.
261  */
263  exr_context_t ctxt,
264  int part_index,
265  const char* name,
267  exr_attribute_t** newattr);
268 
269 /**
270  * @defgroup RequiredAttributeHelpers Required Attribute Utililities
271  *
272  * @brief These are a group of functions for attributes that are
273  * required to be in every part of every file.
274  *
275  * @{
276  */
277 
278 /** @brief Initialize all required attributes for all files.
279  *
280  * NB: other file types do require other attributes, such as the tile
281  * description for a tiled file.
282  */
284  exr_context_t ctxt,
285  int part_index,
286  const exr_attr_box2i_t* displayWindow,
287  const exr_attr_box2i_t* dataWindow,
288  float pixelaspectratio,
289  const exr_attr_v2f_t* screenWindowCenter,
290  float screenWindowWidth,
291  exr_lineorder_t lineorder,
292  exr_compression_t ctype);
293 
294 /** @brief Initialize all required attributes to default values:
295  *
296  * - `displayWindow` is set to (0, 0 -> @p width - 1, @p height - 1)
297  * - `dataWindow` is set to (0, 0 -> @p width - 1, @p height - 1)
298  * - `pixelAspectRatio` is set to 1.0
299  * - `screenWindowCenter` is set to 0.f, 0.f
300  * - `screenWindowWidth` is set to 1.f
301  * - `lineorder` is set to `INCREASING_Y`
302  * - `compression` is set to @p ctype
303  */
305  exr_context_t ctxt,
306  int part_index,
307  int32_t width,
308  int32_t height,
309  exr_compression_t ctype);
310 
311 /** @brief Copy the attributes from one part to another.
312  *
313  * This allows one to quickly unassigned attributes from one source to another.
314  *
315  * If an attribute in the source part has not been yet set in the
316  * destination part, the item will be copied over.
317  *
318  * For example, when you add a part, the storage type and name
319  * attributes are required arguments to the definition of a new part,
320  * but channels has not yet been assigned. So by calling this with an
321  * input file as the source, you can copy the channel definitions (and
322  * any other unassigned attributes from the source).
323  */
325  exr_context_t ctxt,
326  int part_index,
328  int src_part_index);
329 
330 /** @brief Retrieve the list of channels. */
332  exr_const_context_t ctxt, int part_index, const exr_attr_chlist_t** chlist);
333 
334 /** @brief Define a new channel to the output file part.
335  *
336  * The @p percept parameter is used for lossy compression techniques
337  * to indicate that the value represented is closer to linear (1) or
338  * closer to logarithmic (0). For r, g, b, luminance, this is normally
339  * 0.
340  */
342  exr_context_t ctxt,
343  int part_index,
344  const char* name,
345  exr_pixel_type_t ptype,
347  int32_t xsamp,
348  int32_t ysamp);
349 
350 /** @brief Copy the channels from another source.
351  *
352  * Useful if you are manually constructing the list or simply copying
353  * from an input file.
354  */
357 
358 /** @brief Retrieve the compression method used for the specified part. */
360  exr_const_context_t ctxt, int part_index, exr_compression_t* compression);
361 /** @brief Set the compression method used for the specified part. */
363  exr_context_t ctxt, int part_index, exr_compression_t ctype);
364 
365 /** @brief Retrieve the data window for the specified part. */
368 /** @brief Set the data window for the specified part. */
370  exr_context_t ctxt, int part_index, const exr_attr_box2i_t* dw);
371 
372 /** @brief Retrieve the display window for the specified part. */
375 /** @brief Set the display window for the specified part. */
377  exr_context_t ctxt, int part_index, const exr_attr_box2i_t* dw);
378 
379 /** @brief Retrieve the line order for storing data in the specified part (use 0 for single part images). */
382 /** @brief Set the line order for storing data in the specified part (use 0 for single part images). */
385 
386 /** @brief Retrieve the pixel aspect ratio for the specified part (use 0 for single part images). */
388  exr_const_context_t ctxt, int part_index, float* par);
389 /** @brief Set the pixel aspect ratio for the specified part (use 0 for single part images). */
392 
393 /** @brief Retrieve the screen oriented window center for the specified part (use 0 for single part images). */
396 /** @brief Set the screen oriented window center for the specified part (use 0 for single part images). */
398  exr_context_t ctxt, int part_index, const exr_attr_v2f_t* wc);
399 
400 /** @brief Retrieve the screen oriented window width for the specified part (use 0 for single part images). */
402  exr_const_context_t ctxt, int part_index, float* out);
403 /** @brief Set the screen oriented window width for the specified part (use 0 for single part images). */
406 
407 /** @brief Retrieve the tiling info for a tiled part (use 0 for single part images). */
409  exr_const_context_t ctxt,
410  int part_index,
411  uint32_t* xsize,
412  uint32_t* ysize,
415 
416 /** @brief Set the tiling info for a tiled part (use 0 for single part images). */
418  exr_context_t ctxt,
419  int part_index,
420  uint32_t x_size,
421  uint32_t y_size,
422  exr_tile_level_mode_t level_mode,
423  exr_tile_round_mode_t round_mode);
424 
426 exr_set_name (exr_context_t ctxt, int part_index, const char* val);
427 
429 exr_get_version (exr_const_context_t ctxt, int part_index, int32_t* out);
430 
432 exr_set_version (exr_context_t ctxt, int part_index, int32_t val);
433 
435 exr_set_chunk_count (exr_context_t ctxt, int part_index, int32_t val);
436 
437 /** @} */ /* required attr group. */
438 
439 /**
440  * @defgroup BuiltinAttributeHelpers Attribute utilities for builtin types
441  *
442  * @brief These are a group of functions for attributes that use the builtin types.
443  *
444  * @{
445  */
446 
448  exr_const_context_t ctxt,
449  int part_index,
450  const char* name,
451  exr_attr_box2i_t* outval);
452 
454  exr_context_t ctxt,
455  int part_index,
456  const char* name,
457  const exr_attr_box2i_t* val);
458 
460  exr_const_context_t ctxt,
461  int part_index,
462  const char* name,
463  exr_attr_box2f_t* outval);
464 
466  exr_context_t ctxt,
467  int part_index,
468  const char* name,
469  const exr_attr_box2f_t* val);
470 
471 /** @brief Zero-copy query of channel data.
472  *
473  * Do not free or manipulate the @p chlist data, or use
474  * after the lifetime of the context.
475  */
477  exr_const_context_t ctxt,
478  int part_index,
479  const char* name,
480  const exr_attr_chlist_t** chlist);
481 
482 /** @brief This allows one to quickly copy the channels from one file
483  * to another.
484  */
486  exr_context_t ctxt,
487  int part_index,
488  const char* name,
489  const exr_attr_chlist_t* channels);
490 
492  exr_const_context_t ctxt,
493  int part_index,
494  const char* name,
495  exr_attr_chromaticities_t* chroma);
496 
498  exr_context_t ctxt,
499  int part_index,
500  const char* name,
501  const exr_attr_chromaticities_t* chroma);
502 
504  exr_const_context_t ctxt,
505  int part_index,
506  const char* name,
507  exr_compression_t* out);
508 
510  exr_context_t ctxt,
511  int part_index,
512  const char* name,
513  exr_compression_t comp);
514 
516  exr_const_context_t ctxt, int part_index, const char* name, double* out);
517 
519  exr_context_t ctxt, int part_index, const char* name, double val);
520 
522  exr_const_context_t ctxt,
523  int part_index,
524  const char* name,
525  exr_envmap_t* out);
526 
528  exr_context_t ctxt, int part_index, const char* name, exr_envmap_t emap);
529 
531  exr_const_context_t ctxt, int part_index, const char* name, float* out);
532 
534  exr_context_t ctxt, int part_index, const char* name, float val);
535 
536 /** @brief Zero-copy query of float data.
537  *
538  * Do not free or manipulate the @p out data, or use after the
539  * lifetime of the context.
540  */
542  exr_const_context_t ctxt,
543  int part_index,
544  const char* name,
545  int32_t* sz,
546  const float** out);
547 
549  exr_context_t ctxt,
550  int part_index,
551  const char* name,
552  int32_t sz,
553  const float* vals);
554 
556  exr_const_context_t ctxt, int part_index, const char* name, int32_t* out);
557 
559  exr_context_t ctxt, int part_index, const char* name, int32_t val);
560 
562  exr_const_context_t ctxt,
563  int part_index,
564  const char* name,
565  exr_attr_keycode_t* out);
566 
568  exr_context_t ctxt,
569  int part_index,
570  const char* name,
571  const exr_attr_keycode_t* kc);
572 
574  exr_const_context_t ctxt,
575  int part_index,
576  const char* name,
577  exr_lineorder_t* out);
578 
580  exr_context_t ctxt, int part_index, const char* name, exr_lineorder_t lo);
581 
583  exr_const_context_t ctxt,
584  int part_index,
585  const char* name,
586  exr_attr_m33f_t* out);
587 
589  exr_context_t ctxt,
590  int part_index,
591  const char* name,
592  const exr_attr_m33f_t* m);
593 
595  exr_const_context_t ctxt,
596  int part_index,
597  const char* name,
598  exr_attr_m33d_t* out);
599 
601  exr_context_t ctxt,
602  int part_index,
603  const char* name,
604  const exr_attr_m33d_t* m);
605 
607  exr_const_context_t ctxt,
608  int part_index,
609  const char* name,
610  exr_attr_m44f_t* out);
611 
613  exr_context_t ctxt,
614  int part_index,
615  const char* name,
616  const exr_attr_m44f_t* m);
617 
619  exr_const_context_t ctxt,
620  int part_index,
621  const char* name,
622  exr_attr_m44d_t* out);
623 
625  exr_context_t ctxt,
626  int part_index,
627  const char* name,
628  const exr_attr_m44d_t* m);
629 
631  exr_const_context_t ctxt,
632  int part_index,
633  const char* name,
634  exr_attr_preview_t* out);
635 
637  exr_context_t ctxt,
638  int part_index,
639  const char* name,
640  const exr_attr_preview_t* p);
641 
643  exr_const_context_t ctxt,
644  int part_index,
645  const char* name,
646  exr_attr_rational_t* out);
647 
649  exr_context_t ctxt,
650  int part_index,
651  const char* name,
652  const exr_attr_rational_t* r);
653 
654 /** @brief Zero-copy query of string value.
655  *
656  * Do not modify the string pointed to by @p out, and do not use
657  * after the lifetime of the context.
658  */
660  exr_const_context_t ctxt,
661  int part_index,
662  const char* name,
663  int32_t* length,
664  const char** out);
665 
667  exr_context_t ctxt, int part_index, const char* name, const char* s);
668 
669 /** @brief Zero-copy query of string data.
670  *
671  * Do not free the strings pointed to by the array.
672  *
673  * Must provide @p size.
674  *
675  * \p out must be a ``const char**`` array large enough to hold
676  * the string pointers for the string vector when provided.
677  */
679  exr_const_context_t ctxt,
680  int part_index,
681  const char* name,
682  int32_t* size,
683  const char** out);
684 
686  exr_context_t ctxt,
687  int part_index,
688  const char* name,
689  int32_t size,
690  const char** sv);
691 
693  exr_const_context_t ctxt,
694  int part_index,
695  const char* name,
696  exr_attr_tiledesc_t* out);
697 
699  exr_context_t ctxt,
700  int part_index,
701  const char* name,
702  const exr_attr_tiledesc_t* td);
703 
705  exr_const_context_t ctxt,
706  int part_index,
707  const char* name,
708  exr_attr_timecode_t* out);
709 
711  exr_context_t ctxt,
712  int part_index,
713  const char* name,
714  const exr_attr_timecode_t* tc);
715 
717  exr_const_context_t ctxt,
718  int part_index,
719  const char* name,
720  exr_attr_v2i_t* out);
721 
723  exr_context_t ctxt,
724  int part_index,
725  const char* name,
726  const exr_attr_v2i_t* v);
727 
729  exr_const_context_t ctxt,
730  int part_index,
731  const char* name,
732  exr_attr_v2f_t* out);
733 
735  exr_context_t ctxt,
736  int part_index,
737  const char* name,
738  const exr_attr_v2f_t* v);
739 
741  exr_const_context_t ctxt,
742  int part_index,
743  const char* name,
744  exr_attr_v2d_t* out);
745 
747  exr_context_t ctxt,
748  int part_index,
749  const char* name,
750  const exr_attr_v2d_t* v);
751 
753  exr_const_context_t ctxt,
754  int part_index,
755  const char* name,
756  exr_attr_v3i_t* out);
757 
759  exr_context_t ctxt,
760  int part_index,
761  const char* name,
762  const exr_attr_v3i_t* v);
763 
765  exr_const_context_t ctxt,
766  int part_index,
767  const char* name,
768  exr_attr_v3f_t* out);
769 
771  exr_context_t ctxt,
772  int part_index,
773  const char* name,
774  const exr_attr_v3f_t* v);
775 
777  exr_const_context_t ctxt,
778  int part_index,
779  const char* name,
780  exr_attr_v3d_t* out);
781 
783  exr_context_t ctxt,
784  int part_index,
785  const char* name,
786  const exr_attr_v3d_t* v);
787 
789  exr_const_context_t ctxt,
790  int part_index,
791  const char* name,
792  const char** type,
793  int32_t* size,
794  const void** out);
795 
797  exr_context_t ctxt,
798  int part_index,
799  const char* name,
800  const char* type,
801  int32_t size,
802  const void* out);
803 
804 /** @} */ /* built-in attr group */
805 
806 /** @} */ /* metadata group */
807 
808 /** @} */ /* part group */
809 
810 #ifdef __cplusplus
811 } /* extern "C" */
812 #endif
813 
814 #endif /* OPENEXR_PART_H */
EXR_EXPORT exr_result_t exr_attr_set_envmap(exr_context_t ctxt, int part_index, const char *name, exr_envmap_t emap)
EXR_EXPORT exr_result_t exr_get_screen_window_center(exr_const_context_t ctxt, int part_index, exr_attr_v2f_t *wc)
Retrieve the screen oriented window center for the specified part (use 0 for single part images)...
EXR_EXPORT exr_result_t exr_attr_get_m33d(exr_const_context_t ctxt, int part_index, const char *name, exr_attr_m33d_t *out)
EXR_EXPORT exr_result_t exr_attr_set_tiledesc(exr_context_t ctxt, int part_index, const char *name, const exr_attr_tiledesc_t *td)
EXR_EXPORT exr_result_t exr_get_chunk_count(exr_const_context_t ctxt, int part_index, int32_t *out)
EXR_EXPORT exr_result_t exr_attr_set_user(exr_context_t ctxt, int part_index, const char *name, const char *type, int32_t size, const void *out)
EXR_EXPORT exr_result_t exr_get_level_sizes(exr_const_context_t ctxt, int part_index, int levelx, int levely, int32_t *levw, int32_t *levh)
Query the data sizes for a particular level in the specified part.
EXR_EXPORT exr_result_t exr_attr_set_v2f(exr_context_t ctxt, int part_index, const char *name, const exr_attr_v2f_t *v)
EXR_EXPORT exr_result_t exr_attr_set_timecode(exr_context_t ctxt, int part_index, const char *name, const exr_attr_timecode_t *tc)
Struct to hold a floating-point box/region definition.
Definition: openexr_attr.h:261
EXR_EXPORT exr_result_t exr_attr_set_v3f(exr_context_t ctxt, int part_index, const char *name, const exr_attr_v3f_t *v)
Struct to hold an integer box/region definition.
Definition: openexr_attr.h:254
EXR_EXPORT exr_result_t exr_attr_get_v2f(exr_const_context_t ctxt, int part_index, const char *name, exr_attr_v2f_t *out)
EXR_EXPORT exr_result_t exr_get_attribute_count(exr_const_context_t ctxt, int part_index, int32_t *count)
Query the count of attributes in a part.
EXR_EXPORT exr_result_t exr_attr_get_float(exr_const_context_t ctxt, int part_index, const char *name, float *out)
EXR_EXPORT exr_result_t exr_attr_set_int(exr_context_t ctxt, int part_index, const char *name, int32_t val)
Struct holding base tiledesc attribute type defined in spec.
Definition: openexr_attr.h:272
EXR_EXPORT exr_result_t exr_attr_get_lineorder(exr_const_context_t ctxt, int part_index, const char *name, exr_lineorder_t *out)
EXR_EXPORT exr_result_t exr_get_data_window(exr_const_context_t ctxt, int part_index, exr_attr_box2i_t *out)
Retrieve the data window for the specified part.
const GLdouble * v
Definition: glcorearb.h:837
EXR_EXPORT exr_result_t exr_attr_get_double(exr_const_context_t ctxt, int part_index, const char *name, double *out)
EXR_EXPORT exr_result_t exr_attr_set_v2i(exr_context_t ctxt, int part_index, const char *name, const exr_attr_v2i_t *v)
EXR_EXPORT exr_result_t exr_attr_get_string(exr_const_context_t ctxt, int part_index, const char *name, int32_t *length, const char **out)
Zero-copy query of string value.
Struct to hold an integer ratio value.
Definition: openexr_attr.h:162
EXR_EXPORT exr_result_t exr_attr_get_preview(exr_const_context_t ctxt, int part_index, const char *name, exr_attr_preview_t *out)
EXR_EXPORT exr_result_t exr_attr_get_v3d(exr_const_context_t ctxt, int part_index, const char *name, exr_attr_v3d_t *out)
EXR_EXPORT exr_result_t exr_attr_set_double(exr_context_t ctxt, int part_index, const char *name, double val)
GLint level
Definition: glcorearb.h:108
EXR_EXPORT exr_result_t exr_attr_set_keycode(exr_context_t ctxt, int part_index, const char *name, const exr_attr_keycode_t *kc)
Struct to hold a 3-element integer vector.
Definition: openexr_attr.h:215
exr_perceptual_treatment_t
Definition: openexr_attr.h:330
EXR_EXPORT exr_result_t exr_attr_set_v3d(exr_context_t ctxt, int part_index, const char *name, const exr_attr_v3d_t *v)
EXR_EXPORT exr_result_t exr_attr_set_box2i(exr_context_t ctxt, int part_index, const char *name, const exr_attr_box2i_t *val)
EXR_EXPORT exr_result_t exr_set_chunk_count(exr_context_t ctxt, int part_index, int32_t val)
GLdouble s
Definition: glad.h:3009
EXR_EXPORT exr_result_t exr_get_display_window(exr_const_context_t ctxt, int part_index, exr_attr_box2i_t *out)
Retrieve the display window for the specified part.
EXR_EXPORT exr_result_t exr_attr_get_compression(exr_const_context_t ctxt, int part_index, const char *name, exr_compression_t *out)
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:795
Struct to hold a 3-element 32-bit float vector.
Definition: openexr_attr.h:228
EXR_EXPORT exr_result_t exr_set_compression(exr_context_t ctxt, int part_index, exr_compression_t ctype)
Set the compression method used for the specified part.
EXR_EXPORT exr_result_t exr_set_zip_compression_level(exr_context_t ctxt, int part_index, int level)
Set the zip compression method used for the specified part.
EXR_EXPORT exr_result_t exr_get_name(exr_const_context_t ctxt, int part_index, const char **out)
Query the part name for the specified part.
EXR_EXPORT exr_result_t exr_attr_get_v3f(exr_const_context_t ctxt, int part_index, const char *name, exr_attr_v3f_t *out)
Struct to hold a 64-bit floating-point 4x4 matrix.
Definition: openexr_attr.h:156
EXR_EXPORT exr_result_t exr_set_channels(exr_context_t ctxt, int part_index, const exr_attr_chlist_t *channels)
Copy the channels from another source.
EXR_EXPORT exr_result_t exr_initialize_required_attr_simple(exr_context_t ctxt, int part_index, int32_t width, int32_t height, exr_compression_t ctype)
Initialize all required attributes to default values:
EXR_EXPORT exr_result_t exr_attr_declare(exr_context_t ctxt, int part_index, const char *name, exr_attribute_type_t type, exr_attribute_t **newattr)
Declare an attribute within the specified part.
const struct _priv_exr_context_t * exr_const_context_t
EXR_EXPORT exr_result_t exr_attr_get_timecode(exr_const_context_t ctxt, int part_index, const char *name, exr_attr_timecode_t *out)
EXR_EXPORT exr_result_t exr_get_pixel_aspect_ratio(exr_const_context_t ctxt, int part_index, float *par)
Retrieve the pixel aspect ratio for the specified part (use 0 for single part images).
exr_lineorder_t
Definition: openexr_attr.h:60
EXR_EXPORT exr_result_t exr_get_dwa_compression_level(exr_const_context_t ctxt, int part_index, float *level)
Retrieve the dwa compression level used for the specified part.
EXR_EXPORT exr_result_t exr_get_channels(exr_const_context_t ctxt, int part_index, const exr_attr_chlist_t **chlist)
Retrieve the list of channels.
EXR_EXPORT exr_result_t exr_set_screen_window_width(exr_context_t ctxt, int part_index, float ssw)
Set the screen oriented window width for the specified part (use 0 for single part images)...
EXR_EXPORT exr_result_t exr_initialize_required_attr(exr_context_t ctxt, int part_index, const exr_attr_box2i_t *displayWindow, const exr_attr_box2i_t *dataWindow, float pixelaspectratio, const exr_attr_v2f_t *screenWindowCenter, float screenWindowWidth, exr_lineorder_t lineorder, exr_compression_t ctype)
Initialize all required attributes for all files.
EXR_EXPORT exr_result_t exr_get_chunk_unpacked_size(exr_const_context_t ctxt, int part_index, uint64_t *out)
EXR_EXPORT exr_result_t exr_get_tile_descriptor(exr_const_context_t ctxt, int part_index, uint32_t *xsize, uint32_t *ysize, exr_tile_level_mode_t *level, exr_tile_round_mode_t *round)
Retrieve the tiling info for a tiled part (use 0 for single part images).
EXR_EXPORT exr_result_t exr_get_storage(exr_const_context_t ctxt, int part_index, exr_storage_t *out)
Query the storage type for the specified part.
EXR_EXPORT exr_result_t exr_attr_get_channels(exr_const_context_t ctxt, int part_index, const char *name, const exr_attr_chlist_t **chlist)
Zero-copy query of channel data.
GLint GLsizei GLsizei height
Definition: glcorearb.h:103
EXR_EXPORT exr_result_t exr_set_pixel_aspect_ratio(exr_context_t ctxt, int part_index, float par)
Set the pixel aspect ratio for the specified part (use 0 for single part images). ...
EXR_EXPORT exr_result_t exr_attr_get_box2f(exr_const_context_t ctxt, int part_index, const char *name, exr_attr_box2f_t *outval)
EXR_EXPORT exr_result_t exr_attr_set_m33f(exr_context_t ctxt, int part_index, const char *name, const exr_attr_m33f_t *m)
EXR_EXPORT exr_result_t exr_attr_set_channels(exr_context_t ctxt, int part_index, const char *name, const exr_attr_chlist_t *channels)
This allows one to quickly copy the channels from one file to another.
EXR_EXPORT exr_result_t exr_attr_set_chromaticities(exr_context_t ctxt, int part_index, const char *name, const exr_attr_chromaticities_t *chroma)
EXR_EXPORT exr_result_t exr_attr_set_compression(exr_context_t ctxt, int part_index, const char *name, exr_compression_t comp)
EXR_EXPORT exr_result_t exr_copy_unset_attributes(exr_context_t ctxt, int part_index, exr_const_context_t source, int src_part_index)
Copy the attributes from one part to another.
EXR_EXPORT exr_result_t exr_get_count(exr_const_context_t ctxt, int *count)
Query how many parts are in the file.
EXR_EXPORT exr_result_t exr_set_tile_descriptor(exr_context_t ctxt, int part_index, uint32_t x_size, uint32_t y_size, exr_tile_level_mode_t level_mode, exr_tile_round_mode_t round_mode)
Set the tiling info for a tiled part (use 0 for single part images).
Struct to hold a 32-bit floating-point 4x4 matrix.
Definition: openexr_attr.h:150
EXR_EXPORT exr_result_t exr_attr_declare_by_type(exr_context_t ctxt, int part_index, const char *name, const char *type, exr_attribute_t **newattr)
EXR_EXPORT exr_result_t exr_get_attribute_list(exr_const_context_t ctxt, int part_index, exr_attr_list_access_mode_t mode, int32_t *count, const exr_attribute_t **outlist)
Query the list of attributes in a part.
int32_t exr_result_t
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:803
#define EXR_EXPORT
EXR_EXPORT exr_result_t exr_attr_set_float(exr_context_t ctxt, int part_index, const char *name, float val)
exr_tile_level_mode_t
Enum representing what type of tile information is contained.
Definition: openexr_attr.h:79
struct _priv_exr_context_t * exr_context_t
struct to hold a 64-bit floating-point 3x3 matrix.
Definition: openexr_attr.h:144
EXR_EXPORT exr_result_t exr_attr_get_keycode(exr_const_context_t ctxt, int part_index, const char *name, exr_attr_keycode_t *out)
EXR_EXPORT exr_result_t exr_attr_get_tiledesc(exr_const_context_t ctxt, int part_index, const char *name, exr_attr_tiledesc_t *out)
EXR_EXPORT exr_result_t exr_get_tile_levels(exr_const_context_t ctxt, int part_index, int32_t *levelsx, int32_t *levelsy)
Query how many levels are in the specified part.
exr_attr_list_access_mode
Definition: openexr_part.h:211
EXR_EXPORT exr_result_t exr_attr_set_string(exr_context_t ctxt, int part_index, const char *name, const char *s)
Struct to hold a 2-element 64-bit float vector.
Definition: openexr_attr.h:202
EXR_EXPORT exr_result_t exr_attr_get_float_vector(exr_const_context_t ctxt, int part_index, const char *name, int32_t *sz, const float **out)
Zero-copy query of float data.
EXR_EXPORT exr_result_t exr_set_version(exr_context_t ctxt, int part_index, int32_t val)
GLuint const GLchar * name
Definition: glcorearb.h:786
EXR_EXPORT exr_result_t exr_attr_set_preview(exr_context_t ctxt, int part_index, const char *name, const exr_attr_preview_t *p)
EXR_EXPORT exr_result_t exr_attr_set_box2f(exr_context_t ctxt, int part_index, const char *name, const exr_attr_box2f_t *val)
vfloat4 round(const vfloat4 &a)
Definition: simd.h:7436
EXR_EXPORT int exr_set_data_window(exr_context_t ctxt, int part_index, const exr_attr_box2i_t *dw)
Set the data window for the specified part.
EXR_EXPORT exr_result_t exr_attr_get_envmap(exr_const_context_t ctxt, int part_index, const char *name, exr_envmap_t *out)
exr_compression_t
Definition: openexr_attr.h:36
EXR_EXPORT exr_result_t exr_attr_get_box2i(exr_const_context_t ctxt, int part_index, const char *name, exr_attr_box2i_t *outval)
GLenum mode
Definition: glcorearb.h:99
EXR_EXPORT int exr_set_display_window(exr_context_t ctxt, int part_index, const exr_attr_box2i_t *dw)
Set the display window for the specified part.
EXR_EXPORT exr_result_t exr_get_scanlines_per_chunk(exr_const_context_t ctxt, int part_index, int32_t *out)
EXR_EXPORT exr_result_t exr_get_version(exr_const_context_t ctxt, int part_index, int32_t *out)
Struct to define attributes of an embedded preview image.
Definition: openexr_attr.h:359
EXR_EXPORT exr_result_t exr_set_name(exr_context_t ctxt, int part_index, const char *val)
struct to hold a 32-bit floating-point 3x3 matrix.
Definition: openexr_attr.h:138
exr_tile_round_mode_t
Enum representing how to scale positions between levels.
Definition: openexr_attr.h:88
GLsizeiptr size
Definition: glcorearb.h:664
exr_storage_t
Definition: openexr_attr.h:69
exr_envmap_t
Definition: openexr_attr.h:52
EXR_EXPORT exr_result_t exr_attr_set_m44d(exr_context_t ctxt, int part_index, const char *name, const exr_attr_m44d_t *m)
EXR_EXPORT exr_result_t exr_get_attribute_by_name(exr_const_context_t ctxt, int part_index, const char *name, const exr_attribute_t **outattr)
Query a particular attribute by name.
EXR_EXPORT exr_result_t exr_attr_set_v2d(exr_context_t ctxt, int part_index, const char *name, const exr_attr_v2d_t *v)
EXR_EXPORT exr_result_t exr_get_attribute_by_index(exr_const_context_t ctxt, int part_index, exr_attr_list_access_mode_t mode, int32_t idx, const exr_attribute_t **outattr)
Query a particular attribute by index.
Struct to hold timecode information.
Definition: openexr_attr.h:169
EXR_EXPORT exr_result_t exr_attr_get_v2d(exr_const_context_t ctxt, int part_index, const char *name, exr_attr_v2d_t *out)
EXR_EXPORT exr_result_t exr_attr_get_m33f(exr_const_context_t ctxt, int part_index, const char *name, exr_attr_m33f_t *out)
EXR_EXPORT exr_result_t exr_attr_get_string_vector(exr_const_context_t ctxt, int part_index, const char *name, int32_t *size, const char **out)
Zero-copy query of string data.
EXR_EXPORT exr_result_t exr_attr_get_chromaticities(exr_const_context_t ctxt, int part_index, const char *name, exr_attr_chromaticities_t *chroma)
EXR_EXPORT exr_result_t exr_get_compression(exr_const_context_t ctxt, int part_index, exr_compression_t *compression)
Retrieve the compression method used for the specified part.
Storage, name and type information for an attribute.
Definition: openexr_attr.h:469
EXR_EXPORT exr_result_t exr_get_zip_compression_level(exr_const_context_t ctxt, int part_index, int *level)
Retrieve the zip compression level used for the specified part.
EXR_EXPORT exr_result_t exr_get_lineorder(exr_const_context_t ctxt, int part_index, exr_lineorder_t *out)
Retrieve the line order for storing data in the specified part (use 0 for single part images)...
GLuint GLfloat * val
Definition: glcorearb.h:1608
EXR_EXPORT exr_result_t exr_set_dwa_compression_level(exr_context_t ctxt, int part_index, float level)
Set the dwa compression method used for the specified part.
Struct to hold a 2-element integer vector.
Definition: openexr_attr.h:176
EXR_EXPORT exr_result_t exr_attr_get_int(exr_const_context_t ctxt, int part_index, const char *name, int32_t *out)
GLint GLsizei width
Definition: glcorearb.h:103
EXR_EXPORT exr_result_t exr_attr_get_m44f(exr_const_context_t ctxt, int part_index, const char *name, exr_attr_m44f_t *out)
EXR_EXPORT exr_result_t exr_attr_get_v2i(exr_const_context_t ctxt, int part_index, const char *name, exr_attr_v2i_t *out)
Struct to hold a 2-element 32-bit float vector.
Definition: openexr_attr.h:189
EXR_EXPORT exr_result_t exr_attr_set_float_vector(exr_context_t ctxt, int part_index, const char *name, int32_t sz, const float *vals)
EXR_EXPORT int exr_add_channel(exr_context_t ctxt, int part_index, const char *name, exr_pixel_type_t ptype, exr_perceptual_treatment_t percept, int32_t xsamp, int32_t ysamp)
Define a new channel to the output file part.
EXR_EXPORT exr_result_t exr_attr_set_rational(exr_context_t ctxt, int part_index, const char *name, const exr_attr_rational_t *r)
EXR_EXPORT exr_result_t exr_attr_get_v3i(exr_const_context_t ctxt, int part_index, const char *name, exr_attr_v3i_t *out)
EXR_EXPORT exr_result_t exr_attr_get_m44d(exr_const_context_t ctxt, int part_index, const char *name, exr_attr_m44d_t *out)
GLboolean r
Definition: glcorearb.h:1222
enum exr_attr_list_access_mode exr_attr_list_access_mode_t
EXR_EXPORT exr_result_t exr_get_tile_sizes(exr_const_context_t ctxt, int part_index, int levelx, int levely, int32_t *tilew, int32_t *tileh)
Query the tile size for a particular level in the specified part.
EXR_EXPORT exr_result_t exr_attr_set_m33d(exr_context_t ctxt, int part_index, const char *name, const exr_attr_m33d_t *m)
Struct to hold keycode information.
Definition: openexr_attr.h:126
Struct to hold color chromaticities to interpret the tristimulus color values in the image data...
Definition: openexr_attr.h:113
EXR_EXPORT int exr_set_screen_window_center(exr_context_t ctxt, int part_index, const exr_attr_v2f_t *wc)
Set the screen oriented window center for the specified part (use 0 for single part images)...
EXR_EXPORT exr_result_t exr_attr_set_string_vector(exr_context_t ctxt, int part_index, const char *name, int32_t size, const char **sv)
EXR_EXPORT exr_result_t exr_add_part(exr_context_t ctxt, const char *partname, exr_storage_t type, int *new_index)
Define a new part in the file.
type
Definition: core.h:1059
EXR_EXPORT exr_result_t exr_set_lineorder(exr_context_t ctxt, int part_index, exr_lineorder_t lo)
Set the line order for storing data in the specified part (use 0 for single part images).
EXR_EXPORT exr_result_t exr_attr_set_v3i(exr_context_t ctxt, int part_index, const char *name, const exr_attr_v3i_t *v)
exr_attribute_type_t
Built-in/native attribute type enum.
Definition: openexr_attr.h:421
EXR_EXPORT exr_result_t exr_attr_set_lineorder(exr_context_t ctxt, int part_index, const char *name, exr_lineorder_t lo)
GLint GLsizei count
Definition: glcorearb.h:405
exr_pixel_type_t
Enum capturing the underlying data type on a channel.
Definition: openexr_attr.h:96
EXR_EXPORT exr_result_t exr_attr_get_rational(exr_const_context_t ctxt, int part_index, const char *name, exr_attr_rational_t *out)
EXR_EXPORT exr_result_t exr_attr_set_m44f(exr_context_t ctxt, int part_index, const char *name, const exr_attr_m44f_t *m)
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)
EXR_EXPORT exr_result_t exr_get_screen_window_width(exr_const_context_t ctxt, int part_index, float *out)
Retrieve the screen oriented window width for the specified part (use 0 for single part images)...
Struct to hold a 3-element 64-bit float vector.
Definition: openexr_attr.h:241
EXR_EXPORT exr_result_t exr_attr_get_user(exr_const_context_t ctxt, int part_index, const char *name, const char **type, int32_t *size, const void **out)