Blame IlmImfUtil/ImfImageIO.h

Packit Service 6754ca
///////////////////////////////////////////////////////////////////////////
Packit Service 6754ca
//
Packit Service 6754ca
// Copyright (c) 2014, Industrial Light & Magic, a division of Lucas
Packit Service 6754ca
// Digital Ltd. LLC
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 INCLUDED_IMF_IMAGE_IO_H
Packit Service 6754ca
#define INCLUDED_IMF_IMAGE_IO_H
Packit Service 6754ca
Packit Service 6754ca
//----------------------------------------------------------------------------
Packit Service 6754ca
//
Packit Service 6754ca
//      Functions to load flat or deep images from OpenEXR files
Packit Service 6754ca
//      and to save flat or deep images in OpenEXR files.
Packit Service 6754ca
//
Packit Service 6754ca
//----------------------------------------------------------------------------
Packit Service 6754ca
Packit Service 6754ca
#include "ImfImage.h"
Packit Service 6754ca
#include "ImfImageDataWindow.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
// saveImage (n, h, i, d) or
Packit Service 6754ca
// saveImage (n, i)
Packit Service 6754ca
//
Packit Service 6754ca
//      Saves image i in an OpenEXR file with name n.  The file will be
Packit Service 6754ca
//      tiled if the image has more than one level, or if a header, h, is
Packit Service 6754ca
//      given and contains a tile description attribute; otherwise the
Packit Service 6754ca
//      file will be scan-line based.  The file will be deep if the image
Packit Service 6754ca
//      is deep; otherwise the file will be flat.
Packit Service 6754ca
//
Packit Service 6754ca
//      If header h is given, then the channel list in h is replaced with
Packit Service 6754ca
//      the channel list in i, and the levelMode and the levelRounding mode
Packit Service 6754ca
//      fields of the tile description are replaced with the level mode
Packit Service 6754ca
//      and the levelRounding mode of i.  In addition, if the data window
Packit Service 6754ca
//      source flag, d, is set to USE_IMAGE_DATA_WINDOW, then the data
Packit Service 6754ca
//      window in the image is copied into the header; if d is set to
Packit Service 6754ca
//      USE_HEADER_DATA_WINDOW, then the data window in the header is
Packit Service 6754ca
//      replaced with the intersection of the original data window in the
Packit Service 6754ca
//      header and the data window in the image.  The modified header then
Packit Service 6754ca
//      becomes the header of the image file.
Packit Service 6754ca
//
Packit Service 6754ca
//      Note: USE_HEADER_DATA_WINDOW can only be used for images with
Packit Service 6754ca
//      level mode ONE_LEVEL.
Packit Service 6754ca
//
Packit Service 6754ca
Packit Service 6754ca
IMF_EXPORT
Packit Service 6754ca
void
Packit Service 6754ca
saveImage
Packit Service 6754ca
    (const std::string &fileName,
Packit Service 6754ca
     const Header &hdr,
Packit Service 6754ca
     const Image &img,
Packit Service 6754ca
     DataWindowSource dws = USE_IMAGE_DATA_WINDOW);
Packit Service 6754ca
Packit Service 6754ca
IMF_EXPORT
Packit Service 6754ca
void
Packit Service 6754ca
saveImage
Packit Service 6754ca
    (const std::string &fileName,
Packit Service 6754ca
     const Image &img;;
Packit Service 6754ca
Packit Service 6754ca
//
Packit Service 6754ca
// loadImage (n, h) or
Packit Service 6754ca
// loadImage (n)
Packit Service 6754ca
//
Packit Service 6754ca
//      Loads deep an image from the OpenEXR file with name n, and returns
Packit Service 6754ca
//      a pointer to the image.  The caller owns the image and is responsible
Packit Service 6754ca
//      for deleting it.
Packit Service 6754ca
//
Packit Service 6754ca
//      If header h is given, then the header of the file is copied into h.
Packit Service 6754ca
//
Packit Service 6754ca
Packit Service 6754ca
IMF_EXPORT
Packit Service 6754ca
Image *
Packit Service 6754ca
loadImage
Packit Service 6754ca
    (const std::string &fileName,
Packit Service 6754ca
     Header &hdr);
Packit Service 6754ca
Packit Service 6754ca
IMF_EXPORT
Packit Service 6754ca
Image *
Packit Service 6754ca
loadImage
Packit Service 6754ca
    (const std::string &fileName);
Packit Service 6754ca
Packit Service 6754ca
Packit Service 6754ca
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
Packit Service 6754ca
Packit Service 6754ca
#endif