EXR Loader
The EXR loader module provides the ability to load EXR format pixmaps.
This module adds BlitzMax support for OpenEXR images.
OpenEXR is a high dynamic-range (HDR) image file format developed by motion-picture special effects company, Industrial Light and Magic (ILM).
OpenEXR's features include:
- Higher dynamic range and color precision than existing 8- and 10-bit image file formats.
- Support for 16-bit floating-point, 32-bit floating-point, and 32-bit integer pixels. The 16-bit floating-point format, called "half", is compatible with the half data type in NVIDIA's Cg graphics language and is supported natively on their new GeForce FX and Quadro FX 3D graphics solutions.
- Multiple lossless image compression algorithms. Some of the included codecs can achieve 2:1 lossless compression ratios on images with film grain.
Usage
For basic usage, you only need to Import the module, and then use LoadPixmap as you normally would. BlitzMax chooses the correct loader to load a particular file.
Local pixmap:TPixmap = LoadPixmap("XYZ_YC.exr")
For more advanced use, TEXRImage provides a LoadImage function, which will load the EXR image and allow you to process it to change settings such as gamma, exposure, defog, and knee. Note that these methods don't change the actual image data, but rather how the embedded pixmap is constructed.
Since an single EXR image pixel attribute (like Red) can be represented by a 32 bit float value, these need to be clamped to a 0 to 255 integer range for the pixmap.
Functions
| Function isEXRFile:Int(filename:String) |
| Description | Returns true if filename is a valid EXR file. |
| Function isTiledEXRFile:Int(filename:String) |
| Description | Returns true if filename is a valid tiled EXR file. |
Types
| Type TEXRImage |
| Description | An EXR image. |
| Information | Allows for the manipulation of the EXR image data. |
| Field pixmap:TPixmap |
| Description | A pixmap representation of the EXR image. |
| Method defog:Float() |
| Description | Returns the current defog setting. |
| Information | Value subtracted from pixel values to compensate for fogging due to stray light in the
recording device. Default = 0. |
| Method exposure:Float() |
| Description | Returns the current exposure setting. |
| Information | The apparent exposure of the image on the display. It lightens or darkens the
displayed image, allowing you to reveal detail in the high or low end. Default = 0. |
| Method gamma:Float() |
| Description | Returns the current gamma setting. |
| Information | Coefficient to use for gamma correcting the pixel values. Default = 2.2. |
| Method height:Int() |
| Description | Returns the height of the EXR image. |
| Method kneeHigh:Float() |
| Description | Returns the current kneehigh setting. |
| Information | Pixel values between kneehigh and kneelow set the white level of the displayed image,
determining which value is mapped to the maximum intensity of the monitor. Default = 0. |
| Method kneeLow:Float() |
| Description | Returns the current kneelow setting. |
| Information | Pixel values between kneehigh and kneelow set the white level of the displayed image,
determining which value is mapped to the maximum intensity of the monitor. Default = 0. |
| Method setDefog(value:Float) |
| Description | Sets the defog value. |
| Method setExposure(value:Float) |
| Description | Sets the exposure value. |
| Method setGamma(value:Float) |
| Description | Sets the gamma value. |
| Method setKneeHigh(value:Float) |
| Description | Sets te kneehigh value. |
| Method setKneeLow(value:Float) |
| Description | Sets the kneelow value. |
| Method width:Int() |
| Description | Returns the width of the EXR image. |
| Function LoadImage:TEXRImage(filename:String) |
| Description | Loads an EXR image. |
Module Information
| Version | 1.00 |
| License | BSD |
| Copyright | OpenEXR - 2006 Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd. |
| Copyright | Wrapper - 2007 Bruce A Henderson |
| Modserver | BRL |
| History | 1.00 |
| History | Initial Release. |
| CC_OPTS | -fexceptions |
| CC_OPTS | -DHAVE_PTHREAD |
| CC_OPTS | -DHAVE_POSIX_SEMAPHORES |
| CC_OPTS | -DHAVE_PTHREAD |
| CC_OPTS | -DHAVE_DARWIN |