Blame IlmImf/ImfTiledOutputPart.h

Packit 0d464f
///////////////////////////////////////////////////////////////////////////
Packit 0d464f
//
Packit 0d464f
// Copyright (c) 2011, 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
#ifndef IMFTILEDOUTPUTPART_H_
Packit 0d464f
#define IMFTILEDOUTPUTPART_H_
Packit 0d464f
Packit 0d464f
#include "ImfMultiPartOutputFile.h"
Packit 0d464f
#include "ImfTiledOutputFile.h"
Packit 0d464f
#include "ImfForward.h"
Packit 0d464f
#include "ImfExport.h"
Packit 0d464f
#include "ImfNamespace.h"
Packit 0d464f
Packit 0d464f
Packit 0d464f
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
Packit 0d464f
Packit 0d464f
//-------------------------------------------------------------------------------
Packit 0d464f
// class TiledOutputPart:
Packit 0d464f
//
Packit 0d464f
// Same interface as TiledOutputFile. Please have a reference to TiledOutputFile.
Packit 0d464f
//-------------------------------------------------------------------------------
Packit 0d464f
Packit 0d464f
class IMF_EXPORT TiledOutputPart
Packit 0d464f
{
Packit 0d464f
    public:
Packit 0d464f
        TiledOutputPart(MultiPartOutputFile& multiPartFile, int partNumber);
Packit 0d464f
Packit 0d464f
        const char *        fileName () const;
Packit 0d464f
        const Header &      header () const;
Packit 0d464f
        void                setFrameBuffer (const FrameBuffer &frameBuffer);
Packit 0d464f
        const FrameBuffer & frameBuffer () const;
Packit 0d464f
        unsigned int        tileXSize () const;
Packit 0d464f
        unsigned int        tileYSize () const;
Packit 0d464f
        LevelMode           levelMode () const;
Packit 0d464f
        LevelRoundingMode   levelRoundingMode () const;
Packit 0d464f
        int                 numLevels () const;
Packit 0d464f
        int                 numXLevels () const;
Packit 0d464f
        int                 numYLevels () const;
Packit 0d464f
        bool                isValidLevel (int lx, int ly) const;
Packit 0d464f
        int                 levelWidth  (int lx) const;
Packit 0d464f
        int                 levelHeight (int ly) const;
Packit 0d464f
        int                 numXTiles (int lx = 0) const;
Packit 0d464f
        int                 numYTiles (int ly = 0) const;
Packit 0d464f
        IMATH_NAMESPACE::Box2i        dataWindowForLevel (int l = 0) const;
Packit 0d464f
        IMATH_NAMESPACE::Box2i        dataWindowForLevel (int lx, int ly) const;
Packit 0d464f
        IMATH_NAMESPACE::Box2i        dataWindowForTile (int dx, int dy,
Packit 0d464f
                                               int l = 0) const;
Packit 0d464f
        IMATH_NAMESPACE::Box2i        dataWindowForTile (int dx, int dy,
Packit 0d464f
                                               int lx, int ly) const;
Packit 0d464f
        void                writeTile  (int dx, int dy, int l = 0);
Packit 0d464f
        void                writeTile  (int dx, int dy, int lx, int ly);
Packit 0d464f
        void                writeTiles (int dx1, int dx2, int dy1, int dy2,
Packit 0d464f
                                        int lx, int ly);
Packit 0d464f
        void                writeTiles (int dx1, int dx2, int dy1, int dy2,
Packit 0d464f
                                        int l = 0);
Packit 0d464f
        void                copyPixels (TiledInputFile &in);
Packit 0d464f
        void                copyPixels (InputFile &in);
Packit 0d464f
        void                copyPixels (TiledInputPart &in);
Packit 0d464f
        void                copyPixels (InputPart &in);
Packit 0d464f
        
Packit 0d464f
        
Packit 0d464f
        void                updatePreviewImage (const PreviewRgba newPixels[]);
Packit 0d464f
        void                breakTile  (int dx, int dy,
Packit 0d464f
                                        int lx, int ly,
Packit 0d464f
                                        int offset,
Packit 0d464f
                                        int length,
Packit 0d464f
                                        char c);
Packit 0d464f
Packit 0d464f
    private:
Packit 0d464f
        TiledOutputFile* file;
Packit 0d464f
};
Packit 0d464f
Packit 0d464f
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
Packit 0d464f
Packit 0d464f
#endif /* IMFTILEDOUTPUTPART_H_ */