MCPcopy Create free account
hub / github.com/ImageEngine/cortex / testMiplevel

Method testMiplevel

test/IECoreImage/ImageReaderTest.py:368–390  ·  view source on GitHub ↗
( self )

Source from the content-addressed store, hash-verified

366 self.assertEqual( h1["framesPerSecond"], h2["framesPerSecond"] )
367
368 def testMiplevel( self ) :
369
370 # Test miplevel access for mipped files
371 r = IECore.Reader.create( os.path.join( "test", "IECoreImage", "data", "tx", "uvMap.512x256.tx" ) )
372
373 r["miplevel"] = IECore.IntData( 0 )
374 self.assertEqual( r.dataWindow(), imath.Box2i( imath.V2i( 0 ), imath.V2i( 511, 255 ) ) )
375 self.assertEqual( r.displayWindow(), imath.Box2i( imath.V2i( 0 ), imath.V2i( 511, 255 ) ) )
376
377 r["miplevel"] = IECore.IntData( 1 )
378 self.assertEqual( r.dataWindow(), imath.Box2i( imath.V2i( 0 ), imath.V2i( 255, 127 ) ) )
379 self.assertEqual( r.displayWindow(), imath.Box2i( imath.V2i( 0 ), imath.V2i( 255, 127 ) ) )
380
381 # Test miplevel access for files without mips (OIIO creates mips on the fly)
382 r = IECore.Reader.create( os.path.join( "test", "IECoreImage", "data", "jpg", "uvMap.512x256.jpg" ) )
383
384 r["miplevel"] = IECore.IntData( 0 )
385 self.assertEqual( r.dataWindow(), imath.Box2i( imath.V2i( 0 ), imath.V2i( 511, 255 ) ) )
386 self.assertEqual( r.displayWindow(), imath.Box2i( imath.V2i( 0 ), imath.V2i( 511, 255 ) ) )
387
388 r["miplevel"] = IECore.IntData( 1 )
389 self.assertEqual( r.dataWindow(), imath.Box2i( imath.V2i( 0 ), imath.V2i( 255, 127 ) ) )
390 self.assertEqual( r.displayWindow(), imath.Box2i( imath.V2i( 0 ), imath.V2i( 255, 127 ) ) )
391
392 def setUp( self ) :
393

Callers

nothing calls this directly

Calls 4

joinMethod · 0.80
createMethod · 0.45
dataWindowMethod · 0.45
displayWindowMethod · 0.45

Tested by

no test coverage detected