ImfTiledOutputPart.cpp 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  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 "ImfTiledOutputPart.h"
  35. #include "ImfNamespace.h"
  36. OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER
  37. TiledOutputPart::TiledOutputPart(MultiPartOutputFile& multiPartFile, int partNumber)
  38. {
  39. file = multiPartFile.getOutputPart<TiledOutputFile>(partNumber);
  40. }
  41. const char *
  42. TiledOutputPart::fileName () const
  43. {
  44. return file->fileName();
  45. }
  46. const Header &
  47. TiledOutputPart::header () const
  48. {
  49. return file->header();
  50. }
  51. void
  52. TiledOutputPart::setFrameBuffer (const FrameBuffer &frameBuffer)
  53. {
  54. file->setFrameBuffer(frameBuffer);
  55. }
  56. const FrameBuffer &
  57. TiledOutputPart::frameBuffer () const
  58. {
  59. return file->frameBuffer();
  60. }
  61. unsigned int
  62. TiledOutputPart::tileXSize () const
  63. {
  64. return file->tileXSize();
  65. }
  66. unsigned int
  67. TiledOutputPart::tileYSize () const
  68. {
  69. return file->tileYSize();
  70. }
  71. LevelMode
  72. TiledOutputPart::levelMode () const
  73. {
  74. return file->levelMode();
  75. }
  76. LevelRoundingMode
  77. TiledOutputPart::levelRoundingMode () const
  78. {
  79. return file->levelRoundingMode();
  80. }
  81. int
  82. TiledOutputPart::numLevels () const
  83. {
  84. return file->numLevels();
  85. }
  86. int
  87. TiledOutputPart::numXLevels () const
  88. {
  89. return file->numXLevels();
  90. }
  91. int
  92. TiledOutputPart::numYLevels () const
  93. {
  94. return file->numYLevels();
  95. }
  96. bool
  97. TiledOutputPart::isValidLevel (int lx, int ly) const
  98. {
  99. return file->isValidLevel(lx, ly);
  100. }
  101. int
  102. TiledOutputPart::levelWidth (int lx) const
  103. {
  104. return file->levelWidth(lx);
  105. }
  106. int
  107. TiledOutputPart::levelHeight (int ly) const
  108. {
  109. return file->levelHeight(ly);
  110. }
  111. int
  112. TiledOutputPart::numXTiles (int lx) const
  113. {
  114. return file->numXTiles(lx);
  115. }
  116. int
  117. TiledOutputPart::numYTiles (int ly) const
  118. {
  119. return file->numYTiles(ly);
  120. }
  121. IMATH_NAMESPACE::Box2i
  122. TiledOutputPart::dataWindowForLevel (int l) const
  123. {
  124. return file->dataWindowForLevel(l);
  125. }
  126. IMATH_NAMESPACE::Box2i
  127. TiledOutputPart::dataWindowForLevel (int lx, int ly) const
  128. {
  129. return file->dataWindowForLevel(lx, ly);
  130. }
  131. IMATH_NAMESPACE::Box2i
  132. TiledOutputPart::dataWindowForTile (int dx, int dy, int l) const
  133. {
  134. return file->dataWindowForTile(dx, dy, l);
  135. }
  136. IMATH_NAMESPACE::Box2i
  137. TiledOutputPart::dataWindowForTile (int dx, int dy, int lx, int ly) const
  138. {
  139. return file->dataWindowForTile(dx, dy, lx, ly);
  140. }
  141. void
  142. TiledOutputPart::writeTile (int dx, int dy, int l)
  143. {
  144. file->writeTile(dx, dy, l);
  145. }
  146. void
  147. TiledOutputPart::writeTile (int dx, int dy, int lx, int ly)
  148. {
  149. file->writeTile(dx, dy, lx, ly);
  150. }
  151. void
  152. TiledOutputPart::writeTiles (int dx1, int dx2, int dy1, int dy2, int lx, int ly)
  153. {
  154. file->writeTiles(dx1, dx2, dy1, dy2, lx, ly);
  155. }
  156. void
  157. TiledOutputPart::writeTiles (int dx1, int dx2, int dy1, int dy2, int l)
  158. {
  159. file->writeTiles(dx1, dx2, dy1, dy2, l);
  160. }
  161. void
  162. TiledOutputPart::copyPixels (TiledInputFile &in)
  163. {
  164. file->copyPixels(in);
  165. }
  166. void
  167. TiledOutputPart::copyPixels (InputFile &in)
  168. {
  169. file->copyPixels(in);
  170. }
  171. void
  172. TiledOutputPart::copyPixels (TiledInputPart &in)
  173. {
  174. file->copyPixels(in);
  175. }
  176. void
  177. TiledOutputPart::copyPixels (InputPart &in)
  178. {
  179. file->copyPixels(in);
  180. }
  181. void
  182. TiledOutputPart::updatePreviewImage (const PreviewRgba newPixels[])
  183. {
  184. file->updatePreviewImage(newPixels);
  185. }
  186. void
  187. TiledOutputPart::breakTile (int dx, int dy, int lx, int ly, int offset, int length, char c)
  188. {
  189. file->breakTile(dx, dy, lx, ly, offset, length, c);
  190. }
  191. OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_EXIT