

def testDataWindowToDisplayWindow(self):
    i = GafferImage.ImageReader()
    i['fileName'].setValue(self.imageFileUndersizeDataWindow)
    crop = GafferImage.Crop()
    crop['in'].setInput(i['out'])
    crop['areaSource'].setValue(GafferImage.Crop.AreaSource.DataWindow)
    crop['affectDataWindow'].setValue(False)
    crop['affectDisplayWindow'].setValue(True)
    crop['resetOrigin'].setValue(False)
    self.assertEqual(i['out']['dataWindow'].getValue(), crop['out']['format'].getValue().getDisplayWindow())
    self.assertEqual(crop['out']['dataWindow'].getValue(), i['out']['dataWindow'].getValue())
    crop['resetOrigin'].setValue(True)
    self.assertEqual(crop['out']['format'].getValue().getDisplayWindow(), IECore.Box2i(IECore.V2i(0), IECore.V2i(50)))
    self.assertEqual(crop['out']['dataWindow'].getValue(), IECore.Box2i(IECore.V2i(0), IECore.V2i(50)))

dataset/ETHPy150Open ImageEngine/gaffer/python/GafferImageTest/CropTest.py CropTest.testDataWindowToDisplayWindow/original