| 41 | class ClampOpTest( unittest.TestCase ) : |
| 42 | |
| 43 | def test( self ) : |
| 44 | |
| 45 | image = IECore.Reader.create( os.path.join( "test", "IECoreImage", "data", "exr", "ramp.exr" ) ).read() |
| 46 | minInputValue = min( image["R"] ) |
| 47 | maxInputValue = max( image["R"] ) |
| 48 | |
| 49 | self.assertTrue( minInputValue < 0.25 ) |
| 50 | self.assertTrue( maxInputValue > 0.5 ) |
| 51 | |
| 52 | image2 = IECoreImage.ClampOp()( input=image, min=0.25, max=0.5 ) |
| 53 | |
| 54 | minOutputValue = min( image2["R"] ) |
| 55 | maxOutputValue = max( image2["R"] ) |
| 56 | |
| 57 | self.assertEqual( minOutputValue, 0.25 ) |
| 58 | self.assertEqual( maxOutputValue, 0.5 ) |
| 59 | |
| 60 | def testMinTo( self ) : |
| 61 | |