當前位置: 首頁>>代碼示例>>Python>>正文


Python OpenImageIO.intersection方法代碼示例

本文整理匯總了Python中OpenImageIO.intersection方法的典型用法代碼示例。如果您正苦於以下問題:Python OpenImageIO.intersection方法的具體用法?Python OpenImageIO.intersection怎麽用?Python OpenImageIO.intersection使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OpenImageIO的用法示例。


在下文中一共展示了OpenImageIO.intersection方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: print

# 需要導入模塊: import OpenImageIO [as 別名]
# 或者: from OpenImageIO import intersection [as 別名]
    print ("r != r2 (expect no): ", (r != r2))
    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,代碼行數:32,代碼來源:test_roi.py


注:本文中的OpenImageIO.intersection方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。