Path: blob/master/3rdparty/openexr/IlmImf/ImfB44Compressor.h
16337 views
///////////////////////////////////////////////////////////////////////////1//2// Copyright (c) 2006, Industrial Light & Magic, a division of Lucas3// Digital Ltd. LLC4//5// All rights reserved.6//7// Redistribution and use in source and binary forms, with or without8// modification, are permitted provided that the following conditions are9// met:10// * Redistributions of source code must retain the above copyright11// notice, this list of conditions and the following disclaimer.12// * Redistributions in binary form must reproduce the above13// copyright notice, this list of conditions and the following disclaimer14// in the documentation and/or other materials provided with the15// distribution.16// * Neither the name of Industrial Light & Magic nor the names of17// its contributors may be used to endorse or promote products derived18// from this software without specific prior written permission.19//20// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS21// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT22// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR23// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT24// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,25// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT26// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,27// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY28// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT29// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE30// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.31//32///////////////////////////////////////////////////////////////////////////333435#ifndef INCLUDED_IMF_B44_COMPRESSOR_H36#define INCLUDED_IMF_B44_COMPRESSOR_H3738//-----------------------------------------------------------------------------39//40// class B44Compressor -- lossy compression of 4x4 pixel blocks41//42//-----------------------------------------------------------------------------4344#include <ImfCompressor.h>4546namespace Imf {4748class ChannelList;495051class B44Compressor: public Compressor52{53public:5455B44Compressor (const Header &hdr,56size_t maxScanLineSize,57size_t numScanLines,58bool optFlatFields);5960virtual ~B44Compressor ();6162virtual int numScanLines () const;6364virtual Format format () const;6566virtual int compress (const char *inPtr,67int inSize,68int minY,69const char *&outPtr);7071virtual int compressTile (const char *inPtr,72int inSize,73Imath::Box2i range,74const char *&outPtr);7576virtual int uncompress (const char *inPtr,77int inSize,78int minY,79const char *&outPtr);8081virtual int uncompressTile (const char *inPtr,82int inSize,83Imath::Box2i range,84const char *&outPtr);85private:8687struct ChannelData;8889int compress (const char *inPtr,90int inSize,91Imath::Box2i range,92const char *&outPtr);9394int uncompress (const char *inPtr,95int inSize,96Imath::Box2i range,97const char *&outPtr);9899int _maxScanLineSize;100bool _optFlatFields;101Format _format;102int _numScanLines;103unsigned short * _tmpBuffer;104char * _outBuffer;105int _numChans;106const ChannelList & _channels;107ChannelData * _channelData;108int _minX;109int _maxX;110int _maxY;111};112113114} // namespace Imf115116#endif117118119