ImfMultiPartOutputFile.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. //
  2. // SPDX-License-Identifier: BSD-3-Clause
  3. // Copyright (c) Contributors to the OpenEXR Project.
  4. //
  5. #ifndef MULTIPARTOUTPUTFILE_H_
  6. #define MULTIPARTOUTPUTFILE_H_
  7. #include "ImfForward.h"
  8. #include "ImfGenericOutputFile.h"
  9. #include "ImfThreading.h"
  10. OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
  11. //
  12. // Class responsible for handling the writing of multipart images.
  13. //
  14. // Note: Certain attributes are 'common' to all parts. Notably:
  15. // * Display Window
  16. // * Pixel Aspect Ratio
  17. // * Time Code
  18. // * Chromaticities
  19. // The first header forms the basis for the set of attributes that are shared
  20. // across the constituent parts.
  21. //
  22. // Parameters
  23. // headers - pointer to array of headers; one for each part of the image file
  24. // parts - count of number of parts
  25. // overrideSharedAttributes - toggle for the handling of shared attributes.
  26. // set false to check for inconsistencies, true
  27. // to copy the values over from the first header.
  28. // numThreads - number of threads that should be used in encoding the data.
  29. //
  30. class IMF_EXPORT_TYPE MultiPartOutputFile : public GenericOutputFile
  31. {
  32. public:
  33. IMF_EXPORT
  34. MultiPartOutputFile(const char fileName[],
  35. const Header * headers,
  36. int parts,
  37. bool overrideSharedAttributes = false,
  38. int numThreads = globalThreadCount());
  39. IMF_EXPORT
  40. MultiPartOutputFile(OStream & os,
  41. const Header * headers,
  42. int parts,
  43. bool overrideSharedAttributes = false,
  44. int numThreads = globalThreadCount());
  45. //
  46. // return number of parts in file
  47. //
  48. IMF_EXPORT
  49. int parts() const;
  50. //
  51. // return header for part n
  52. // (note: may have additional attributes compared to that passed to constructor)
  53. //
  54. IMF_EXPORT
  55. const Header & header(int n) const;
  56. IMF_EXPORT
  57. ~MultiPartOutputFile();
  58. MultiPartOutputFile(const MultiPartOutputFile& other) = delete;
  59. MultiPartOutputFile& operator = (const MultiPartOutputFile& other) = delete;
  60. MultiPartOutputFile(MultiPartOutputFile&& other) = delete;
  61. MultiPartOutputFile& operator = (MultiPartOutputFile&& other) = delete;
  62. struct IMF_HIDDEN Data;
  63. private:
  64. Data* _data;
  65. template<class T> IMF_HIDDEN T* getOutputPart(int partNumber);
  66. friend class OutputPart;
  67. friend class TiledOutputPart;
  68. friend class DeepScanLineOutputPart;
  69. friend class DeepTiledOutputPart;
  70. };
  71. OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
  72. #endif /* MULTIPARTOUTPUTFILE_H_ */