def test2d(self):
    t = IECore.TurbulenceV2ff(octaves=4, gain=0.35, lacunarity=2, turbulent=False)
    width = 400
    height = 400
    f = IECore.FloatVectorData((width * height))
    o = 0
    for i in range(0, height):
        for j in range(0, width):
            f[o] = (0.5 + t.turbulence(IECore.V2f((i / 50.0), (j / 50.0))))
            o += 1
    b = IECore.Box2i(IECore.V2i(0, 0), IECore.V2i((width - 1), (height - 1)))
    i = IECore.ImagePrimitive(b, b)
    i['r'] = IECore.PrimitiveVariable(IECore.PrimitiveVariable.Interpolation.Vertex, f)
    i['g'] = IECore.PrimitiveVariable(IECore.PrimitiveVariable.Interpolation.Vertex, f)
    i['b'] = IECore.PrimitiveVariable(IECore.PrimitiveVariable.Interpolation.Vertex, f)
    e = IECore.Reader.create('test/IECore/data/expectedResults/turbulence2d.exr').read()
    op = IECore.ImageDiffOp()
    res = op(imageA=i, imageB=e, maxError=0.0005)
    self.failIf(res.value)
def test2d(self):
    t = IECore.TurbulenceV2ff(octaves=4, gain=0.35, lacunarity=2, turbulent=False)
    width = 400
    height = 400
    f = IECore.FloatVectorData((width * height))
    o = 0
    for i in range(0, height):
        for j in range(0, width):
            f[o] = (0.5 + t.turbulence(IECore.V2f((i / 50.0), (j / 50.0))))
            o += 1
    b = IECore.Box2i(IECore.V2i(0, 0), IECore.V2i((width - 1), (height - 1)))
    i = IECore.ImagePrimitive(b, b)
    i['r'] = IECore.PrimitiveVariable(IECore.PrimitiveVariable.Interpolation.Vertex, f)
    i['g'] = IECore.PrimitiveVariable(IECore.PrimitiveVariable.Interpolation.Vertex, f)
    i['b'] = IECore.PrimitiveVariable(IECore.PrimitiveVariable.Interpolation.Vertex, f)
    e = IECore.Reader.create('test/IECore/data/expectedResults/turbulence2d.exr').read()
    op = IECore.ImageDiffOp()
    res = op(imageA=i, imageB=e, maxError=0.0005)
    self.failIf(res.value)