Blame IlmImfUtil/ImfImageIO.h

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