Blame IlmImf/ImfCompositeDeepScanLine.h

Packit Service 6754ca
///////////////////////////////////////////////////////////////////////////
Packit Service 6754ca
//
Packit Service 6754ca
// Copyright (c) 2012, Weta Digital Ltd
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 Weta Digital 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
Packit Service 6754ca
#ifndef INCLUDED_IMF_COMPOSITEDEEPSCANLINE_H
Packit Service 6754ca
#define INCLUDED_IMF_COMPOSITEDEEPSCANLINE_H
Packit Service 6754ca
Packit Service 6754ca
//-----------------------------------------------------------------------------
Packit Service 6754ca
//
Packit Service 6754ca
//	Class to composite deep samples into a frame buffer
Packit Service 6754ca
//      Initialise with a deep input part or deep inputfile
Packit Service 6754ca
//      (also supports multiple files and parts, and will 
Packit Service 6754ca
//       composite them together, as long as their sizes and channelmaps agree)
Packit Service 6754ca
//       
Packit Service 6754ca
//      Then call setFrameBuffer, and readPixels, exactly as for reading 
Packit Service 6754ca
//      regular scanline images.
Packit Service 6754ca
//
Packit Service 6754ca
//      Restrictions - source file(s) must contain at least Z and alpha channels
Packit Service 6754ca
//                   - if multiple files/parts are provided, sizes must match
Packit Service 6754ca
//                   - all requested channels will be composited as premultiplied
Packit Service 6754ca
//                   - only half and float channels can be requested
Packit Service 6754ca
//
Packit Service 6754ca
//      This object should not be considered threadsafe
Packit Service 6754ca
//  
Packit Service 6754ca
//      The default compositing engine will give spurious results with overlapping
Packit Service 6754ca
//      volumetric samples - you may derive from DeepCompositing class, override the 
Packit Service 6754ca
//      sort_pixel() and composite_pixel() functions, and pass an instance to 
Packit Service 6754ca
//      setCompositing(). 
Packit Service 6754ca
//
Packit Service 6754ca
//-----------------------------------------------------------------------------
Packit Service 6754ca
Packit Service 6754ca
#include "ImfForward.h"
Packit Service 6754ca
#include "ImfNamespace.h"
Packit Service 6754ca
#include "ImfExport.h"
Packit Service 6754ca
#include <ImathBox.h>
Packit Service 6754ca
Packit Service 6754ca
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
Packit Service 6754ca
Packit Service 6754ca
class IMF_EXPORT CompositeDeepScanLine
Packit Service 6754ca
{
Packit Service 6754ca
    public:
Packit Service 6754ca
        CompositeDeepScanLine();
Packit Service 6754ca
       virtual ~CompositeDeepScanLine();
Packit Service 6754ca
        
Packit Service 6754ca
        /// set the source data as a part
Packit Service 6754ca
        ///@note all parts must remain valid until after last interaction with DeepComp
Packit Service 6754ca
        void addSource(DeepScanLineInputPart * part);
Packit Service 6754ca
        
Packit Service 6754ca
        /// set the source data as a file
Packit Service 6754ca
        ///@note all file must remain valid until after last interaction with DeepComp
Packit Service 6754ca
        void addSource(DeepScanLineInputFile * file);
Packit Service 6754ca
        
Packit Service 6754ca
        
Packit Service 6754ca
        /////////////////////////////////////////
Packit Service 6754ca
        //
Packit Service 6754ca
        // set the frame buffer for output values
Packit Service 6754ca
        // the buffers specified must be large enough
Packit Service 6754ca
        // to handle the dataWindow() 
Packit Service 6754ca
        //
Packit Service 6754ca
        /////////////////////////////////////////
Packit Service 6754ca
        void setFrameBuffer(const FrameBuffer & fr);
Packit Service 6754ca
        
Packit Service 6754ca
        
Packit Service 6754ca
        
Packit Service 6754ca
        /////////////////////////////////////////
Packit Service 6754ca
        //
Packit Service 6754ca
        // retrieve frameBuffer
Packit Service 6754ca
        //
Packit Service 6754ca
        ////////////////////////////////////////
Packit Service 6754ca
        const FrameBuffer & frameBuffer() const;
Packit Service 6754ca
        
Packit Service 6754ca
        
Packit Service 6754ca
        //////////////////////////////////////////////////
Packit Service 6754ca
        //
Packit Service 6754ca
        // read scanlines start to end from the source(s)
Packit Service 6754ca
        // storing the result in the frame buffer provided
Packit Service 6754ca
        //
Packit Service 6754ca
        //////////////////////////////////////////////////
Packit Service 6754ca
        
Packit Service 6754ca
        void readPixels(int start,int end);
Packit Service 6754ca
        
Packit Service 6754ca
        int sources() const; // return number of sources
Packit Service 6754ca
        
Packit Service 6754ca
        /////////////////////////////////////////////////
Packit Service 6754ca
        //
Packit Service 6754ca
        // retrieve the datawindow
Packit Service 6754ca
        // If multiple parts are specified, this will
Packit Service 6754ca
        // be the union of the dataWindow of all parts
Packit Service 6754ca
        //
Packit Service 6754ca
        ////////////////////////////////////////////////
Packit Service 6754ca
        
Packit Service 6754ca
        const IMATH_NAMESPACE::Box2i & dataWindow() const;
Packit Service 6754ca
        
Packit Service 6754ca
 
Packit Service 6754ca
        //
Packit Service 6754ca
        // override default sorting/compositing operation
Packit Service 6754ca
        // (otherwise an instance of the base class will be used)
Packit Service 6754ca
        //
Packit Service 6754ca
        
Packit Service 6754ca
        void setCompositing(DeepCompositing *);
Packit Service 6754ca
        
Packit Service 6754ca
      struct Data; 
Packit Service 6754ca
    private :  
Packit Service 6754ca
      struct Data *_Data;
Packit Service 6754ca
      
Packit Service 6754ca
      CompositeDeepScanLine(const CompositeDeepScanLine &); // not implemented
Packit Service 6754ca
      const CompositeDeepScanLine & operator=(const CompositeDeepScanLine &);  // not implemented
Packit Service 6754ca
};
Packit Service 6754ca
Packit Service 6754ca
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
Packit Service 6754ca
Packit Service 6754ca
#endif