|
Packit Service |
6754ca |
///////////////////////////////////////////////////////////////////////////
|
|
Packit Service |
6754ca |
//
|
|
Packit Service |
6754ca |
// Copyright (c) 2014, Industrial Light & Magic, a division of Lucas
|
|
Packit Service |
6754ca |
// Digital Ltd. LLC
|
|
Packit Service |
6754ca |
//
|
|
Packit Service |
6754ca |
// All rights reserved.
|
|
Packit Service |
6754ca |
//
|
|
Packit Service |
6754ca |
// Redistribution and use in source and binary forms, with or without
|
|
Packit Service |
6754ca |
// modification, are permitted provided that the following conditions are
|
|
Packit Service |
6754ca |
// met:
|
|
Packit Service |
6754ca |
// * Redistributions of source code must retain the above copyright
|
|
Packit Service |
6754ca |
// notice, this list of conditions and the following disclaimer.
|
|
Packit Service |
6754ca |
// * Redistributions in binary form must reproduce the above
|
|
Packit Service |
6754ca |
// copyright notice, this list of conditions and the following disclaimer
|
|
Packit Service |
6754ca |
// in the documentation and/or other materials provided with the
|
|
Packit Service |
6754ca |
// distribution.
|
|
Packit Service |
6754ca |
// * Neither the name of Industrial Light & Magic nor the names of
|
|
Packit Service |
6754ca |
// its contributors may be used to endorse or promote products derived
|
|
Packit Service |
6754ca |
// from this software without specific prior written permission.
|
|
Packit Service |
6754ca |
//
|
|
Packit Service |
6754ca |
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
Packit Service |
6754ca |
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
Packit Service |
6754ca |
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
Packit Service |
6754ca |
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
Packit Service |
6754ca |
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
Packit Service |
6754ca |
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
Packit Service |
6754ca |
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
Packit Service |
6754ca |
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
Packit Service |
6754ca |
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
Packit Service |
6754ca |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
Packit Service |
6754ca |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
Packit Service |
6754ca |
//
|
|
Packit Service |
6754ca |
///////////////////////////////////////////////////////////////////////////
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
#ifndef INCLUDED_IMF_IMAGE_CHANNEL_H
|
|
Packit Service |
6754ca |
#define INCLUDED_IMF_IMAGE_CHANNEL_H
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
//----------------------------------------------------------------------------
|
|
Packit Service |
6754ca |
//
|
|
Packit Service |
6754ca |
// class ImageChannel
|
|
Packit Service |
6754ca |
//
|
|
Packit Service |
6754ca |
// For an explanation of images, levels and channels,
|
|
Packit Service |
6754ca |
// see the comments in header file Image.h.
|
|
Packit Service |
6754ca |
//
|
|
Packit Service |
6754ca |
//----------------------------------------------------------------------------
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
#include <ImfPixelType.h>
|
|
Packit Service |
6754ca |
#include <ImfFrameBuffer.h>
|
|
Packit Service |
6754ca |
#include <ImfChannelList.h>
|
|
Packit Service |
6754ca |
#include <ImathBox.h>
|
|
Packit Service |
6754ca |
#include <half.h>
|
|
Packit Service |
6754ca |
#include "ImfExport.h"
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
class ImageLevel;
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
//
|
|
Packit Service |
6754ca |
// Image channels:
|
|
Packit Service |
6754ca |
//
|
|
Packit Service |
6754ca |
// An image channel holds the pixel data for a single channel of one level
|
|
Packit Service |
6754ca |
// of an image. Separate classes for flat and deep channels are derived
|
|
Packit Service |
6754ca |
// from the ImageChannel base class.
|
|
Packit Service |
6754ca |
//
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
class ImageLevel;
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
class IMF_EXPORT ImageChannel
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
public:
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
//
|
|
Packit Service |
6754ca |
// The OpenEXR pixel type of this channel (HALF, FLOAT or UINT).
|
|
Packit Service |
6754ca |
//
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
virtual PixelType pixelType () const = 0;
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
//
|
|
Packit Service |
6754ca |
// Generate an OpenEXR channel for this image channel.
|
|
Packit Service |
6754ca |
//
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
Channel channel () const;
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
//
|
|
Packit Service |
6754ca |
// Access to x and y sampling rates, "perceptually linear" flag,
|
|
Packit Service |
6754ca |
// and the number of pixels that are stored in this channel.
|
|
Packit Service |
6754ca |
//
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
int xSampling () const {return _xSampling;}
|
|
Packit Service |
6754ca |
int ySampling () const {return _ySampling;}
|
|
Packit Service |
6754ca |
bool pLinear () const {return _pLinear;}
|
|
Packit Service |
6754ca |
int pixelsPerRow () const {return _pixelsPerRow;}
|
|
Packit Service |
6754ca |
int pixelsPerColumn () const {return _pixelsPerColumn;}
|
|
Packit Service |
6754ca |
size_t numPixels () const {return _numPixels;}
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
//
|
|
Packit Service |
6754ca |
// Access to the image level to which this channel belongs.
|
|
Packit Service |
6754ca |
//
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
ImageLevel & level () {return _level;}
|
|
Packit Service |
6754ca |
const ImageLevel & level () const {return _level;}
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
protected:
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
ImageChannel (ImageLevel &level,
|
|
Packit Service |
6754ca |
int xSampling,
|
|
Packit Service |
6754ca |
int ySampling,
|
|
Packit Service |
6754ca |
bool pLinear);
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
virtual ~ImageChannel();
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
virtual void resize ();
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
void boundsCheck(int x, int y) const;
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
private:
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
ImageChannel (const ImageChannel &); // not implemented
|
|
Packit Service |
6754ca |
ImageChannel & operator = (const ImageChannel &); // not implemented
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
ImageLevel & _level;
|
|
Packit Service |
6754ca |
int _xSampling;
|
|
Packit Service |
6754ca |
int _ySampling;
|
|
Packit Service |
6754ca |
bool _pLinear;
|
|
Packit Service |
6754ca |
int _pixelsPerRow;
|
|
Packit Service |
6754ca |
int _pixelsPerColumn;
|
|
Packit Service |
6754ca |
size_t _numPixels;
|
|
Packit Service |
6754ca |
};
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
#endif
|