ImfDeepTiledOutputPart.cpp 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. ///////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2011, Industrial Light & Magic, a division of Lucas
  4. // Digital Ltd. LLC
  5. //
  6. // All rights reserved.
  7. //
  8. // Redistribution and use in source and binary forms, with or without
  9. // modification, are permitted provided that the following conditions are
  10. // met:
  11. // * Redistributions of source code must retain the above copyright
  12. // notice, this list of conditions and the following disclaimer.
  13. // * Redistributions in binary form must reproduce the above
  14. // copyright notice, this list of conditions and the following disclaimer
  15. // in the documentation and/or other materials provided with the
  16. // distribution.
  17. // * Neither the name of Industrial Light & Magic nor the names of
  18. // its contributors may be used to endorse or promote products derived
  19. // from this software without specific prior written permission.
  20. //
  21. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  25. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  26. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  27. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  28. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  29. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  30. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  31. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. //
  33. ///////////////////////////////////////////////////////////////////////////
  34. #include "ImfDeepTiledOutputPart.h"
  35. #include "ImfMultiPartOutputFile.h"
  36. #include "ImfNamespace.h"
  37. OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER
  38. DeepTiledOutputPart::DeepTiledOutputPart(MultiPartOutputFile& multiPartFile, int partNumber)
  39. {
  40. file = multiPartFile.getOutputPart<DeepTiledOutputFile>(partNumber);
  41. }
  42. const char *
  43. DeepTiledOutputPart::fileName () const
  44. {
  45. return file->fileName();
  46. }
  47. const Header &
  48. DeepTiledOutputPart::header () const
  49. {
  50. return file->header();
  51. }
  52. void
  53. DeepTiledOutputPart::setFrameBuffer (const DeepFrameBuffer &frameBuffer)
  54. {
  55. file->setFrameBuffer(frameBuffer);
  56. }
  57. const DeepFrameBuffer &
  58. DeepTiledOutputPart::frameBuffer () const
  59. {
  60. return file->frameBuffer();
  61. }
  62. unsigned int
  63. DeepTiledOutputPart::tileXSize () const
  64. {
  65. return file->tileXSize();
  66. }
  67. unsigned int
  68. DeepTiledOutputPart::tileYSize () const
  69. {
  70. return file->tileYSize();
  71. }
  72. LevelMode
  73. DeepTiledOutputPart::levelMode () const
  74. {
  75. return file->levelMode();
  76. }
  77. LevelRoundingMode
  78. DeepTiledOutputPart::levelRoundingMode () const
  79. {
  80. return file->levelRoundingMode();
  81. }
  82. int
  83. DeepTiledOutputPart::numLevels () const
  84. {
  85. return file->numLevels();
  86. }
  87. int
  88. DeepTiledOutputPart::numXLevels () const
  89. {
  90. return file->numXLevels();
  91. }
  92. int
  93. DeepTiledOutputPart::numYLevels () const
  94. {
  95. return file->numYLevels();
  96. }
  97. bool
  98. DeepTiledOutputPart::isValidLevel (int lx, int ly) const
  99. {
  100. return file->isValidLevel(lx, ly);
  101. }
  102. int
  103. DeepTiledOutputPart::levelWidth (int lx) const
  104. {
  105. return file->levelWidth(lx);
  106. }
  107. int
  108. DeepTiledOutputPart::levelHeight (int ly) const
  109. {
  110. return file->levelHeight(ly);
  111. }
  112. int
  113. DeepTiledOutputPart::numXTiles (int lx) const
  114. {
  115. return file->numXTiles(lx);
  116. }
  117. int
  118. DeepTiledOutputPart::numYTiles (int ly) const
  119. {
  120. return file->numYTiles(ly);
  121. }
  122. IMATH_NAMESPACE::Box2i
  123. DeepTiledOutputPart::dataWindowForLevel (int l) const
  124. {
  125. return file->dataWindowForLevel(l);
  126. }
  127. IMATH_NAMESPACE::Box2i
  128. DeepTiledOutputPart::dataWindowForLevel (int lx, int ly) const
  129. {
  130. return file->dataWindowForLevel(lx, ly);
  131. }
  132. IMATH_NAMESPACE::Box2i
  133. DeepTiledOutputPart::dataWindowForTile (int dx, int dy,
  134. int l) const
  135. {
  136. return file->dataWindowForTile(dx, dy, l);
  137. }
  138. IMATH_NAMESPACE::Box2i
  139. DeepTiledOutputPart::dataWindowForTile (int dx, int dy,
  140. int lx, int ly) const
  141. {
  142. return file->dataWindowForTile(dx, dy, lx, ly);
  143. }
  144. void
  145. DeepTiledOutputPart::writeTile (int dx, int dy, int l)
  146. {
  147. file->writeTile(dx, dy, l);
  148. }
  149. void
  150. DeepTiledOutputPart::writeTile (int dx, int dy, int lx, int ly)
  151. {
  152. file->writeTile(dx, dy, lx, ly);
  153. }
  154. void
  155. DeepTiledOutputPart::writeTiles (int dx1, int dx2, int dy1, int dy2,
  156. int lx, int ly)
  157. {
  158. file->writeTiles(dx1, dx2, dy1, dy2, lx, ly);
  159. }
  160. void
  161. DeepTiledOutputPart::writeTiles (int dx1, int dx2, int dy1, int dy2,
  162. int l)
  163. {
  164. file->writeTiles(dx1, dx2, dy1, dy2, l);
  165. }
  166. void
  167. DeepTiledOutputPart::copyPixels (DeepTiledInputFile &in)
  168. {
  169. file->copyPixels(in);
  170. }
  171. void
  172. DeepTiledOutputPart::copyPixels (DeepTiledInputPart &in)
  173. {
  174. file->copyPixels(in);
  175. }
  176. void
  177. DeepTiledOutputPart::updatePreviewImage (const PreviewRgba newPixels[])
  178. {
  179. file->updatePreviewImage(newPixels);
  180. }
  181. void
  182. DeepTiledOutputPart::breakTile (int dx, int dy,
  183. int lx, int ly,
  184. int offset,
  185. int length,
  186. char c)
  187. {
  188. file->breakTile(dx, dy, lx, ly, offset, length, c);
  189. }
  190. OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_EXIT