Blame IlmImf/ImfDeepTiledOutputFile.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
Packit 0d464f
#ifndef INCLUDED_IMF_DEEP_TILED_OUTPUT_FILE_H
Packit 0d464f
#define INCLUDED_IMF_DEEP_TILED_OUTPUT_FILE_H
Packit 0d464f
Packit 0d464f
//-----------------------------------------------------------------------------
Packit 0d464f
//
Packit 0d464f
//      class DeepTiledOutputFile
Packit 0d464f
//
Packit 0d464f
//-----------------------------------------------------------------------------
Packit 0d464f
Packit 0d464f
#include "ImfHeader.h"
Packit 0d464f
#include "ImfFrameBuffer.h"
Packit 0d464f
#include "ImathBox.h"
Packit 0d464f
#include "ImfThreading.h"
Packit 0d464f
#include "ImfGenericOutputFile.h"
Packit 0d464f
#include "ImfNamespace.h"
Packit 0d464f
#include "ImfForward.h"
Packit 0d464f
#include "ImfExport.h"
Packit 0d464f
Packit 0d464f
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
Packit 0d464f
Packit 0d464f
Packit 0d464f
class IMF_EXPORT DeepTiledOutputFile : public GenericOutputFile
Packit 0d464f
{
Packit 0d464f
  public:
Packit 0d464f
Packit 0d464f
    //-------------------------------------------------------------------
Packit 0d464f
    // A constructor that opens the file with the specified name, and
Packit 0d464f
    // writes the file header.  The file header is also copied into the
Packit 0d464f
    // TiledOutputFile object, and can later be accessed via the header()
Packit 0d464f
    // method.
Packit 0d464f
    //
Packit 0d464f
    // Destroying TiledOutputFile constructed with this constructor
Packit 0d464f
    // automatically closes the corresponding files.
Packit 0d464f
    //
Packit 0d464f
    // The header must contain a TileDescriptionAttribute called "tiles".
Packit 0d464f
    //
Packit 0d464f
    // The x and y subsampling factors for all image channels must be 1;
Packit 0d464f
    // subsampling is not supported.
Packit 0d464f
    //
Packit 0d464f
    // Tiles can be written to the file in arbitrary order.  The line
Packit 0d464f
    // order attribute can be used to cause the tiles to be sorted in
Packit 0d464f
    // the file.  When the file is read later, reading the tiles in the
Packit 0d464f
    // same order as they are in the file tends to be significantly
Packit 0d464f
    // faster than reading the tiles in random order (see writeTile,
Packit 0d464f
    // below).
Packit 0d464f
    //-------------------------------------------------------------------
Packit 0d464f
Packit 0d464f
    DeepTiledOutputFile (const char fileName[],
Packit 0d464f
                         const Header &header,
Packit 0d464f
                         int numThreads = globalThreadCount ());
Packit 0d464f
Packit 0d464f
Packit 0d464f
    // ----------------------------------------------------------------
Packit 0d464f
    // A constructor that attaches the new TiledOutputFile object to
Packit 0d464f
    // a file that has already been opened.  Destroying TiledOutputFile
Packit 0d464f
    // objects constructed with this constructor does not automatically
Packit 0d464f
    // close the corresponding files.
Packit 0d464f
    // ----------------------------------------------------------------
Packit 0d464f
Packit 0d464f
    DeepTiledOutputFile (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &os,
Packit 0d464f
                         const Header &header,
Packit 0d464f
                         int numThreads = globalThreadCount ());
Packit 0d464f
Packit 0d464f
Packit 0d464f
    //-----------------------------------------------------
Packit 0d464f
    // Destructor
Packit 0d464f
    //
Packit 0d464f
    // Destroying a TiledOutputFile object before all tiles
Packit 0d464f
    // have been written results in an incomplete file.
Packit 0d464f
    //-----------------------------------------------------
Packit 0d464f
Packit 0d464f
    virtual ~DeepTiledOutputFile ();
Packit 0d464f
Packit 0d464f
Packit 0d464f
    //------------------------
Packit 0d464f
    // Access to the file name
Packit 0d464f
    //------------------------
Packit 0d464f
Packit 0d464f
    const char *        fileName () const;
Packit 0d464f
Packit 0d464f
Packit 0d464f
    //--------------------------
Packit 0d464f
    // Access to the file header
Packit 0d464f
    //--------------------------
Packit 0d464f
Packit 0d464f
    const Header &      header () const;
Packit 0d464f
Packit 0d464f
Packit 0d464f
    //-------------------------------------------------------
Packit 0d464f
    // Set the current frame buffer -- copies the FrameBuffer
Packit 0d464f
    // object into the TiledOutputFile object.
Packit 0d464f
    //
Packit 0d464f
    // The current frame buffer is the source of the pixel
Packit 0d464f
    // data written to the file.  The current frame buffer
Packit 0d464f
    // must be set at least once before writeTile() is
Packit 0d464f
    // called.  The current frame buffer can be changed
Packit 0d464f
    // after each call to writeTile().
Packit 0d464f
    //-------------------------------------------------------
Packit 0d464f
Packit 0d464f
    void                setFrameBuffer (const DeepFrameBuffer &frameBuffer);
Packit 0d464f
Packit 0d464f
Packit 0d464f
    //-----------------------------------
Packit 0d464f
    // Access to the current frame buffer
Packit 0d464f
    //-----------------------------------
Packit 0d464f
Packit 0d464f
    const DeepFrameBuffer & frameBuffer () const;
Packit 0d464f
Packit 0d464f
Packit 0d464f
    //-------------------
Packit 0d464f
    // Utility functions:
Packit 0d464f
    //-------------------
Packit 0d464f
Packit 0d464f
    //---------------------------------------------------------
Packit 0d464f
    // Multiresolution mode and tile size:
Packit 0d464f
    // The following functions return the xSize, ySize and mode
Packit 0d464f
    // fields of the file header's TileDescriptionAttribute.
Packit 0d464f
    //---------------------------------------------------------
Packit 0d464f
Packit 0d464f
    unsigned int        tileXSize () const;
Packit 0d464f
    unsigned int        tileYSize () const;
Packit 0d464f
    LevelMode           levelMode () const;
Packit 0d464f
    LevelRoundingMode   levelRoundingMode () const;
Packit 0d464f
Packit 0d464f
Packit 0d464f
    //--------------------------------------------------------------------
Packit 0d464f
    // Number of levels:
Packit 0d464f
    //
Packit 0d464f
    // numXLevels() returns the file's number of levels in x direction.
Packit 0d464f
    //
Packit 0d464f
    //  if levelMode() == ONE_LEVEL:
Packit 0d464f
    //      return value is: 1
Packit 0d464f
    //
Packit 0d464f
    //  if levelMode() == MIPMAP_LEVELS:
Packit 0d464f
    //      return value is: rfunc (log (max (w, h)) / log (2)) + 1
Packit 0d464f
    //
Packit 0d464f
    //  if levelMode() == RIPMAP_LEVELS:
Packit 0d464f
    //      return value is: rfunc (log (w) / log (2)) + 1
Packit 0d464f
    //
Packit 0d464f
    //  where
Packit 0d464f
    //      w is the width of the image's data window,  max.x - min.x + 1,
Packit 0d464f
    //      y is the height of the image's data window, max.y - min.y + 1,
Packit 0d464f
    //      and rfunc(x) is either floor(x), or ceil(x), depending on
Packit 0d464f
    //      whether levelRoundingMode() returns ROUND_DOWN or ROUND_UP.
Packit 0d464f
    //
Packit 0d464f
    // numYLevels() returns the file's number of levels in y direction.
Packit 0d464f
    //
Packit 0d464f
    //  if levelMode() == ONE_LEVEL or levelMode() == MIPMAP_LEVELS:
Packit 0d464f
    //      return value is the same as for numXLevels()
Packit 0d464f
    //
Packit 0d464f
    //  if levelMode() == RIPMAP_LEVELS:
Packit 0d464f
    //      return value is: rfunc (log (h) / log (2)) + 1
Packit 0d464f
    //
Packit 0d464f
    //
Packit 0d464f
    // numLevels() is a convenience function for use with MIPMAP_LEVELS
Packit 0d464f
    // files.
Packit 0d464f
    //
Packit 0d464f
    //  if levelMode() == ONE_LEVEL or levelMode() == MIPMAP_LEVELS:
Packit 0d464f
    //      return value is the same as for numXLevels()
Packit 0d464f
    //
Packit 0d464f
    //  if levelMode() == RIPMAP_LEVELS:
Packit 0d464f
    //      an IEX_NAMESPACE::LogicExc exception is thrown
Packit 0d464f
    //
Packit 0d464f
    // isValidLevel(lx, ly) returns true if the file contains
Packit 0d464f
    // a level with level number (lx, ly), false if not.
Packit 0d464f
    //
Packit 0d464f
    //--------------------------------------------------------------------
Packit 0d464f
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
Packit 0d464f
Packit 0d464f
    //---------------------------------------------------------
Packit 0d464f
    // Dimensions of a level:
Packit 0d464f
    //
Packit 0d464f
    // levelWidth(lx) returns the width of a level with level
Packit 0d464f
    // number (lx, *), where * is any number.
Packit 0d464f
    //
Packit 0d464f
    //  return value is:
Packit 0d464f
    //      max (1, rfunc (w / pow (2, lx)))
Packit 0d464f
    //
Packit 0d464f
    //
Packit 0d464f
    // levelHeight(ly) returns the height of a level with level
Packit 0d464f
    // number (*, ly), where * is any number.
Packit 0d464f
    //
Packit 0d464f
    //  return value is:
Packit 0d464f
    //      max (1, rfunc (h / pow (2, ly)))
Packit 0d464f
    //
Packit 0d464f
    //---------------------------------------------------------
Packit 0d464f
Packit 0d464f
    int                 levelWidth  (int lx) const;
Packit 0d464f
    int                 levelHeight (int ly) const;
Packit 0d464f
Packit 0d464f
Packit 0d464f
    //----------------------------------------------------------
Packit 0d464f
    // Number of tiles:
Packit 0d464f
    //
Packit 0d464f
    // numXTiles(lx) returns the number of tiles in x direction
Packit 0d464f
    // that cover a level with level number (lx, *), where * is
Packit 0d464f
    // any number.
Packit 0d464f
    //
Packit 0d464f
    //  return value is:
Packit 0d464f
    //      (levelWidth(lx) + tileXSize() - 1) / tileXSize()
Packit 0d464f
    //
Packit 0d464f
    //
Packit 0d464f
    // numYTiles(ly) returns the number of tiles in y direction
Packit 0d464f
    // that cover a level with level number (*, ly), where * is
Packit 0d464f
    // any number.
Packit 0d464f
    //
Packit 0d464f
    //  return value is:
Packit 0d464f
    //      (levelHeight(ly) + tileXSize() - 1) / tileXSize()
Packit 0d464f
    //
Packit 0d464f
    //----------------------------------------------------------
Packit 0d464f
Packit 0d464f
    int                 numXTiles (int lx = 0) const;
Packit 0d464f
    int                 numYTiles (int ly = 0) const;
Packit 0d464f
Packit 0d464f
Packit 0d464f
    //---------------------------------------------------------
Packit 0d464f
    // Level pixel ranges:
Packit 0d464f
    //
Packit 0d464f
    // dataWindowForLevel(lx, ly) returns a 2-dimensional
Packit 0d464f
    // region of valid pixel coordinates for a level with
Packit 0d464f
    // level number (lx, ly)
Packit 0d464f
    //
Packit 0d464f
    //  return value is a Box2i with min value:
Packit 0d464f
    //      (dataWindow.min.x, dataWindow.min.y)
Packit 0d464f
    //
Packit 0d464f
    //  and max value:
Packit 0d464f
    //      (dataWindow.min.x + levelWidth(lx) - 1,
Packit 0d464f
    //       dataWindow.min.y + levelHeight(ly) - 1)
Packit 0d464f
    //
Packit 0d464f
    // dataWindowForLevel(level) is a convenience function used
Packit 0d464f
    // for ONE_LEVEL and MIPMAP_LEVELS files.  It returns
Packit 0d464f
    // dataWindowForLevel(level, level).
Packit 0d464f
    //
Packit 0d464f
    //---------------------------------------------------------
Packit 0d464f
Packit 0d464f
    IMATH_NAMESPACE::Box2i        dataWindowForLevel (int l = 0) const;
Packit 0d464f
    IMATH_NAMESPACE::Box2i        dataWindowForLevel (int lx, int ly) const;
Packit 0d464f
Packit 0d464f
Packit 0d464f
    //-------------------------------------------------------------------
Packit 0d464f
    // Tile pixel ranges:
Packit 0d464f
    //
Packit 0d464f
    // dataWindowForTile(dx, dy, lx, ly) returns a 2-dimensional
Packit 0d464f
    // region of valid pixel coordinates for a tile with tile coordinates
Packit 0d464f
    // (dx,dy) and level number (lx, ly).
Packit 0d464f
    //
Packit 0d464f
    //  return value is a Box2i with min value:
Packit 0d464f
    //      (dataWindow.min.x + dx * tileXSize(),
Packit 0d464f
    //       dataWindow.min.y + dy * tileYSize())
Packit 0d464f
    //
Packit 0d464f
    //  and max value:
Packit 0d464f
    //      (dataWindow.min.x + (dx + 1) * tileXSize() - 1,
Packit 0d464f
    //       dataWindow.min.y + (dy + 1) * tileYSize() - 1)
Packit 0d464f
    //
Packit 0d464f
    // dataWindowForTile(dx, dy, level) is a convenience function
Packit 0d464f
    // used for ONE_LEVEL and MIPMAP_LEVELS files.  It returns
Packit 0d464f
    // dataWindowForTile(dx, dy, level, level).
Packit 0d464f
    //
Packit 0d464f
    //-------------------------------------------------------------------
Packit 0d464f
Packit 0d464f
    IMATH_NAMESPACE::Box2i        dataWindowForTile (int dx, int dy,
Packit 0d464f
                                           int l = 0) const;
Packit 0d464f
Packit 0d464f
    IMATH_NAMESPACE::Box2i        dataWindowForTile (int dx, int dy,
Packit 0d464f
                                           int lx, int ly) const;
Packit 0d464f
Packit 0d464f
    //------------------------------------------------------------------
Packit 0d464f
    // Write pixel data:
Packit 0d464f
    //
Packit 0d464f
    // writeTile(dx, dy, lx, ly) writes the tile with tile
Packit 0d464f
    // coordinates (dx, dy), and level number (lx, ly) to
Packit 0d464f
    // the file.
Packit 0d464f
    //
Packit 0d464f
    //   dx must lie in the interval [0, numXTiles(lx) - 1]
Packit 0d464f
    //   dy must lie in the interval [0, numYTiles(ly) - 1]
Packit 0d464f
    //
Packit 0d464f
    //   lx must lie in the interval [0, numXLevels() - 1]
Packit 0d464f
    //   ly must lie in the inverval [0, numYLevels() - 1]
Packit 0d464f
    //
Packit 0d464f
    // writeTile(dx, dy, level) is a convenience function
Packit 0d464f
    // used for ONE_LEVEL and MIPMAP_LEVEL files.  It calls
Packit 0d464f
    // writeTile(dx, dy, level, level).
Packit 0d464f
    //
Packit 0d464f
    // The two writeTiles(dx1, dx2, dy1, dy2, ...) functions allow
Packit 0d464f
    // writing multiple tiles at once.  If multi-threading is used
Packit 0d464f
    // multiple tiles are written concurrently.  The tile coordinates,
Packit 0d464f
    // dx1, dx2 and dy1, dy2, specify inclusive ranges of tile
Packit 0d464f
    // coordinates.  It is valid for dx1 < dx2 or dy1 < dy2; the
Packit 0d464f
    // tiles are always written in the order specified by the line
Packit 0d464f
    // order attribute.  Hence, it is not possible to specify an
Packit 0d464f
    // "invalid" or empty tile range.
Packit 0d464f
    //
Packit 0d464f
    // Pixels that are outside the pixel coordinate range for the tile's
Packit 0d464f
    // level, are never accessed by writeTile().
Packit 0d464f
    //
Packit 0d464f
    // Each tile in the file must be written exactly once.
Packit 0d464f
    //
Packit 0d464f
    // The file's line order attribute determines the order of the tiles
Packit 0d464f
    // in the file:
Packit 0d464f
    //
Packit 0d464f
    //   INCREASING_Y   In the file, the tiles for each level are stored
Packit 0d464f
    //                  in a contiguous block.  The levels are ordered
Packit 0d464f
    //                  like this:
Packit 0d464f
    //
Packit 0d464f
    //                      (0, 0)   (1, 0)   ... (nx-1, 0)
Packit 0d464f
    //                      (0, 1)   (1, 1)   ... (nx-1, 1)
Packit 0d464f
    //                       ...
Packit 0d464f
    //                      (0,ny-1) (1,ny-1) ... (nx-1,ny-1)
Packit 0d464f
    //
Packit 0d464f
    //                  where nx = numXLevels(), and ny = numYLevels().
Packit 0d464f
    //                  In an individual level, (lx, ly), the tiles
Packit 0d464f
    //                  are stored in the following order:
Packit 0d464f
    //
Packit 0d464f
    //                      (0, 0)   (1, 0)   ... (tx-1, 0)
Packit 0d464f
    //                      (0, 1)   (1, 1)   ... (tx-1, 1)
Packit 0d464f
    //                       ...
Packit 0d464f
    //                      (0,ty-1) (1,ty-1) ... (tx-1,ty-1)
Packit 0d464f
    //
Packit 0d464f
    //                  where tx = numXTiles(lx),
Packit 0d464f
    //                  and   ty = numYTiles(ly).
Packit 0d464f
    //
Packit 0d464f
    //   DECREASING_Y   As for INCREASING_Y, the tiles for each level
Packit 0d464f
    //                  are stored in a contiguous block.  The levels
Packit 0d464f
    //                  are ordered the same way as for INCREASING_Y,
Packit 0d464f
    //                  but within an individual level, the tiles
Packit 0d464f
    //                  are stored in this order:
Packit 0d464f
    //
Packit 0d464f
    //                      (0,ty-1) (1,ty-1) ... (tx-1,ty-1)
Packit 0d464f
    //                       ...
Packit 0d464f
    //                      (0, 1)   (1, 1)   ... (tx-1, 1)
Packit 0d464f
    //                      (0, 0)   (1, 0)   ... (tx-1, 0)
Packit 0d464f
    //
Packit 0d464f
    //
Packit 0d464f
    //   RANDOM_Y       The order of the calls to writeTile() determines
Packit 0d464f
    //                  the order of the tiles in the file.
Packit 0d464f
    //
Packit 0d464f
    //------------------------------------------------------------------
Packit 0d464f
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
Packit 0d464f
    void                writeTiles (int dx1, int dx2, int dy1, int dy2,
Packit 0d464f
                                    int lx, int ly);
Packit 0d464f
Packit 0d464f
    void                writeTiles (int dx1, int dx2, int dy1, int dy2,
Packit 0d464f
                                    int l = 0);
Packit 0d464f
Packit 0d464f
Packit 0d464f
    //------------------------------------------------------------------
Packit 0d464f
    // Shortcut to copy all pixels from a TiledInputFile into this file,
Packit 0d464f
    // without uncompressing and then recompressing the pixel data.
Packit 0d464f
    // This file's header must be compatible with the TiledInputFile's
Packit 0d464f
    // header:  The two header's "dataWindow", "compression",
Packit 0d464f
    // "lineOrder", "channels", and "tiles" attributes must be the same.
Packit 0d464f
    //------------------------------------------------------------------
Packit 0d464f
Packit 0d464f
    void                copyPixels (DeepTiledInputFile &in);
Packit 0d464f
    void                copyPixels (DeepTiledInputPart &in);
Packit 0d464f
Packit 0d464f
Packit 0d464f
Packit 0d464f
    //--------------------------------------------------------------
Packit 0d464f
    // Updating the preview image:
Packit 0d464f
    //
Packit 0d464f
    // updatePreviewImage() supplies a new set of pixels for the
Packit 0d464f
    // preview image attribute in the file's header.  If the header
Packit 0d464f
    // does not contain a preview image, updatePreviewImage() throws
Packit 0d464f
    // an IEX_NAMESPACE::LogicExc.
Packit 0d464f
    //
Packit 0d464f
    // Note: updatePreviewImage() is necessary because images are
Packit 0d464f
    // often stored in a file incrementally, a few tiles at a time,
Packit 0d464f
    // while the image is being generated.  Since the preview image
Packit 0d464f
    // is an attribute in the file's header, it gets stored in the
Packit 0d464f
    // file as soon as the file is opened, but we may not know what
Packit 0d464f
    // the preview image should look like until we have written the
Packit 0d464f
    // last tile of the main image.
Packit 0d464f
    //
Packit 0d464f
    //--------------------------------------------------------------
Packit 0d464f
Packit 0d464f
    void                updatePreviewImage (const PreviewRgba newPixels[]);
Packit 0d464f
Packit 0d464f
Packit 0d464f
    //-------------------------------------------------------------
Packit 0d464f
    // Break a tile -- for testing and debugging only:
Packit 0d464f
    //
Packit 0d464f
    // breakTile(dx,dy,lx,ly,p,n,c) introduces an error into the
Packit 0d464f
    // output file by writing n copies of character c, starting
Packit 0d464f
    // p bytes from the beginning of the tile with tile coordinates
Packit 0d464f
    // (dx, dy) and level number (lx, ly).
Packit 0d464f
    //
Packit 0d464f
    // Warning: Calling this function usually results in a broken
Packit 0d464f
    // image file.  The file or parts of it may not be readable,
Packit 0d464f
    // or the file may contain bad data.
Packit 0d464f
    //
Packit 0d464f
    //-------------------------------------------------------------
Packit 0d464f
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
    struct Data;
Packit 0d464f
Packit 0d464f
  private:
Packit 0d464f
Packit 0d464f
    // ----------------------------------------------------------------
Packit 0d464f
    // A constructor attaches the OutputStreamMutex to the
Packit 0d464f
    // given one from MultiPartOutputFile. Set the previewPosition
Packit 0d464f
    // and lineOffsetsPosition which have been acquired from
Packit 0d464f
    // the constructor of MultiPartOutputFile as well.
Packit 0d464f
    // ----------------------------------------------------------------
Packit 0d464f
    DeepTiledOutputFile (const OutputPartData* part);
Packit 0d464f
Packit 0d464f
    DeepTiledOutputFile (const DeepTiledOutputFile &);              // not implemented
Packit 0d464f
    DeepTiledOutputFile & operator = (const DeepTiledOutputFile &); // not implemented
Packit 0d464f
Packit 0d464f
    void                initialize (const Header &header);
Packit 0d464f
Packit 0d464f
    bool                isValidTile (int dx, int dy,
Packit 0d464f
                                     int lx, int ly) const;
Packit 0d464f
Packit 0d464f
    size_t              bytesPerLineForTile (int dx, int dy,
Packit 0d464f
                                             int lx, int ly) const;
Packit 0d464f
Packit 0d464f
    Data *              _data;
Packit 0d464f
Packit 0d464f
Packit 0d464f
    friend class MultiPartOutputFile;
Packit 0d464f
Packit 0d464f
};
Packit 0d464f
Packit 0d464f
Packit 0d464f
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
Packit 0d464f
Packit 0d464f
#endif