|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
///////////////////////////////////////////////////////////////////////////
|
|
Packit Service |
6754ca |
//
|
|
Packit Service |
6754ca |
// Copyright (c) 2013, 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 |
#include "ImfInputFile.h"
|
|
Packit Service |
6754ca |
#include "ImfInputPart.h"
|
|
Packit Service |
6754ca |
#include "ImfTiledInputFile.h"
|
|
Packit Service |
6754ca |
#include "ImfTiledInputPart.h"
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
#include "ImfDeepScanLineInputFile.h"
|
|
Packit Service |
6754ca |
#include "ImfDeepScanLineInputPart.h"
|
|
Packit Service |
6754ca |
#include "ImfDeepTiledInputFile.h"
|
|
Packit Service |
6754ca |
#include "ImfDeepTiledInputPart.h"
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
#include "ImfChannelList.h"
|
|
Packit Service |
6754ca |
#include "ImfMultiPartInputFile.h"
|
|
Packit Service |
6754ca |
#include "ImfPartType.h"
|
|
Packit Service |
6754ca |
#include <half.h>
|
|
Packit Service |
6754ca |
#include <vector>
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
#include <assert.h>
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
#include "tmpDir.h"
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
namespace IMF = OPENEXR_IMF_NAMESPACE;
|
|
Packit Service |
6754ca |
using namespace IMF;
|
|
Packit Service |
6754ca |
using namespace std;
|
|
Packit Service |
6754ca |
using namespace IMATH_NAMESPACE;
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
#ifndef ILM_IMF_TEST_IMAGEDIR
|
|
Packit Service |
6754ca |
#define ILM_IMF_TEST_IMAGEDIR
|
|
Packit Service |
6754ca |
#endif
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
namespace
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
void doFrameBuffer(vector<half>& storage, const Header & hdr,FrameBuffer& dummy)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
int chans=0;
|
|
Packit Service |
6754ca |
for( ChannelList::ConstIterator q =hdr.channels().begin() ; q!=hdr.channels().end() ; q++)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
chans++;
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
Box2i dw= hdr.dataWindow();
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
storage.resize( (dw.size().x+1)*(dw.size().y+1)*chans);
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
int xstride = chans*sizeof(half);
|
|
Packit Service |
6754ca |
int ystride = xstride*(dw.size().x+1);
|
|
Packit Service |
6754ca |
int offset = ystride*dw.min.y + dw.min.x*xstride;
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
int chan=0;
|
|
Packit Service |
6754ca |
for( ChannelList::ConstIterator q = hdr.channels().begin() ; q!=hdr.channels().end() ; q++)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
dummy.insert(q.name(),Slice(HALF,((char*) &storage[chan])-offset,xstride,ystride));
|
|
Packit Service |
6754ca |
chan++;
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
template<class T> void readTiledThing(T & input,bool test)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
vector<half> value;
|
|
Packit Service |
6754ca |
FrameBuffer dummy;
|
|
Packit Service |
6754ca |
doFrameBuffer(value,input.header(),dummy);
|
|
Packit Service |
6754ca |
input.setFrameBuffer(dummy);
|
|
Packit Service |
6754ca |
int x_levels;
|
|
Packit Service |
6754ca |
int y_levels;
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
if(test && input.header().hasType())
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
if(input.header().type()!=TILEDIMAGE)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
std::cerr << "tiled image/part didn't have tiledimage type\n";
|
|
Packit Service |
6754ca |
//assert(input.type()==TILEDIMAGE);
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
TileDescription t = input.header().tileDescription();
|
|
Packit Service |
6754ca |
switch(t.mode)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
case ONE_LEVEL :
|
|
Packit Service |
6754ca |
x_levels = 1;
|
|
Packit Service |
6754ca |
y_levels = 1;
|
|
Packit Service |
6754ca |
break;
|
|
Packit Service |
6754ca |
case MIPMAP_LEVELS :
|
|
Packit Service |
6754ca |
x_levels = input.numXLevels();
|
|
Packit Service |
6754ca |
y_levels = 1;
|
|
Packit Service |
6754ca |
break;
|
|
Packit Service |
6754ca |
case RIPMAP_LEVELS :
|
|
Packit Service |
6754ca |
x_levels = input.numXLevels();
|
|
Packit Service |
6754ca |
y_levels = input.numYLevels();
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
for(int x_level = 0 ; x_level < x_levels ; x_level++)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
for(int y_level = 0 ; y_level < y_levels ;y_level++)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
// unless we are RIPMapped, the y_level=x_level, not 0
|
|
Packit Service |
6754ca |
int actual_y_level = t.mode==RIPMAP_LEVELS ? y_level : x_level;
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
input.readTiles(0,input.numXTiles(x_level)-1,0,input.numYTiles(actual_y_level)-1,x_level,actual_y_level);
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
template<class T> void readScanlineThing(T& input,bool test)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
if(test && input.header().hasType())
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
if(input.header().type()!=SCANLINEIMAGE)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
std::cerr << "tiled image/part didn't have tiledimage type\n";
|
|
Packit Service |
6754ca |
//assert(input.type()==TILEDIMAGE);
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
vector<half> value;
|
|
Packit Service |
6754ca |
FrameBuffer dummy;
|
|
Packit Service |
6754ca |
doFrameBuffer(value,input.header(),dummy);
|
|
Packit Service |
6754ca |
input.setFrameBuffer(dummy);
|
|
Packit Service |
6754ca |
input.readPixels(input.header().dataWindow().min.x,input.header().dataWindow().max.x);
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
void checkDeepTypesFailToLoad(const char * file)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
// trying to open it as a deep tiled file should fail
|
|
Packit Service |
6754ca |
try{
|
|
Packit Service |
6754ca |
DeepTiledInputFile f(file);
|
|
Packit Service |
6754ca |
assert(false);
|
|
Packit Service |
6754ca |
}catch(...)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
// trying to open it as a deep tiled part of a multipart file should fail
|
|
Packit Service |
6754ca |
try{
|
|
Packit Service |
6754ca |
MultiPartInputFile multiin(file);
|
|
Packit Service |
6754ca |
DeepTiledInputPart p(multiin,0);
|
|
Packit Service |
6754ca |
assert(false);
|
|
Packit Service |
6754ca |
}catch(...)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
// trying to open it as a deep scanline file should fail
|
|
Packit Service |
6754ca |
try{
|
|
Packit Service |
6754ca |
DeepScanLineInputFile f(file);
|
|
Packit Service |
6754ca |
assert(false);
|
|
Packit Service |
6754ca |
}catch(...)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
// trying to open it as a deep scanline part of a multipart file should fail
|
|
Packit Service |
6754ca |
try{
|
|
Packit Service |
6754ca |
MultiPartInputFile multiin(file);
|
|
Packit Service |
6754ca |
DeepScanLineInputPart p(multiin,0);
|
|
Packit Service |
6754ca |
assert(false);
|
|
Packit Service |
6754ca |
}catch(...)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
void testTiledWithBadAttribute(const char* file)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
// it's a tiled file, so it should read as a file
|
|
Packit Service |
6754ca |
TiledInputFile in(file);
|
|
Packit Service |
6754ca |
readTiledThing(in,false);
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
// it should also read using the multipart API (and have its attribute fixed)
|
|
Packit Service |
6754ca |
MultiPartInputFile multiin(file);
|
|
Packit Service |
6754ca |
TiledInputPart tip(multiin,0);
|
|
Packit Service |
6754ca |
readTiledThing(tip,true);
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
// it should also read using the regular file API as a scanline file
|
|
Packit Service |
6754ca |
InputFile sin(file);
|
|
Packit Service |
6754ca |
readScanlineThing(sin,false);
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
// it should also read using the multipart API as a scanline file
|
|
Packit Service |
6754ca |
MultiPartInputFile multiin(file);
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
InputPart ip(multiin,0);
|
|
Packit Service |
6754ca |
readScanlineThing(ip,false);
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
checkDeepTypesFailToLoad(file);
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
void testScanLineWithBadAttribute(const char * file)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
InputFile in(file);
|
|
Packit Service |
6754ca |
readScanlineThing(in,false);
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
MultiPartInputFile multiin(file);
|
|
Packit Service |
6754ca |
InputPart ip(multiin,0);
|
|
Packit Service |
6754ca |
readScanlineThing(ip,false);
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
checkDeepTypesFailToLoad(file);
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
// trying to open it as a tiled file should also fail
|
|
Packit Service |
6754ca |
try{
|
|
Packit Service |
6754ca |
TiledInputFile f(file);
|
|
Packit Service |
6754ca |
assert(false);
|
|
Packit Service |
6754ca |
}catch(...)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
// trying to open it as a tiled part of a multipart file should fail
|
|
Packit Service |
6754ca |
try{
|
|
Packit Service |
6754ca |
MultiPartInputFile multiin(file);
|
|
Packit Service |
6754ca |
TiledInputPart p(multiin,0);
|
|
Packit Service |
6754ca |
assert(false);
|
|
Packit Service |
6754ca |
}catch(...)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
const std::string & NOTYPEATTR="";
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
template<class IN,class OUT> void check(const char* filename,const string& inputtype,const string &outputtype,bool add_tiledesc)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
Header f;
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
if(inputtype!=NOTYPEATTR)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
f.setType(inputtype);
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
f.compression()=ZIPS_COMPRESSION;
|
|
Packit Service |
6754ca |
if(add_tiledesc)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
f.setTileDescription(TileDescription());
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
remove(filename);
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
OUT file(filename,f);
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
IMF::MultiPartInputFile file(filename);
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
if(outputtype!=NOTYPEATTR && file.header(0).type()!=outputtype)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
cerr << "Error: expected type in header to be " << outputtype << " but got " << file.header(0).type() << " from multipart when input type was " << (inputtype==NOTYPEATTR ? "unset" : inputtype )<< std::endl;
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
assert(outputtype==NOTYPEATTR || file.header(0).type()==outputtype);
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
IN file(filename);
|
|
Packit Service |
6754ca |
if(outputtype==NOTYPEATTR)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
if(file.header().hasType())
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
cerr << " type attribute got inserted when it shouldn't have been\n";
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
assert( !file.header().hasType() );
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
}else if(file.header().type()!=outputtype)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
cerr << "Error: expected type in header to be " << outputtype << " but got " << file.header().type() << " when input type was " << (inputtype==NOTYPEATTR ? "unset" : inputtype )<< std::endl;
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
remove(filename);
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
void testWriteBadTypes()
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
static const char* tmpfile = IMF_TMP_DIR "badfile.exr";
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
// attributes should be added automatically for deep files
|
|
Packit Service |
6754ca |
check<DeepScanLineInputFile,DeepScanLineOutputFile>(tmpfile,NOTYPEATTR,DEEPSCANLINE,false);
|
|
Packit Service |
6754ca |
check<DeepTiledInputFile,DeepTiledOutputFile>(tmpfile,NOTYPEATTR,DEEPTILE,true);
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
// attributes should NOT be added automatically for normal images
|
|
Packit Service |
6754ca |
check<InputFile,OutputFile>(tmpfile,NOTYPEATTR,NOTYPEATTR,false);
|
|
Packit Service |
6754ca |
check<InputFile,TiledOutputFile>(tmpfile,NOTYPEATTR,NOTYPEATTR,true);
|
|
Packit Service |
6754ca |
check<TiledInputFile,TiledOutputFile>(tmpfile,NOTYPEATTR,NOTYPEATTR,true);
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
// if an attribute is provided, it should get changed to the correct one
|
|
Packit Service |
6754ca |
check<InputFile,OutputFile>(tmpfile,SCANLINEIMAGE,SCANLINEIMAGE,false);
|
|
Packit Service |
6754ca |
check<InputFile,TiledOutputFile>(tmpfile,SCANLINEIMAGE,TILEDIMAGE,true);
|
|
Packit Service |
6754ca |
check<TiledInputFile,TiledOutputFile>(tmpfile,SCANLINEIMAGE,TILEDIMAGE,true);
|
|
Packit Service |
6754ca |
check<DeepScanLineInputFile,DeepScanLineOutputFile>(tmpfile,SCANLINEIMAGE,DEEPSCANLINE,false);
|
|
Packit Service |
6754ca |
check<DeepTiledInputFile,DeepTiledOutputFile>(tmpfile,SCANLINEIMAGE,DEEPTILE,true);
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
check<InputFile,OutputFile>(tmpfile,TILEDIMAGE,SCANLINEIMAGE,false);
|
|
Packit Service |
6754ca |
check<InputFile,TiledOutputFile>(tmpfile,TILEDIMAGE,TILEDIMAGE,true);
|
|
Packit Service |
6754ca |
check<TiledInputFile,TiledOutputFile>(tmpfile,TILEDIMAGE,TILEDIMAGE,true);
|
|
Packit Service |
6754ca |
check<DeepScanLineInputFile, DeepScanLineOutputFile>(tmpfile,TILEDIMAGE,DEEPSCANLINE,false);
|
|
Packit Service |
6754ca |
check<DeepTiledInputFile,DeepTiledOutputFile>(tmpfile,TILEDIMAGE,DEEPTILE,true);
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
check<InputFile,OutputFile>(tmpfile,DEEPSCANLINE,SCANLINEIMAGE,false);
|
|
Packit Service |
6754ca |
check<InputFile,TiledOutputFile>(tmpfile,DEEPSCANLINE,TILEDIMAGE,true);
|
|
Packit Service |
6754ca |
check<TiledInputFile,TiledOutputFile>(tmpfile,DEEPSCANLINE,TILEDIMAGE,true);
|
|
Packit Service |
6754ca |
check<DeepScanLineInputFile, DeepScanLineOutputFile>(tmpfile,DEEPSCANLINE,DEEPSCANLINE,false);
|
|
Packit Service |
6754ca |
check<DeepTiledInputFile,DeepTiledOutputFile>(tmpfile,DEEPSCANLINE,DEEPTILE,true);
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
check<InputFile,OutputFile>(tmpfile,DEEPTILE,SCANLINEIMAGE,false);
|
|
Packit Service |
6754ca |
check<InputFile,TiledOutputFile>(tmpfile,DEEPTILE,TILEDIMAGE,true);
|
|
Packit Service |
6754ca |
check<TiledInputFile,TiledOutputFile>(tmpfile,DEEPTILE,TILEDIMAGE,true);
|
|
Packit Service |
6754ca |
check<DeepScanLineInputFile,DeepScanLineOutputFile>(tmpfile,DEEPTILE,DEEPSCANLINE,false);
|
|
Packit Service |
6754ca |
check<DeepTiledInputFile,DeepTiledOutputFile>(tmpfile,DEEPTILE,DEEPTILE,true);
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
void testBadTypeAttributes(const std::string & tempDir)
|
|
Packit Service |
6754ca |
{
|
|
Packit Service |
6754ca |
cout << "Testing whether bad type attributes are fixed on read... " << endl;
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
testTiledWithBadAttribute (ILM_IMF_TEST_IMAGEDIR "tiled_with_scanlineimage_type.exr");
|
|
Packit Service |
6754ca |
testTiledWithBadAttribute (ILM_IMF_TEST_IMAGEDIR "tiled_with_deepscanline_type.exr");
|
|
Packit Service |
6754ca |
testTiledWithBadAttribute (ILM_IMF_TEST_IMAGEDIR "tiled_with_deeptile_type.exr");
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
testScanLineWithBadAttribute (ILM_IMF_TEST_IMAGEDIR "scanline_with_tiledimage_type.exr");
|
|
Packit Service |
6754ca |
testScanLineWithBadAttribute (ILM_IMF_TEST_IMAGEDIR "scanline_with_deeptiled_type.exr");
|
|
Packit Service |
6754ca |
testScanLineWithBadAttribute (ILM_IMF_TEST_IMAGEDIR "scanline_with_deepscanline_type.exr");
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
cout << "Testing whether bad type attributes are fixed on write... " << endl;
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
testWriteBadTypes();
|
|
Packit Service |
6754ca |
|
|
Packit Service |
6754ca |
cout << "ok\n" << endl;
|
|
Packit Service |
6754ca |
}
|
|
Packit Service |
6754ca |
|