openexr_part.h 27 KB

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