/src/FreeImage/Source/OpenEXR/IlmImf/ImfStandardAttributes.h

https://bitbucket.org/cabalistic/ogredeps/ · C++ Header · 343 lines · 49 code · 74 blank · 220 comment · 0 complexity · 078f1049ce8dad9c2d293db6d748a86c MD5 · raw file

  1. ///////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2004, 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. #ifndef INCLUDED_IMF_STANDARD_ATTRIBUTES_H
  35. #define INCLUDED_IMF_STANDARD_ATTRIBUTES_H
  36. //-----------------------------------------------------------------------------
  37. //
  38. // Optional Standard Attributes -- these attributes are "optional"
  39. // because not every image file header has them, but they define a
  40. // "standard" way to represent commonly used data in the file header.
  41. //
  42. // For each attribute, with name "foo", and type "T", the following
  43. // functions are automatically generated via macros:
  44. //
  45. // void addFoo (Header &header, const T &value);
  46. // bool hasFoo (const Header &header);
  47. // const TypedAttribute<T> & fooAttribute (const Header &header);
  48. // TypedAttribute<T> & fooAttribute (Header &header);
  49. // const T & foo (const Header &Header);
  50. // T & foo (Header &Header);
  51. //
  52. //-----------------------------------------------------------------------------
  53. #include <ImfHeader.h>
  54. #include <ImfChromaticitiesAttribute.h>
  55. #include <ImfEnvmapAttribute.h>
  56. #include <ImfFloatAttribute.h>
  57. #include <ImfKeyCodeAttribute.h>
  58. #include <ImfMatrixAttribute.h>
  59. #include <ImfRationalAttribute.h>
  60. #include <ImfStringAttribute.h>
  61. #include <ImfStringVectorAttribute.h>
  62. #include <ImfTimeCodeAttribute.h>
  63. #include <ImfVecAttribute.h>
  64. #define IMF_STD_ATTRIBUTE_DEF(name,suffix,type) \
  65. \
  66. void add##suffix (Header &header, const type &v); \
  67. bool has##suffix (const Header &header); \
  68. const TypedAttribute<type> & name##Attribute (const Header &header); \
  69. TypedAttribute<type> & name##Attribute (Header &header); \
  70. const type & name (const Header &header); \
  71. type & name (Header &header);
  72. namespace Imf {
  73. //
  74. // chromaticities -- for RGB images, specifies the CIE (x,y)
  75. // chromaticities of the primaries and the white point
  76. //
  77. IMF_STD_ATTRIBUTE_DEF (chromaticities, Chromaticities, Chromaticities)
  78. //
  79. // whiteLuminance -- for RGB images, defines the luminance, in Nits
  80. // (candelas per square meter) of the RGB value (1.0, 1.0, 1.0).
  81. //
  82. // If the chromaticities and the whiteLuminance of an RGB image are
  83. // known, then it is possible to convert the image's pixels from RGB
  84. // to CIE XYZ tristimulus values (see function RGBtoXYZ() in header
  85. // file ImfChromaticities.h).
  86. //
  87. //
  88. IMF_STD_ATTRIBUTE_DEF (whiteLuminance, WhiteLuminance, float)
  89. //
  90. // adoptedNeutral -- specifies the CIE (x,y) coordinates that should
  91. // be considered neutral during color rendering. Pixels in the image
  92. // file whose (x,y) coordinates match the adoptedNeutral value should
  93. // be mapped to neutral values on the display.
  94. //
  95. IMF_STD_ATTRIBUTE_DEF (adoptedNeutral, AdoptedNeutral, Imath::V2f)
  96. //
  97. // renderingTransform, lookModTransform -- specify the names of the
  98. // CTL functions that implements the intended color rendering and look
  99. // modification transforms for this image.
  100. //
  101. IMF_STD_ATTRIBUTE_DEF (renderingTransform, RenderingTransform, std::string)
  102. IMF_STD_ATTRIBUTE_DEF (lookModTransform, LookModTransform, std::string)
  103. //
  104. // xDensity -- horizontal output density, in pixels per inch.
  105. // The image's vertical output density is xDensity * pixelAspectRatio.
  106. //
  107. IMF_STD_ATTRIBUTE_DEF (xDensity, XDensity, float)
  108. //
  109. // owner -- name of the owner of the image
  110. //
  111. IMF_STD_ATTRIBUTE_DEF (owner, Owner, std::string)
  112. //
  113. // comments -- additional image information in human-readable
  114. // form, for example a verbal description of the image
  115. //
  116. IMF_STD_ATTRIBUTE_DEF (comments, Comments, std::string)
  117. //
  118. // capDate -- the date when the image was created or captured,
  119. // in local time, and formatted as
  120. //
  121. // YYYY:MM:DD hh:mm:ss
  122. //
  123. // where YYYY is the year (4 digits, e.g. 2003), MM is the month
  124. // (2 digits, 01, 02, ... 12), DD is the day of the month (2 digits,
  125. // 01, 02, ... 31), hh is the hour (2 digits, 00, 01, ... 23), mm
  126. // is the minute, and ss is the second (2 digits, 00, 01, ... 59).
  127. //
  128. //
  129. IMF_STD_ATTRIBUTE_DEF (capDate, CapDate, std::string)
  130. //
  131. // utcOffset -- offset of local time at capDate from
  132. // Universal Coordinated Time (UTC), in seconds:
  133. //
  134. // UTC == local time + utcOffset
  135. //
  136. IMF_STD_ATTRIBUTE_DEF (utcOffset, UtcOffset, float)
  137. //
  138. // longitude, latitude, altitude -- for images of real objects, the
  139. // location where the image was recorded. Longitude and latitude are
  140. // in degrees east of Greenwich and north of the equator. Altitude
  141. // is in meters above sea level. For example, Kathmandu, Nepal is
  142. // at longitude 85.317, latitude 27.717, altitude 1305.
  143. //
  144. IMF_STD_ATTRIBUTE_DEF (longitude, Longitude, float)
  145. IMF_STD_ATTRIBUTE_DEF (latitude, Latitude, float)
  146. IMF_STD_ATTRIBUTE_DEF (altitude, Altitude, float)
  147. //
  148. // focus -- the camera's focus distance, in meters
  149. //
  150. IMF_STD_ATTRIBUTE_DEF (focus, Focus, float)
  151. //
  152. // exposure -- exposure time, in seconds
  153. //
  154. IMF_STD_ATTRIBUTE_DEF (expTime, ExpTime, float)
  155. //
  156. // aperture -- the camera's lens aperture, in f-stops (focal length
  157. // of the lens divided by the diameter of the iris opening)
  158. //
  159. IMF_STD_ATTRIBUTE_DEF (aperture, Aperture, float)
  160. //
  161. // isoSpeed -- the ISO speed of the film or image sensor
  162. // that was used to record the image
  163. //
  164. IMF_STD_ATTRIBUTE_DEF (isoSpeed, IsoSpeed, float)
  165. //
  166. // envmap -- if this attribute is present, the image represents
  167. // an environment map. The attribute's value defines how 3D
  168. // directions are mapped to 2D pixel locations. For details
  169. // see header file ImfEnvmap.h
  170. //
  171. IMF_STD_ATTRIBUTE_DEF (envmap, Envmap, Envmap)
  172. //
  173. // keyCode -- for motion picture film frames. Identifies film
  174. // manufacturer, film type, film roll and frame position within
  175. // the roll.
  176. //
  177. IMF_STD_ATTRIBUTE_DEF (keyCode, KeyCode, KeyCode)
  178. //
  179. // timeCode -- time and control code
  180. //
  181. IMF_STD_ATTRIBUTE_DEF (timeCode, TimeCode, TimeCode)
  182. //
  183. // wrapmodes -- determines how texture map images are extrapolated.
  184. // If an OpenEXR file is used as a texture map for 3D rendering,
  185. // texture coordinates (0.0, 0.0) and (1.0, 1.0) correspond to
  186. // the upper left and lower right corners of the data window.
  187. // If the image is mapped onto a surface with texture coordinates
  188. // outside the zero-to-one range, then the image must be extrapolated.
  189. // This attribute tells the renderer how to do this extrapolation.
  190. // The attribute contains either a pair of comma-separated keywords,
  191. // to specify separate extrapolation modes for the horizontal and
  192. // vertical directions; or a single keyword, to specify extrapolation
  193. // in both directions (e.g. "clamp,periodic" or "clamp"). Extra white
  194. // space surrounding the keywords is allowed, but should be ignored
  195. // by the renderer ("clamp, black " is equivalent to "clamp,black").
  196. // The keywords listed below are predefined; some renderers may support
  197. // additional extrapolation modes:
  198. //
  199. // black pixels outside the zero-to-one range are black
  200. //
  201. // clamp texture coordinates less than 0.0 and greater
  202. // than 1.0 are clamped to 0.0 and 1.0 respectively
  203. //
  204. // periodic the texture image repeats periodically
  205. //
  206. // mirror the texture image repeats periodically, but
  207. // every other instance is mirrored
  208. //
  209. IMF_STD_ATTRIBUTE_DEF (wrapmodes, Wrapmodes, std::string)
  210. //
  211. // framesPerSecond -- defines the nominal playback frame rate for image
  212. // sequences, in frames per second. Every image in a sequence should
  213. // have a framesPerSecond attribute, and the attribute value should be
  214. // the same for all images in the sequence. If an image sequence has
  215. // no framesPerSecond attribute, playback software should assume that
  216. // the frame rate for the sequence is 24 frames per second.
  217. //
  218. // In order to allow exact representation of NTSC frame and field rates,
  219. // framesPerSecond is stored as a rational number. A rational number is
  220. // a pair of integers, n and d, that represents the value n/d.
  221. //
  222. // For the exact values of commonly used frame rates, please see header
  223. // file ImfFramesPerSecond.h.
  224. //
  225. IMF_STD_ATTRIBUTE_DEF (framesPerSecond, FramesPerSecond, Rational)
  226. //
  227. // multiView -- defines the view names for multi-view image files.
  228. // A multi-view image contains two or more views of the same scene,
  229. // as seen from different viewpoints, for example a left-eye and
  230. // a right-eye view for stereo displays. The multiView attribute
  231. // lists the names of the views in an image, and a naming convention
  232. // identifies the channels that belong to each view.
  233. //
  234. // For details, please see header file ImfMultiView.h
  235. //
  236. IMF_STD_ATTRIBUTE_DEF (multiView , MultiView, StringVector)
  237. //
  238. // worldToCamera -- for images generated by 3D computer graphics rendering,
  239. // a matrix that transforms 3D points from the world to the camera coordinate
  240. // space of the renderer.
  241. //
  242. // The camera coordinate space is left-handed. Its origin indicates the
  243. // location of the camera. The positive x and y axes correspond to the
  244. // "right" and "up" directions in the rendered image. The positive z
  245. // axis indicates the camera's viewing direction. (Objects in front of
  246. // the camera have positive z coordinates.)
  247. //
  248. // Camera coordinate space in OpenEXR is the same as in Pixar's Renderman.
  249. //
  250. IMF_STD_ATTRIBUTE_DEF (worldToCamera, WorldToCamera, Imath::M44f)
  251. //
  252. // worldToNDC -- for images generated by 3D computer graphics rendering, a
  253. // matrix that transforms 3D points from the world to the Normalized Device
  254. // Coordinate (NDC) space of the renderer.
  255. //
  256. // NDC is a 2D coordinate space that corresponds to the image plane, with
  257. // positive x and pointing to the right and y positive pointing down. The
  258. // coordinates (0, 0) and (1, 1) correspond to the upper left and lower right
  259. // corners of the OpenEXR display window.
  260. //
  261. // To transform a 3D point in word space into a 2D point in NDC space,
  262. // multiply the 3D point by the worldToNDC matrix and discard the z
  263. // coordinate.
  264. //
  265. // NDC space in OpenEXR is the same as in Pixar's Renderman.
  266. //
  267. IMF_STD_ATTRIBUTE_DEF (worldToNDC, WorldToNDC, Imath::M44f)
  268. } // namespace Imf
  269. #endif