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 tile count for a particular level in the specified part.
102  *
103  * If the part is a tiled part, fills in the count 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 countx or @p county
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* countx,
119  int32_t* county);
120 
121 /** @brief Query the data sizes for a particular level in the specified part.
122  *
123  * If the part is a tiled part, fill in the width/height for the
124  * specified levels.
125  *
126  * Return `ERR_SUCCESS` on success, an error otherwise (i.e. if the part
127  * is not tiled).
128  *
129  * It is valid to pass `NULL` to either of the @p levw or @p levh
130  * arguments, which enables testing if this part is a tiled part, or
131  * if you don't need both for some reason.
132  */
134  exr_const_context_t ctxt,
135  int part_index,
136  int levelx,
137  int levely,
138  int32_t* levw,
139  int32_t* levh);
140 
141 /** Return the number of chunks contained in this part of the file.
142  *
143  * As in the technical documentation for OpenEXR, the chunk is the
144  * generic term for a pixel data block. This is the atomic unit that
145  * this library uses to negotiate data to and from a context.
146  *
147  * This should be used as a basis for splitting up how a file is
148  * processed. Depending on the compression, a different number of
149  * scanlines are encoded in each chunk, and since those need to be
150  * encoded/decoded as a block, the chunk should be the basis for I/O
151  * as well.
152  */
154 exr_get_chunk_count (exr_const_context_t ctxt, int part_index, int32_t* out);
155 
156 /** Return a pointer to the chunk table and the count
157  *
158  * TODO: consider removing this prior to release once C++ fully converted
159  */
161 exr_get_chunk_table (exr_const_context_t ctxt, int part_index, uint64_t **table, int32_t* count);
162 
163 /** Return whether the chunk table for this part is completely written.
164  *
165  * This only validates that all the offsets are valid.
166  *
167  * return EXR_ERR_INCOMPLETE_CHUNK_TABLE when incomplete, EXR_ERR_SUCCESS
168  * if it appears ok, or another error if otherwise problematic
169  */
172 
173 /** Return the number of scanlines chunks for this file part.
174  *
175  * When iterating over a scanline file, this may be an easier metric
176  * for multi-threading or other access than only negotiating chunk
177  * counts, and so is provided as a utility.
178  */
180  exr_const_context_t ctxt, int part_index, int32_t* out);
181 
182 /** Return the maximum unpacked size of a chunk for the file part.
183  *
184  * This may be used ahead of any actual reading of data, so can be
185  * used to pre-allocate buffers for multiple threads in one block or
186  * whatever your application may require.
187  */
189  exr_const_context_t ctxt, int part_index, uint64_t* out);
190 
191 /** @brief Retrieve the zip compression level used for the specified part.
192  *
193  * This only applies when the compression method involves using zip
194  * compression (zip, zips, some modes of DWAA/DWAB).
195  *
196  * This value is NOT persisted in the file, and only exists for the
197  * lifetime of the context, so will be at the default value when just
198  * reading a file.
199  */
201  exr_const_context_t ctxt, int part_index, int* level);
202 
203 /** @brief Set the zip compression method used for the specified part.
204  *
205  * This only applies when the compression method involves using zip
206  * compression (zip, zips, some modes of DWAA/DWAB).
207  *
208  * This value is NOT persisted in the file, and only exists for the
209  * lifetime of the context, so this value will be ignored when
210  * reading a file.
211  */
214 
215 /** @brief Retrieve the dwa compression level used for the specified part.
216  *
217  * This only applies when the compression method is DWAA/DWAB.
218  *
219  * This value is NOT persisted in the file, and only exists for the
220  * lifetime of the context, so will be at the default value when just
221  * reading a file.
222  */
224  exr_const_context_t ctxt, int part_index, float* level);
225 
226 /** @brief Set the dwa compression method used for the specified part.
227  *
228  * This only applies when the compression method is DWAA/DWAB.
229  *
230  * This value is NOT persisted in the file, and only exists for the
231  * lifetime of the context, so this value will be ignored when
232  * reading a file.
233  */
236 
237 /**************************************/
238 
239 /** @defgroup PartMetadata Functions to get and set metadata for a particular part.
240  * @{
241  *
242  */
243 
244 /** @brief Query the count of attributes in a part. */
246  exr_const_context_t ctxt, int part_index, int32_t* count);
247 
249 {
250  EXR_ATTR_LIST_FILE_ORDER, /**< Order they appear in the file */
251  EXR_ATTR_LIST_SORTED_ORDER /**< Alphabetically sorted */
253 
254 /** @brief Query a particular attribute by index. */
256  exr_const_context_t ctxt,
257  int part_index,
259  int32_t idx,
260  const exr_attribute_t** outattr);
261 
262 /** @brief Query a particular attribute by name. */
264  exr_const_context_t ctxt,
265  int part_index,
266  const char* name,
267  const exr_attribute_t** outattr);
268 
269 /** @brief Query the list of attributes in a part.
270  *
271  * This retrieves a list of attributes currently defined in a part.
272  *
273  * If outlist is `NULL`, this function still succeeds, filling only the
274  * count. In this manner, the user can allocate memory for the list of
275  * attributes, then re-call this function to get the full list.
276  */
278  exr_const_context_t ctxt,
279  int part_index,
281  int32_t* count,
282  const exr_attribute_t** outlist);
283 
284 /** Declare an attribute within the specified part.
285  *
286  * Only valid when a file is opened for write.
287  */
289  exr_context_t ctxt,
290  int part_index,
291  const char* name,
292  const char* type,
293  exr_attribute_t** newattr);
294 
295 /** @brief Declare an attribute within the specified part.
296  *
297  * Only valid when a file is opened for write.
298  */
300  exr_context_t ctxt,
301  int part_index,
302  const char* name,
304  exr_attribute_t** newattr);
305 
306 /**
307  * @defgroup RequiredAttributeHelpers Required Attribute Utililities
308  *
309  * @brief These are a group of functions for attributes that are
310  * required to be in every part of every file.
311  *
312  * @{
313  */
314 
315 /** @brief Initialize all required attributes for all files.
316  *
317  * NB: other file types do require other attributes, such as the tile
318  * description for a tiled file.
319  */
321  exr_context_t ctxt,
322  int part_index,
323  const exr_attr_box2i_t* displayWindow,
324  const exr_attr_box2i_t* dataWindow,
325  float pixelaspectratio,
326  const exr_attr_v2f_t* screenWindowCenter,
327  float screenWindowWidth,
328  exr_lineorder_t lineorder,
329  exr_compression_t ctype);
330 
331 /** @brief Initialize all required attributes to default values:
332  *
333  * - `displayWindow` is set to (0, 0 -> @p width - 1, @p height - 1)
334  * - `dataWindow` is set to (0, 0 -> @p width - 1, @p height - 1)
335  * - `pixelAspectRatio` is set to 1.0
336  * - `screenWindowCenter` is set to 0.f, 0.f
337  * - `screenWindowWidth` is set to 1.f
338  * - `lineorder` is set to `INCREASING_Y`
339  * - `compression` is set to @p ctype
340  */
342  exr_context_t ctxt,
343  int part_index,
344  int32_t width,
345  int32_t height,
346  exr_compression_t ctype);
347 
348 /** @brief Copy the attributes from one part to another.
349  *
350  * This allows one to quickly unassigned attributes from one source to another.
351  *
352  * If an attribute in the source part has not been yet set in the
353  * destination part, the item will be copied over.
354  *
355  * For example, when you add a part, the storage type and name
356  * attributes are required arguments to the definition of a new part,
357  * but channels has not yet been assigned. So by calling this with an
358  * input file as the source, you can copy the channel definitions (and
359  * any other unassigned attributes from the source).
360  */
362  exr_context_t ctxt,
363  int part_index,
365  int src_part_index);
366 
367 /** @brief Retrieve the list of channels. */
369  exr_const_context_t ctxt, int part_index, const exr_attr_chlist_t** chlist);
370 
371 /** @brief Define a new channel to the output file part.
372  *
373  * The @p percept parameter is used for lossy compression techniques
374  * to indicate that the value represented is closer to linear (1) or
375  * closer to logarithmic (0). For r, g, b, luminance, this is normally
376  * 0.
377  */
379  exr_context_t ctxt,
380  int part_index,
381  const char* name,
382  exr_pixel_type_t ptype,
384  int32_t xsamp,
385  int32_t ysamp);
386 
387 /** @brief Copy the channels from another source.
388  *
389  * Useful if you are manually constructing the list or simply copying
390  * from an input file.
391  */
394 
395 /** @brief Retrieve the compression method used for the specified part. */
397  exr_const_context_t ctxt, int part_index, exr_compression_t* compression);
398 /** @brief Set the compression method used for the specified part. */
400  exr_context_t ctxt, int part_index, exr_compression_t ctype);
401 
402 /** @brief Retrieve the data window for the specified part. */
405 /** @brief Set the data window for the specified part. */
407  exr_context_t ctxt, int part_index, const exr_attr_box2i_t* dw);
408 
409 /** @brief Retrieve the display window for the specified part. */
412 /** @brief Set the display window for the specified part. */
414  exr_context_t ctxt, int part_index, const exr_attr_box2i_t* dw);
415 
416 /** @brief Retrieve the line order for storing data in the specified part (use 0 for single part images). */
419 /** @brief Set the line order for storing data in the specified part (use 0 for single part images). */
422 
423 /** @brief Retrieve the pixel aspect ratio for the specified part (use 0 for single part images). */
425  exr_const_context_t ctxt, int part_index, float* par);
426 /** @brief Set the pixel aspect ratio for the specified part (use 0 for single part images). */
429 
430 /** @brief Retrieve the screen oriented window center for the specified part (use 0 for single part images). */
433 /** @brief Set the screen oriented window center for the specified part (use 0 for single part images). */
435  exr_context_t ctxt, int part_index, const exr_attr_v2f_t* wc);
436 
437 /** @brief Retrieve the screen oriented window width for the specified part (use 0 for single part images). */
439  exr_const_context_t ctxt, int part_index, float* out);
440 /** @brief Set the screen oriented window width for the specified part (use 0 for single part images). */
443 
444 /** @brief Retrieve the tiling info for a tiled part (use 0 for single part images). */
446  exr_const_context_t ctxt,
447  int part_index,
448  uint32_t* xsize,
449  uint32_t* ysize,
452 
453 /** @brief Set the tiling info for a tiled part (use 0 for single part images). */
455  exr_context_t ctxt,
456  int part_index,
457  uint32_t x_size,
458  uint32_t y_size,
459  exr_tile_level_mode_t level_mode,
460  exr_tile_round_mode_t round_mode);
461 
463 exr_set_name (exr_context_t ctxt, int part_index, const char* val);
464 
466 exr_get_version (exr_const_context_t ctxt, int part_index, int32_t* out);
467 
469 exr_set_version (exr_context_t ctxt, int part_index, int32_t val);
470 
472 exr_set_chunk_count (exr_context_t ctxt, int part_index, int32_t val);
473 
474 /** @} */ /* required attr group. */
475 
476 /**
477  * @defgroup BuiltinAttributeHelpers Attribute utilities for builtin types
478  *
479  * @brief These are a group of functions for attributes that use the builtin types.
480  *
481  * @{
482  */
483 
485  exr_const_context_t ctxt,
486  int part_index,
487  const char* name,
488  exr_attr_box2i_t* outval);
489 
491  exr_context_t ctxt,
492  int part_index,
493  const char* name,
494  const exr_attr_box2i_t* val);
495 
497  exr_const_context_t ctxt,
498  int part_index,
499  const char* name,
500  exr_attr_box2f_t* outval);
501 
503  exr_context_t ctxt,
504  int part_index,
505  const char* name,
506  const exr_attr_box2f_t* val);
507 
508 /** @brief Zero-copy query of channel data.
509  *
510  * Do not free or manipulate the @p chlist data, or use
511  * after the lifetime of the context.
512  */
514  exr_const_context_t ctxt,
515  int part_index,
516  const char* name,
517  const exr_attr_chlist_t** chlist);
518 
519 /** @brief This allows one to quickly copy the channels from one file
520  * to another.
521  */
523  exr_context_t ctxt,
524  int part_index,
525  const char* name,
526  const exr_attr_chlist_t* channels);
527 
529  exr_const_context_t ctxt,
530  int part_index,
531  const char* name,
532  exr_attr_chromaticities_t* chroma);
533 
535  exr_context_t ctxt,
536  int part_index,
537  const char* name,
538  const exr_attr_chromaticities_t* chroma);
539 
541  exr_const_context_t ctxt,
542  int part_index,
543  const char* name,
544  exr_compression_t* out);
545 
547  exr_context_t ctxt,
548  int part_index,
549  const char* name,
550  exr_compression_t comp);
551 
553  exr_const_context_t ctxt, int part_index, const char* name, double* out);
554 
556  exr_context_t ctxt, int part_index, const char* name, double val);
557 
559  exr_const_context_t ctxt,
560  int part_index,
561  const char* name,
562  exr_envmap_t* out);
563 
565  exr_context_t ctxt, int part_index, const char* name, exr_envmap_t emap);
566 
568  exr_const_context_t ctxt, int part_index, const char* name, float* out);
569 
571  exr_context_t ctxt, int part_index, const char* name, float val);
572 
573 /** @brief Zero-copy query of float data.
574  *
575  * Do not free or manipulate the @p out data, or use after the
576  * lifetime of the context.
577  */
579  exr_const_context_t ctxt,
580  int part_index,
581  const char* name,
582  int32_t* sz,
583  const float** out);
584 
586  exr_context_t ctxt,
587  int part_index,
588  const char* name,
589  int32_t sz,
590  const float* vals);
591 
593  exr_const_context_t ctxt, int part_index, const char* name, int32_t* out);
594 
596  exr_context_t ctxt, int part_index, const char* name, int32_t val);
597 
599  exr_const_context_t ctxt,
600  int part_index,
601  const char* name,
602  exr_attr_keycode_t* out);
603 
605  exr_context_t ctxt,
606  int part_index,
607  const char* name,
608  const exr_attr_keycode_t* kc);
609 
611  exr_const_context_t ctxt,
612  int part_index,
613  const char* name,
614  exr_lineorder_t* out);
615 
617  exr_context_t ctxt, int part_index, const char* name, exr_lineorder_t lo);
618 
620  exr_const_context_t ctxt,
621  int part_index,
622  const char* name,
623  exr_attr_m33f_t* out);
624 
626  exr_context_t ctxt,
627  int part_index,
628  const char* name,
629  const exr_attr_m33f_t* m);
630 
632  exr_const_context_t ctxt,
633  int part_index,
634  const char* name,
635  exr_attr_m33d_t* out);
636 
638  exr_context_t ctxt,
639  int part_index,
640  const char* name,
641  const exr_attr_m33d_t* m);
642 
644  exr_const_context_t ctxt,
645  int part_index,
646  const char* name,
647  exr_attr_m44f_t* out);
648 
650  exr_context_t ctxt,
651  int part_index,
652  const char* name,
653  const exr_attr_m44f_t* m);
654 
656  exr_const_context_t ctxt,
657  int part_index,
658  const char* name,
659  exr_attr_m44d_t* out);
660 
662  exr_context_t ctxt,
663  int part_index,
664  const char* name,
665  const exr_attr_m44d_t* m);
666 
668  exr_const_context_t ctxt,
669  int part_index,
670  const char* name,
671  exr_attr_preview_t* out);
672 
674  exr_context_t ctxt,
675  int part_index,
676  const char* name,
677  const exr_attr_preview_t* p);
678 
680  exr_const_context_t ctxt,
681  int part_index,
682  const char* name,
683  exr_attr_rational_t* out);
684 
686  exr_context_t ctxt,
687  int part_index,
688  const char* name,
689  const exr_attr_rational_t* r);
690 
691 /** @brief Zero-copy query of string value.
692  *
693  * Do not modify the string pointed to by @p out, and do not use
694  * after the lifetime of the context.
695  */
697  exr_const_context_t ctxt,
698  int part_index,
699  const char* name,
700  int32_t* length,
701  const char** out);
702 
704  exr_context_t ctxt, int part_index, const char* name, const char* s);
705 
706 /** @brief Zero-copy query of string data.
707  *
708  * Do not free the strings pointed to by the array.
709  *
710  * Must provide @p size.
711  *
712  * \p out must be a ``const char**`` array large enough to hold
713  * the string pointers for the string vector when provided.
714  */
716  exr_const_context_t ctxt,
717  int part_index,
718  const char* name,
719  int32_t* size,
720  const char** out);
721 
723  exr_context_t ctxt,
724  int part_index,
725  const char* name,
726  int32_t size,
727  const char** sv);
728 
730  exr_const_context_t ctxt,
731  int part_index,
732  const char* name,
733  exr_attr_tiledesc_t* out);
734 
736  exr_context_t ctxt,
737  int part_index,
738  const char* name,
739  const exr_attr_tiledesc_t* td);
740 
742  exr_const_context_t ctxt,
743  int part_index,
744  const char* name,
745  exr_attr_timecode_t* out);
746 
748  exr_context_t ctxt,
749  int part_index,
750  const char* name,
751  const exr_attr_timecode_t* tc);
752 
754  exr_const_context_t ctxt,
755  int part_index,
756  const char* name,
757  exr_attr_v2i_t* out);
758 
760  exr_context_t ctxt,
761  int part_index,
762  const char* name,
763  const exr_attr_v2i_t* v);
764 
766  exr_const_context_t ctxt,
767  int part_index,
768  const char* name,
769  exr_attr_v2f_t* out);
770 
772  exr_context_t ctxt,
773  int part_index,
774  const char* name,
775  const exr_attr_v2f_t* v);
776 
778  exr_const_context_t ctxt,
779  int part_index,
780  const char* name,
781  exr_attr_v2d_t* out);
782 
784  exr_context_t ctxt,
785  int part_index,
786  const char* name,
787  const exr_attr_v2d_t* v);
788 
790  exr_const_context_t ctxt,
791  int part_index,
792  const char* name,
793  exr_attr_v3i_t* out);
794 
796  exr_context_t ctxt,
797  int part_index,
798  const char* name,
799  const exr_attr_v3i_t* v);
800 
802  exr_const_context_t ctxt,
803  int part_index,
804  const char* name,
805  exr_attr_v3f_t* out);
806 
808  exr_context_t ctxt,
809  int part_index,
810  const char* name,
811  const exr_attr_v3f_t* v);
812 
814  exr_const_context_t ctxt,
815  int part_index,
816  const char* name,
817  exr_attr_v3d_t* out);
818 
820  exr_context_t ctxt,
821  int part_index,
822  const char* name,
823  const exr_attr_v3d_t* v);
824 
826  exr_const_context_t ctxt,
827  int part_index,
828  const char* name,
829  const char** type,
830  int32_t* size,
831  const void** out);
832 
834  exr_context_t ctxt,
835  int part_index,
836  const char* name,
837  const char* type,
838  int32_t size,
839  const void* out);
840 
841 /** @} */ /* built-in attr group */
842 
843 /** @} */ /* metadata group */
844 
845 /** @} */ /* part group */
846 
847 #ifdef __cplusplus
848 } /* extern "C" */
849 #endif
850 
851 #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:230
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:223
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:241
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:173
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_get_tile_counts(exr_const_context_t ctxt, int part_index, int levelx, int levely, int32_t *countx, int32_t *county)
Query the tile count for a particular level in the specified part.
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:205
exr_perceptual_treatment_t
Definition: openexr_attr.h:299
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:211
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:167
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)
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:108
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:161
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:80
struct _priv_exr_context_t * exr_context_t
struct to hold a 64-bit floating-point 3x3 matrix.
Definition: openexr_attr.h:155
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:248
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:199
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_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_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:7647
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.
GLenum GLenum GLsizei void * table
Definition: glad.h:5129
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:328
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:149
exr_tile_round_mode_t
Enum representing how to scale positions between levels.
Definition: openexr_attr.h:89
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:180
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.
EXR_EXPORT exr_result_t exr_get_chunk_table(exr_const_context_t ctxt, int part_index, uint64_t **table, int32_t *count)
Storage, name and type information for an attribute.
Definition: openexr_attr.h:439
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:187
EXR_EXPORT exr_result_t exr_validate_chunk_table(exr_context_t ctxt, int part_index)
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:193
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 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:137
Struct to hold color chromaticities to interpret the tristimulus color values in the image data...
Definition: openexr_attr.h:124
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.
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:390
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:97
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:217
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)