Blame IlmImf/ImfMultiPartOutputFile.h

Packit Service 6754ca
///////////////////////////////////////////////////////////////////////////
Packit Service 6754ca
//
Packit Service 6754ca
// Copyright (c) 2011, Industrial Light & Magic, a division of Lucas
Packit Service 6754ca
// Digital Ltd. LLC
Packit Service 6754ca
//
Packit Service 6754ca
// Portions (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 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 MULTIPARTOUTPUTFILE_H_
Packit Service 6754ca
#define MULTIPARTOUTPUTFILE_H_
Packit Service 6754ca
Packit Service 6754ca
#include "ImfHeader.h"
Packit Service 6754ca
#include "ImfGenericOutputFile.h"
Packit Service 6754ca
#include "ImfForward.h"
Packit Service 6754ca
#include "ImfThreading.h"
Packit Service 6754ca
#include "ImfNamespace.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
Packit Service 6754ca
//
Packit Service 6754ca
// Class responsible for handling the writing of multipart images.
Packit Service 6754ca
//
Packit Service 6754ca
// Note: Certain attributes are 'common' to all parts. Notably:
Packit Service 6754ca
// * Display Window
Packit Service 6754ca
// * Pixel Aspect Ratio
Packit Service 6754ca
// * Time Code
Packit Service 6754ca
// * Chromaticities
Packit Service 6754ca
// The first header forms the basis for the set of attributes that are shared 
Packit Service 6754ca
// across the constituent parts.
Packit Service 6754ca
//
Packit Service 6754ca
// Parameters
Packit Service 6754ca
//  headers - pointer to array of headers; one for each part of the image file
Packit Service 6754ca
//  parts - count of number of parts
Packit Service 6754ca
//  overrideSharedAttributes - toggle for the handling of shared attributes.
Packit Service 6754ca
//                             set false to check for inconsistencies, true
Packit Service 6754ca
//                             to copy the values over from the first header.
Packit Service 6754ca
//  numThreads - number of threads that should be used in encoding the data.
Packit Service 6754ca
//
Packit Service 6754ca
    
Packit Service 6754ca
class IMF_EXPORT MultiPartOutputFile : public GenericOutputFile
Packit Service 6754ca
{
Packit Service 6754ca
    public:
Packit Service 6754ca
        MultiPartOutputFile(const char fileName[],
Packit Service 6754ca
                            const Header * headers,
Packit Service 6754ca
                            int parts,
Packit Service 6754ca
                            bool overrideSharedAttributes = false,
Packit Service 6754ca
                            int numThreads = globalThreadCount());
Packit Service 6754ca
                            
Packit Service 6754ca
        MultiPartOutputFile(OStream & os,
Packit Service 6754ca
                            const Header * headers,
Packit Service 6754ca
                            int parts,
Packit Service 6754ca
                            bool overrideSharedAttributes = false,
Packit Service 6754ca
                            int numThreads = globalThreadCount());                            
Packit Service 6754ca
Packit Service 6754ca
        //
Packit Service 6754ca
        // return number of parts in file
Packit Service 6754ca
        //
Packit Service 6754ca
        int parts() const ;
Packit Service 6754ca
        
Packit Service 6754ca
        
Packit Service 6754ca
        //
Packit Service 6754ca
        // return header for part n
Packit Service 6754ca
        // (note: may have additional attributes compared to that passed to constructor)
Packit Service 6754ca
        //
Packit Service 6754ca
        const Header & header(int n) const;
Packit Service 6754ca
                            
Packit Service 6754ca
        ~MultiPartOutputFile();
Packit Service 6754ca
Packit Service 6754ca
        struct Data;
Packit Service 6754ca
Packit Service 6754ca
    private:
Packit Service 6754ca
        Data*                           _data;
Packit Service 6754ca
Packit Service 6754ca
        MultiPartOutputFile(const MultiPartOutputFile &); // not implemented
Packit Service 6754ca
        
Packit Service 6754ca
        template<class T>         T*  getOutputPart(int partNumber);
Packit Service 6754ca
Packit Service 6754ca
    
Packit Service 6754ca
    friend class OutputPart;
Packit Service 6754ca
    friend class TiledOutputPart;
Packit Service 6754ca
    friend class DeepScanLineOutputPart;
Packit Service 6754ca
    friend class DeepTiledOutputPart;
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 /* MULTIPARTOUTPUTFILE_H_ */