Esempio n. 1
0
    # 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)

    b = make_constimage(320, 240, 3, oiio.FLOAT)
    broi = b.roi
    textsize = ImageBufAlgo.text_size("Centered", 40)
    if textsize.defined:
        x = broi.xbegin + broi.width // 2 - (textsize.xbegin +
                                             textsize.width // 2)
        y = broi.ybegin + broi.height // 2 - (textsize.ybegin +
                                              textsize.height // 2)
        ImageBufAlgo.render_text(b, x, y, "Centered", 40)
    write(b, "textcentered.tif", oiio.UINT8)

    # histogram, histogram_draw,
Esempio n. 2
0
    # 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/src/a.exr"),
                       ImageBuf("../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)

    # histogram, histogram_draw,

    # make_texture
    ImageBufAlgo.make_texture (oiio.MakeTxTexture,
                               ImageBuf("../oiiotool/src/tahoe-small.tif"),
                               "tahoe-small.tx")

    # capture_image - no test

    print "Done."
except Exception as detail: