|
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_RGBA_H
|
|
Packit |
0d464f |
#define INCLUDED_IMF_RGBA_H
|
|
Packit |
0d464f |
|
|
Packit |
0d464f |
//-----------------------------------------------------------------------------
|
|
Packit |
0d464f |
//
|
|
Packit |
0d464f |
// class Rgba
|
|
Packit |
0d464f |
//
|
|
Packit |
0d464f |
//-----------------------------------------------------------------------------
|
|
Packit |
0d464f |
|
|
Packit |
0d464f |
#include "half.h"
|
|
Packit |
0d464f |
#include "ImfNamespace.h"
|
|
Packit |
0d464f |
|
|
Packit |
0d464f |
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
|
|
Packit |
0d464f |
|
|
Packit |
0d464f |
|
|
Packit |
0d464f |
//
|
|
Packit |
0d464f |
// RGBA pixel
|
|
Packit |
0d464f |
//
|
|
Packit |
0d464f |
|
|
Packit |
0d464f |
struct Rgba
|
|
Packit |
0d464f |
{
|
|
Packit |
0d464f |
half r;
|
|
Packit |
0d464f |
half g;
|
|
Packit |
0d464f |
half b;
|
|
Packit |
0d464f |
half a;
|
|
Packit |
0d464f |
|
|
Packit |
0d464f |
Rgba () {}
|
|
Packit |
0d464f |
Rgba (half r, half g, half b, half a = 1.f): r (r), g (g), b (b), a (a) {}
|
|
Packit |
0d464f |
|
|
Packit |
0d464f |
Rgba & operator = (const Rgba &other)
|
|
Packit |
0d464f |
{
|
|
Packit |
0d464f |
r = other.r;
|
|
Packit |
0d464f |
g = other.g;
|
|
Packit |
0d464f |
b = other.b;
|
|
Packit |
0d464f |
a = other.a;
|
|
Packit |
0d464f |
|
|
Packit |
0d464f |
return *this;
|
|
Packit |
0d464f |
}
|
|
Packit |
0d464f |
};
|
|
Packit |
0d464f |
|
|
Packit |
0d464f |
|
|
Packit |
0d464f |
//
|
|
Packit |
0d464f |
// Channels in an RGBA file
|
|
Packit |
0d464f |
//
|
|
Packit |
0d464f |
|
|
Packit |
0d464f |
enum RgbaChannels
|
|
Packit |
0d464f |
{
|
|
Packit |
0d464f |
WRITE_R = 0x01, // Red
|
|
Packit |
0d464f |
WRITE_G = 0x02, // Green
|
|
Packit |
0d464f |
WRITE_B = 0x04, // Blue
|
|
Packit |
0d464f |
WRITE_A = 0x08, // Alpha
|
|
Packit |
0d464f |
|
|
Packit |
0d464f |
WRITE_Y = 0x10, // Luminance, for black-and-white images,
|
|
Packit |
0d464f |
// or in combination with chroma
|
|
Packit |
0d464f |
|
|
Packit |
0d464f |
WRITE_C = 0x20, // Chroma (two subsampled channels, RY and BY,
|
|
Packit |
0d464f |
// supported only for scanline-based files)
|
|
Packit |
0d464f |
|
|
Packit |
0d464f |
WRITE_RGB = 0x07, // Red, green, blue
|
|
Packit |
0d464f |
WRITE_RGBA = 0x0f, // Red, green, blue, alpha
|
|
Packit |
0d464f |
|
|
Packit |
0d464f |
WRITE_YC = 0x30, // Luminance, chroma
|
|
Packit |
0d464f |
WRITE_YA = 0x18, // Luminance, alpha
|
|
Packit |
0d464f |
WRITE_YCA = 0x38 // Luminance, chroma, alpha
|
|
Packit |
0d464f |
};
|
|
Packit |
0d464f |
|
|
Packit |
0d464f |
|
|
Packit |
0d464f |
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
|
|
Packit |
0d464f |
|
|
Packit |
0d464f |
|
|
Packit |
0d464f |
|
|
Packit |
0d464f |
|
|
Packit |
0d464f |
|
|
Packit |
0d464f |
#endif
|