当前位置: 首页>>代码示例>>Python>>正文


Python OpenImageIO.get_roi方法代码示例

本文整理汇总了Python中OpenImageIO.get_roi方法的典型用法代码示例。如果您正苦于以下问题:Python OpenImageIO.get_roi方法的具体用法?Python OpenImageIO.get_roi怎么用?Python OpenImageIO.get_roi使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenImageIO的用法示例。


在下文中一共展示了OpenImageIO.get_roi方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: print

# 需要导入模块: import OpenImageIO [as 别名]
# 或者: from OpenImageIO import get_roi [as 别名]
    print ("r == r3 (expect no): ", (r == r3))
    print ("r != r3 (expect yes): ", (r != r3))
    print ("")

    print ("r contains (10,10) (expect yes): ", r.contains(10,10))
    print ("r contains (1000,10) (expect no): ", r.contains(1000,10))
    print ("r contains roi(10,20,10,20,0,1,0,1) (expect yes): ", r.contains(oiio.ROI(10,20,10,20,0,1,0,1)))
    print ("r contains roi(1010,1020,10,20,0,1,0,1) (expect no): ", r.contains(oiio.ROI(1010,1020,10,20,0,1,0,1)))

    A = oiio.ROI (0, 10, 0, 8, 0, 1, 0, 4)
    B = oiio.ROI (5, 15, -1, 10, 0, 1, 0, 4)
    print ("A =", A)
    print ("B =", B)
    print ("ROI.union(A,B) =", oiio.union(A,B))
    print ("ROI.intersection(A,B) =", oiio.intersection(A,B))
    print ("")

    spec = oiio.ImageSpec(640, 480, 3, oiio.UINT8)
    print ("Spec's roi is", oiio.get_roi(spec))
    oiio.set_roi (spec, oiio.ROI(3, 5, 7, 9))
    oiio.set_roi_full (spec, oiio.ROI(13, 15, 17, 19))
    print ("After set, roi is", oiio.get_roi(spec))
    print ("After set, roi_full is", oiio.get_roi_full(spec))

    print ("")

    print ("Done.")
except Exception as detail:
    print ("Unknown exception:", detail)

开发者ID:AtomicFiction,项目名称:oiio,代码行数:31,代码来源:test_roi.py


注:本文中的OpenImageIO.get_roi方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。