ImfDeepTiledInputPart.cpp 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  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 "ImfDeepTiledInputPart.h"
  35. #include "ImfMultiPartInputFile.h"
  36. #include "ImfNamespace.h"
  37. OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER
  38. DeepTiledInputPart::DeepTiledInputPart(MultiPartInputFile& multiPartFile, int partNumber)
  39. {
  40. file = multiPartFile.getInputPart<DeepTiledInputFile>(partNumber);
  41. }
  42. const char *
  43. DeepTiledInputPart::fileName () const
  44. {
  45. return file->fileName();
  46. }
  47. const Header &
  48. DeepTiledInputPart::header () const
  49. {
  50. return file->header();
  51. }
  52. int
  53. DeepTiledInputPart::version () const
  54. {
  55. return file->version();
  56. }
  57. void
  58. DeepTiledInputPart::setFrameBuffer (const DeepFrameBuffer &frameBuffer)
  59. {
  60. file->setFrameBuffer(frameBuffer);
  61. }
  62. const DeepFrameBuffer &
  63. DeepTiledInputPart::frameBuffer () const
  64. {
  65. return file->frameBuffer();
  66. }
  67. bool
  68. DeepTiledInputPart::isComplete () const
  69. {
  70. return file->isComplete();
  71. }
  72. unsigned int
  73. DeepTiledInputPart::tileXSize () const
  74. {
  75. return file->tileXSize();
  76. }
  77. unsigned int
  78. DeepTiledInputPart::tileYSize () const
  79. {
  80. return file->tileYSize();
  81. }
  82. LevelMode
  83. DeepTiledInputPart::levelMode () const
  84. {
  85. return file->levelMode();
  86. }
  87. LevelRoundingMode
  88. DeepTiledInputPart::levelRoundingMode () const
  89. {
  90. return file->levelRoundingMode();
  91. }
  92. int
  93. DeepTiledInputPart::numLevels () const
  94. {
  95. return file->numLevels();
  96. }
  97. int
  98. DeepTiledInputPart::numXLevels () const
  99. {
  100. return file->numXLevels();
  101. }
  102. int
  103. DeepTiledInputPart::numYLevels () const
  104. {
  105. return file->numYLevels();
  106. }
  107. bool
  108. DeepTiledInputPart::isValidLevel (int lx, int ly) const
  109. {
  110. return file->isValidLevel(lx, ly);
  111. }
  112. int
  113. DeepTiledInputPart::levelWidth (int lx) const
  114. {
  115. return file->levelWidth(lx);
  116. }
  117. int
  118. DeepTiledInputPart::levelHeight (int ly) const
  119. {
  120. return file->levelHeight(ly);
  121. }
  122. int
  123. DeepTiledInputPart::numXTiles (int lx) const
  124. {
  125. return file->numXTiles(lx);
  126. }
  127. int
  128. DeepTiledInputPart::numYTiles (int ly) const
  129. {
  130. return file->numYTiles(ly);
  131. }
  132. IMATH_NAMESPACE::Box2i
  133. DeepTiledInputPart::dataWindowForLevel (int l) const
  134. {
  135. return file->dataWindowForLevel(l);
  136. }
  137. IMATH_NAMESPACE::Box2i
  138. DeepTiledInputPart::dataWindowForLevel (int lx, int ly) const
  139. {
  140. return file->dataWindowForLevel(lx, ly);
  141. }
  142. IMATH_NAMESPACE::Box2i
  143. DeepTiledInputPart::dataWindowForTile (int dx, int dy, int l) const
  144. {
  145. return file->dataWindowForTile(dx, dy, l);
  146. }
  147. IMATH_NAMESPACE::Box2i
  148. DeepTiledInputPart::dataWindowForTile (int dx, int dy,
  149. int lx, int ly) const
  150. {
  151. return file->dataWindowForTile(dx, dy, lx, ly);
  152. }
  153. void
  154. DeepTiledInputPart::readTile (int dx, int dy, int l)
  155. {
  156. file->readTile(dx, dy, l);
  157. }
  158. void
  159. DeepTiledInputPart::readTile (int dx, int dy, int lx, int ly)
  160. {
  161. file->readTile(dx, dy, lx, ly);
  162. }
  163. void
  164. DeepTiledInputPart::readTiles (int dx1, int dx2, int dy1, int dy2,
  165. int lx, int ly)
  166. {
  167. file->readTiles(dx1, dx2, dy1, dy2, lx, ly);
  168. }
  169. void
  170. DeepTiledInputPart::readTiles (int dx1, int dx2, int dy1, int dy2,
  171. int l)
  172. {
  173. file->readTiles(dx1, dx2, dy1, dy2, l);
  174. }
  175. void
  176. DeepTiledInputPart::rawTileData (int &dx, int &dy,
  177. int &lx, int &ly,
  178. char * pixelData,
  179. Int64 & dataSize) const
  180. {
  181. file->rawTileData(dx, dy, lx, ly, pixelData, dataSize );
  182. }
  183. void
  184. DeepTiledInputPart::readPixelSampleCount (int dx, int dy, int l)
  185. {
  186. file->readPixelSampleCount(dx, dy, l);
  187. }
  188. void
  189. DeepTiledInputPart::readPixelSampleCount (int dx, int dy, int lx, int ly)
  190. {
  191. file->readPixelSampleCount(dx, dy, lx, ly);
  192. }
  193. void
  194. DeepTiledInputPart::readPixelSampleCounts (int dx1, int dx2,
  195. int dy1, int dy2,
  196. int lx, int ly)
  197. {
  198. file->readPixelSampleCounts(dx1, dx2, dy1, dy2, lx, ly);
  199. }
  200. void
  201. DeepTiledInputPart::readPixelSampleCounts (int dx1, int dx2,
  202. int dy1, int dy2,
  203. int l)
  204. {
  205. file->readPixelSampleCounts(dx1, dx2, dy1, dy2, l);
  206. }
  207. OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_EXIT