Blame IlmImf/ImfStandardAttributes.h

Packit 0d464f
///////////////////////////////////////////////////////////////////////////
Packit 0d464f
//
Packit 0d464f
// Copyright (c) 2004, Industrial Light & Magic, a division of Lucas
Packit 0d464f
// Digital Ltd. LLC
Packit 0d464f
// 
Packit 0d464f
// All rights reserved.
Packit 0d464f
// 
Packit 0d464f
// Redistribution and use in source and binary forms, with or without
Packit 0d464f
// modification, are permitted provided that the following conditions are
Packit 0d464f
// met:
Packit 0d464f
// *       Redistributions of source code must retain the above copyright
Packit 0d464f
// notice, this list of conditions and the following disclaimer.
Packit 0d464f
// *       Redistributions in binary form must reproduce the above
Packit 0d464f
// copyright notice, this list of conditions and the following disclaimer
Packit 0d464f
// in the documentation and/or other materials provided with the
Packit 0d464f
// distribution.
Packit 0d464f
// *       Neither the name of Industrial Light & Magic nor the names of
Packit 0d464f
// its contributors may be used to endorse or promote products derived
Packit 0d464f
// from this software without specific prior written permission. 
Packit 0d464f
// 
Packit 0d464f
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
Packit 0d464f
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Packit 0d464f
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
Packit 0d464f
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
Packit 0d464f
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
Packit 0d464f
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
Packit 0d464f
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
Packit 0d464f
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
Packit 0d464f
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
Packit 0d464f
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Packit 0d464f
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit 0d464f
//
Packit 0d464f
///////////////////////////////////////////////////////////////////////////
Packit 0d464f
Packit 0d464f
Packit 0d464f
#ifndef INCLUDED_IMF_STANDARD_ATTRIBUTES_H
Packit 0d464f
#define INCLUDED_IMF_STANDARD_ATTRIBUTES_H
Packit 0d464f
Packit 0d464f
//-----------------------------------------------------------------------------
Packit 0d464f
//
Packit 0d464f
//	Optional Standard Attributes -- these attributes are "optional"
Packit 0d464f
//	because not every image file header has them, but they define a
Packit 0d464f
//	"standard" way to represent commonly used data in the file header.
Packit 0d464f
//
Packit 0d464f
//	For each attribute, with name "foo", and type "T", the following
Packit 0d464f
//	functions are automatically generated via macros:
Packit 0d464f
//
Packit 0d464f
//	void			   addFoo (Header &header, const T &value);
Packit 0d464f
//	bool			   hasFoo (const Header &header);
Packit 0d464f
//	const TypedAttribute<T> &  fooAttribute (const Header &header);
Packit 0d464f
//	TypedAttribute<T> &	   fooAttribute (Header &header);
Packit 0d464f
//	const T &		   foo (const Header &Header);
Packit 0d464f
//	T &			   foo (Header &Header);
Packit 0d464f
//
Packit 0d464f
//-----------------------------------------------------------------------------
Packit 0d464f
Packit 0d464f
#include "ImfHeader.h"
Packit 0d464f
#include "ImfBoxAttribute.h"
Packit 0d464f
#include "ImfChromaticitiesAttribute.h"
Packit 0d464f
#include "ImfEnvmapAttribute.h"
Packit 0d464f
#include "ImfDeepImageStateAttribute.h"
Packit 0d464f
#include "ImfFloatAttribute.h"
Packit 0d464f
#include "ImfKeyCodeAttribute.h"
Packit 0d464f
#include "ImfMatrixAttribute.h"
Packit 0d464f
#include "ImfRationalAttribute.h"
Packit 0d464f
#include "ImfStringAttribute.h"
Packit 0d464f
#include "ImfStringVectorAttribute.h"
Packit 0d464f
#include "ImfTimeCodeAttribute.h"
Packit 0d464f
#include "ImfVecAttribute.h"
Packit 0d464f
#include "ImfNamespace.h"
Packit 0d464f
#include "ImfExport.h"
Packit 0d464f
Packit 0d464f
#define IMF_STD_ATTRIBUTE_DEF(name,suffix,object)                            \
Packit 0d464f
                                                                             \
Packit 0d464f
    OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER                              \
Packit 0d464f
    IMF_EXPORT void           add##suffix (Header &header, const object &v); \
Packit 0d464f
    IMF_EXPORT bool           has##suffix (const Header &header);            \
Packit 0d464f
    IMF_EXPORT const TypedAttribute<object> &                                \
Packit 0d464f
                              name##Attribute (const Header &header);        \
Packit 0d464f
    IMF_EXPORT TypedAttribute<object> &                                      \
Packit 0d464f
                              name##Attribute (Header &header);              \
Packit 0d464f
    IMF_EXPORT const object &                                                \
Packit 0d464f
                              name (const Header &header);                   \
Packit 0d464f
    IMF_EXPORT object &       name (Header &header);                         \
Packit 0d464f
    OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT                               \
Packit 0d464f
Packit 0d464f
//
Packit 0d464f
// chromaticities -- for RGB images, specifies the CIE (x,y)
Packit 0d464f
// chromaticities of the primaries and the white point
Packit 0d464f
//
Packit 0d464f
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (chromaticities, Chromaticities, Chromaticities)
Packit 0d464f
Packit 0d464f
Packit 0d464f
//
Packit 0d464f
// whiteLuminance -- for RGB images, defines the luminance, in Nits
Packit 0d464f
// (candelas per square meter) of the RGB value (1.0, 1.0, 1.0).
Packit 0d464f
//
Packit 0d464f
// If the chromaticities and the whiteLuminance of an RGB image are
Packit 0d464f
// known, then it is possible to convert the image's pixels from RGB
Packit 0d464f
// to CIE XYZ tristimulus values (see function RGBtoXYZ() in header
Packit 0d464f
// file ImfChromaticities.h).
Packit 0d464f
// 
Packit 0d464f
//
Packit 0d464f
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (whiteLuminance, WhiteLuminance, float)
Packit 0d464f
Packit 0d464f
Packit 0d464f
//
Packit 0d464f
// adoptedNeutral -- specifies the CIE (x,y) coordinates that should
Packit 0d464f
// be considered neutral during color rendering.  Pixels in the image
Packit 0d464f
// file whose (x,y) coordinates match the adoptedNeutral value should
Packit 0d464f
// be mapped to neutral values on the display.
Packit 0d464f
//
Packit 0d464f
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (adoptedNeutral, AdoptedNeutral, IMATH_NAMESPACE::V2f)
Packit 0d464f
Packit 0d464f
Packit 0d464f
//
Packit 0d464f
// renderingTransform, lookModTransform -- specify the names of the
Packit 0d464f
// CTL functions that implements the intended color rendering and look
Packit 0d464f
// modification transforms for this image.
Packit 0d464f
// 
Packit 0d464f
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (renderingTransform, RenderingTransform, std::string)
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (lookModTransform, LookModTransform, std::string)
Packit 0d464f
Packit 0d464f
Packit 0d464f
//
Packit 0d464f
// xDensity -- horizontal output density, in pixels per inch.
Packit 0d464f
// The image's vertical output density is xDensity * pixelAspectRatio.
Packit 0d464f
//
Packit 0d464f
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (xDensity, XDensity, float)
Packit 0d464f
Packit 0d464f
Packit 0d464f
//
Packit 0d464f
// owner -- name of the owner of the image
Packit 0d464f
//
Packit 0d464f
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (owner, Owner, std::string)
Packit 0d464f
   
Packit 0d464f
Packit 0d464f
//
Packit 0d464f
// comments -- additional image information in human-readable
Packit 0d464f
// form, for example a verbal description of the image
Packit 0d464f
//
Packit 0d464f
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (comments, Comments, std::string)
Packit 0d464f
Packit 0d464f
Packit 0d464f
//
Packit 0d464f
// capDate -- the date when the image was created or captured,
Packit 0d464f
// in local time, and formatted as
Packit 0d464f
//
Packit 0d464f
//    YYYY:MM:DD hh:mm:ss
Packit 0d464f
//
Packit 0d464f
// where YYYY is the year (4 digits, e.g. 2003), MM is the month
Packit 0d464f
// (2 digits, 01, 02, ... 12), DD is the day of the month (2 digits,
Packit 0d464f
// 01, 02, ... 31), hh is the hour (2 digits, 00, 01, ... 23), mm
Packit 0d464f
// is the minute, and ss is the second (2 digits, 00, 01, ... 59).
Packit 0d464f
//
Packit 0d464f
//
Packit 0d464f
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (capDate, CapDate, std::string)
Packit 0d464f
Packit 0d464f
Packit 0d464f
//
Packit 0d464f
// utcOffset -- offset of local time at capDate from
Packit 0d464f
// Universal Coordinated Time (UTC), in seconds:
Packit 0d464f
//
Packit 0d464f
//    UTC == local time + utcOffset
Packit 0d464f
//
Packit 0d464f
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (utcOffset, UtcOffset, float)
Packit 0d464f
Packit 0d464f
Packit 0d464f
//
Packit 0d464f
// longitude, latitude, altitude -- for images of real objects, the
Packit 0d464f
// location where the image was recorded.  Longitude and latitude are
Packit 0d464f
// in degrees east of Greenwich and north of the equator.  Altitude
Packit 0d464f
// is in meters above sea level.  For example, Kathmandu, Nepal is
Packit 0d464f
// at longitude 85.317, latitude 27.717, altitude 1305.
Packit 0d464f
//
Packit 0d464f
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (longitude, Longitude, float)
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (latitude, Latitude, float)
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (altitude, Altitude, float)
Packit 0d464f
Packit 0d464f
Packit 0d464f
//
Packit 0d464f
// focus -- the camera's focus distance, in meters
Packit 0d464f
//
Packit 0d464f
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (focus, Focus, float)
Packit 0d464f
Packit 0d464f
Packit 0d464f
//
Packit 0d464f
// exposure -- exposure time, in seconds
Packit 0d464f
//
Packit 0d464f
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (expTime, ExpTime, float)
Packit 0d464f
Packit 0d464f
Packit 0d464f
//
Packit 0d464f
// aperture -- the camera's lens aperture, in f-stops (focal length
Packit 0d464f
// of the lens divided by the diameter of the iris opening)
Packit 0d464f
//
Packit 0d464f
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (aperture, Aperture, float)
Packit 0d464f
Packit 0d464f
Packit 0d464f
//
Packit 0d464f
// isoSpeed -- the ISO speed of the film or image sensor
Packit 0d464f
// that was used to record the image
Packit 0d464f
//
Packit 0d464f
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (isoSpeed, IsoSpeed, float)
Packit 0d464f
Packit 0d464f
Packit 0d464f
//
Packit 0d464f
// envmap -- if this attribute is present, the image represents
Packit 0d464f
// an environment map.  The attribute's value defines how 3D
Packit 0d464f
// directions are mapped to 2D pixel locations.  For details
Packit 0d464f
// see header file ImfEnvmap.h
Packit 0d464f
//
Packit 0d464f
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (envmap, Envmap, Envmap)
Packit 0d464f
Packit 0d464f
Packit 0d464f
//
Packit 0d464f
// keyCode -- for motion picture film frames.  Identifies film
Packit 0d464f
// manufacturer, film type, film roll and frame position within
Packit 0d464f
// the roll.
Packit 0d464f
//
Packit 0d464f
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (keyCode, KeyCode, KeyCode)
Packit 0d464f
Packit 0d464f
Packit 0d464f
//
Packit 0d464f
// timeCode -- time and control code
Packit 0d464f
//
Packit 0d464f
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (timeCode, TimeCode, TimeCode)
Packit 0d464f
Packit 0d464f
Packit 0d464f
//
Packit 0d464f
// wrapmodes -- determines how texture map images are extrapolated.
Packit 0d464f
// If an OpenEXR file is used as a texture map for 3D rendering,
Packit 0d464f
// texture coordinates (0.0, 0.0) and (1.0, 1.0) correspond to
Packit 0d464f
// the upper left and lower right corners of the data window.
Packit 0d464f
// If the image is mapped onto a surface with texture coordinates
Packit 0d464f
// outside the zero-to-one range, then the image must be extrapolated.
Packit 0d464f
// This attribute tells the renderer how to do this extrapolation.
Packit 0d464f
// The attribute contains either a pair of comma-separated keywords,
Packit 0d464f
// to specify separate extrapolation modes for the horizontal and
Packit 0d464f
// vertical directions; or a single keyword, to specify extrapolation
Packit 0d464f
// in both directions (e.g. "clamp,periodic" or "clamp").  Extra white
Packit 0d464f
// space surrounding the keywords is allowed, but should be ignored
Packit 0d464f
// by the renderer ("clamp, black " is equivalent to "clamp,black").
Packit 0d464f
// The keywords listed below are predefined; some renderers may support
Packit 0d464f
// additional extrapolation modes:
Packit 0d464f
//
Packit 0d464f
//	black		pixels outside the zero-to-one range are black
Packit 0d464f
//
Packit 0d464f
//	clamp		texture coordinates less than 0.0 and greater
Packit 0d464f
//			than 1.0 are clamped to 0.0 and 1.0 respectively
Packit 0d464f
//
Packit 0d464f
//	periodic	the texture image repeats periodically
Packit 0d464f
//
Packit 0d464f
//	mirror		the texture image repeats periodically, but
Packit 0d464f
//			every other instance is mirrored
Packit 0d464f
//
Packit 0d464f
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (wrapmodes, Wrapmodes, std::string)
Packit 0d464f
Packit 0d464f
Packit 0d464f
//
Packit 0d464f
// framesPerSecond -- defines the nominal playback frame rate for image
Packit 0d464f
// sequences, in frames per second.  Every image in a sequence should
Packit 0d464f
// have a framesPerSecond attribute, and the attribute value should be
Packit 0d464f
// the same for all images in the sequence.  If an image sequence has
Packit 0d464f
// no framesPerSecond attribute, playback software should assume that
Packit 0d464f
// the frame rate for the sequence is 24 frames per second.
Packit 0d464f
//
Packit 0d464f
// In order to allow exact representation of NTSC frame and field rates,
Packit 0d464f
// framesPerSecond is stored as a rational number.  A rational number is
Packit 0d464f
// a pair of integers, n and d, that represents the value n/d.
Packit 0d464f
//
Packit 0d464f
// For the exact values of commonly used frame rates, please see header
Packit 0d464f
// file ImfFramesPerSecond.h.
Packit 0d464f
//
Packit 0d464f
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (framesPerSecond, FramesPerSecond, Rational)
Packit 0d464f
Packit 0d464f
Packit 0d464f
//
Packit 0d464f
// multiView -- defines the view names for multi-view image files.
Packit 0d464f
// A multi-view image contains two or more views of the same scene,
Packit 0d464f
// as seen from different viewpoints, for example a left-eye and
Packit 0d464f
// a right-eye view for stereo displays.  The multiView attribute
Packit 0d464f
// lists the names of the views in an image, and a naming convention
Packit 0d464f
// identifies the channels that belong to each view.
Packit 0d464f
//
Packit 0d464f
// For details, please see header file ImfMultiView.h
Packit 0d464f
//
Packit 0d464f
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (multiView , MultiView, StringVector)
Packit 0d464f
Packit 0d464f
Packit 0d464f
// 
Packit 0d464f
// worldToCamera -- for images generated by 3D computer graphics rendering,
Packit 0d464f
// a matrix that transforms 3D points from the world to the camera coordinate
Packit 0d464f
// space of the renderer.
Packit 0d464f
// 
Packit 0d464f
// The camera coordinate space is left-handed.  Its origin indicates the
Packit 0d464f
// location of the camera.  The positive x and y axes correspond to the
Packit 0d464f
// "right" and "up" directions in the rendered image.  The positive z
Packit 0d464f
// axis indicates the camera's viewing direction.  (Objects in front of
Packit 0d464f
// the camera have positive z coordinates.)
Packit 0d464f
// 
Packit 0d464f
// Camera coordinate space in OpenEXR is the same as in Pixar's Renderman.
Packit 0d464f
// 
Packit 0d464f
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (worldToCamera, WorldToCamera, IMATH_NAMESPACE::M44f)
Packit 0d464f
Packit 0d464f
Packit 0d464f
// 
Packit 0d464f
// worldToNDC -- for images generated by 3D computer graphics rendering, a
Packit 0d464f
// matrix that transforms 3D points from the world to the Normalized Device
Packit 0d464f
// Coordinate (NDC) space of the renderer.
Packit 0d464f
// 
Packit 0d464f
// NDC is a 2D coordinate space that corresponds to the image plane, with
Packit 0d464f
// positive x and pointing to the right and y positive pointing down.  The
Packit 0d464f
// coordinates (0, 0) and (1, 1) correspond to the upper left and lower right
Packit 0d464f
// corners of the OpenEXR display window.
Packit 0d464f
// 
Packit 0d464f
// To transform a 3D point in word space into a 2D point in NDC space,
Packit 0d464f
// multiply the 3D point by the worldToNDC matrix and discard the z
Packit 0d464f
// coordinate.
Packit 0d464f
// 
Packit 0d464f
// NDC space in OpenEXR is the same as in Pixar's Renderman.
Packit 0d464f
// 
Packit 0d464f
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (worldToNDC, WorldToNDC, IMATH_NAMESPACE::M44f)
Packit 0d464f
Packit 0d464f
Packit 0d464f
//
Packit 0d464f
// deepImageState -- specifies whether the pixels in a deep image are
Packit 0d464f
// sorted and non-overlapping.
Packit 0d464f
//
Packit 0d464f
// Note: this attribute can be set by application code that writes a file
Packit 0d464f
// in order to tell applications that read the file whether the pixel data
Packit 0d464f
// must be cleaned up prior to image processing operations such as flattening. 
Packit 0d464f
// The IlmImf library does not verify that the attribute is consistent with
Packit 0d464f
// the actual state of the pixels.  Application software may assume that the
Packit 0d464f
// attribute is valid, as long as the software will not crash or lock up if
Packit 0d464f
// any pixels are inconsistent with the deepImageState attribute.
Packit 0d464f
//
Packit 0d464f
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (deepImageState, DeepImageState, DeepImageState)
Packit 0d464f
Packit 0d464f
Packit 0d464f
//
Packit 0d464f
// originalDataWindow -- if application software crops an image, then it
Packit 0d464f
// should save the data window of the original, un-cropped image in the
Packit 0d464f
// originalDataWindow attribute.
Packit 0d464f
//
Packit 0d464f
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF
Packit 0d464f
    (originalDataWindow, OriginalDataWindow, IMATH_NAMESPACE::Box2i)
Packit 0d464f
Packit 0d464f
Packit 0d464f
//
Packit 0d464f
// dwaCompressionLevel -- sets the quality level for images compressed
Packit 0d464f
// with the DWAA or DWAB method.
Packit 0d464f
//
Packit 0d464f
Packit 0d464f
IMF_STD_ATTRIBUTE_DEF (dwaCompressionLevel, DwaCompressionLevel, float)
Packit 0d464f
Packit 0d464f
Packit 0d464f
#endif