コード例 #1
0
ファイル: test_imagebufalgo.py プロジェクト: tdsmith/oiio
    ImageBufAlgo.polar_to_complex(b, polar)
    write(polar, "polar.exr", oiio.HALF)
    write(b, "complex.exr", oiio.HALF)
    fft.clear()
    polar.clear()

    # fixNonFinite
    bad = ImageBuf("../oiiotool-fixnan/bad.exr")
    b = ImageBuf()
    ImageBufAlgo.fixNonFinite(b, bad, oiio.NONFINITE_BOX3)
    write(b, "box3.exr")
    bad.clear()

    # fillholes_pushpull
    b = ImageBuf()
    ImageBufAlgo.fillholes_pushpull(b, ImageBuf("../oiiotool/ref/hole.tif"))
    write(b, "tahoe-filled.tif", oiio.UINT8)

    # over
    b = ImageBuf()
    ImageBufAlgo.over(b, ImageBuf("../oiiotool-composite/a.exr"),
                      ImageBuf("../oiiotool-composite/b.exr"))
    write(b, "a_over_b.exr")

    # FIXME - no test for zover (not in oiio-composite either)

    # FIXME - no test for render_text

    # histogram, histogram_draw,

    # make_texture
コード例 #2
0
ファイル: test_imagebufalgo.py プロジェクト: nburtnyk/oiio
    ImageBufAlgo.polar_to_complex(b, polar)
    write(polar, "polar.exr", oiio.HALF)
    write(b, "complex.exr", oiio.HALF)
    fft.clear()
    polar.clear()

    # fixNonFinite
    bad = ImageBuf("../oiiotool-fixnan/bad.exr")
    b = ImageBuf()
    ImageBufAlgo.fixNonFinite(b, bad, oiio.NONFINITE_BOX3)
    write(b, "box3.exr")
    bad.clear()

    # fillholes_pushpull
    b = ImageBuf()
    ImageBufAlgo.fillholes_pushpull(b, ImageBuf("../oiiotool/ref/hole.tif"))
    write(b, "tahoe-filled.tif", oiio.UINT8)

    # over
    b = ImageBuf()
    ImageBufAlgo.over(b, ImageBuf("../oiiotool-composite/a.exr"), ImageBuf("../oiiotool-composite/b.exr"))
    write(b, "a_over_b.exr")

    # FIXME - no test for zover (not in oiio-composite either)

    # FIXME - no test for render_text

    # histogram, histogram_draw,

    # make_texture
    ImageBufAlgo.make_texture(oiio.MakeTxTexture, ImageBuf("../oiiotool/tahoe-small.tif"), "tahoe-small.tx")
コード例 #3
0
ファイル: test_imagebufalgo.py プロジェクト: hybridetech/oiio
    fft = ImageBuf("fft.exr")
    polar = ImageBufAlgo.complex_to_polar(fft)
    b = ImageBufAlgo.polar_to_complex(polar)
    write(polar, "polar.exr", oiio.FLOAT)
    write(b, "unpolar.exr", oiio.FLOAT)
    fft.clear()
    polar.clear()

    # fixNonFinite
    bad = ImageBuf(OIIO_TESTSUITE_ROOT + "/oiiotool-fixnan/src/bad.exr")
    b = ImageBufAlgo.fixNonFinite(bad, oiio.NONFINITE_BOX3)
    write(b, "box3.exr")
    bad.clear()

    # fillholes_pushpull
    b = ImageBufAlgo.fillholes_pushpull(
        ImageBuf(OIIO_TESTSUITE_ROOT + "/oiiotool/ref/hole.tif"))
    write(b, "tahoe-filled.tif", oiio.UINT8)

    # over
    b = ImageBufAlgo.over(
        ImageBuf(OIIO_TESTSUITE_ROOT + "/oiiotool-composite/src/a.exr"),
        ImageBuf(OIIO_TESTSUITE_ROOT + "/oiiotool-composite/src/b.exr"))
    write(b, "a_over_b.exr")

    # FIXME - no test for zover (not in oiio-composite either)

    b = make_constimage(320, 240, 3, oiio.FLOAT)
    ImageBufAlgo.render_text(b, 25, 50, "Hello, world", 16, "DroidSerif",
                             (1, 1, 1))
    ImageBufAlgo.render_text(b, 50, 120, "Go Big Red!", 42, "", (1, 0, 0))
    write(b, "text.tif", oiio.UINT8)