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

Method testCrop

test/IECoreImage/ImageCropOpTest.py:52–89  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

50 return imath.Box2i( imath.V2i( x , h - t ), imath.V2i( r - 1, h - y - 1 ) )
51
52 def testCrop(self):
53
54 inputFile = os.path.join( "test", "IECoreImage", "data", "exr", "colorBarsWithDataWindow.exr" )
55
56 tests = [
57 {
58 "cropBox": imath.Box2i( imath.V2i( 855, 170 ), imath.V2i( 1460, 1465 ) ),
59 "checkFile": os.path.join( "test", "IECoreImage", "data", "exr", "imageCropDataWindow.exr" ),
60 "matchDataWindow" : False,
61 "resetOrigin" : True
62 },
63 {
64 "cropBox": imath.Box2i( imath.V2i( 855, 170 ), imath.V2i( 1460, 1465 ) ),
65 "checkFile": os.path.join( "test", "IECoreImage", "data", "exr", "imageCropDataWindowMatched.exr" ),
66 "matchDataWindow" : True,
67 "resetOrigin" : True
68 },
69 {
70 "cropBox": self.__fromNukeCrop( 1125, 195, 1551, 681 ),
71 "checkFile": os.path.join( "test", "IECoreImage", "data", "exr", "imageCropDataWindow2Matched.exr" ),
72 "matchDataWindow" : True,
73 "resetOrigin" : False
74 },
75 {
76 "cropBox": self.__fromNukeCrop( 1125, 195, 1551, 681 ),
77 "checkFile": os.path.join( "test", "IECoreImage", "data", "exr", "imageCropDataWindow2.exr" ),
78 "matchDataWindow" : False,
79 "resetOrigin" : False
80 },
81 {
82 "cropBox": imath.Box2i( imath.V2i( -10, -10 ), imath.V2i( 3000, 3000 ) ),
83 "checkFile": inputFile,
84 "matchDataWindow" : False,
85 "resetOrigin" : False
86 },
87 ]
88
89 self.__testCrop( inputFile , tests )
90
91 def __testCrop( self, inputfile, tests ):
92 r = IECore.Reader.create(inputfile)

Callers

nothing calls this directly

Calls 3

__fromNukeCropMethod · 0.95
__testCropMethod · 0.95
joinMethod · 0.80

Tested by

no test coverage detected