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


Python OpenImageIO.attribute方法代碼示例

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


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

示例1: len

# 需要導入模塊: import OpenImageIO [as 別名]
# 或者: from OpenImageIO import attribute [as 別名]
    print "getattribute('foo_str') retrieves", s.getattribute("foo_str")
    print "getattribute('foo_vector') retrieves", s.getattribute("foo_vector")
    print "getattribute('foo_matrix') retrieves", s.getattribute("foo_matrix")
    print "getattribute('foo_no') retrieves", s.getattribute("foo_no")
    print

    print "extra_attribs size is", len(s.extra_attribs)
    for i in range(len(s.extra_attribs)) :
        print i, s.extra_attribs[i].name, s.extra_attribs[i].type, s.extra_attribs[i].value
        print s.metadata_val (s.extra_attribs[i], True)
    print

    # test initialization from ROI
    print ("Testing construction from ROI:")
    sroi = oiio.ImageSpec (oiio.ROI(0,640,0,480,0,1,0,3), oiio.FLOAT);
    print_imagespec (sroi)

    # Also test global OIIO functions here
    print "\nTesting global attribute store/retrieve:"
    oiio.attribute ("plugin_searchpath", "perfect")
    print "get_string_attribute plugin_searchpath : ", oiio.get_string_attribute ("plugin_searchpath", "bad")
    print "get_int_attribute plugin_searchpath : ", oiio.get_int_attribute ("plugin_searchpath", 0)
    print "getattribute TypeString plugin_searchpath : ", oiio.getattribute ("plugin_searchpath", oiio.TypeDesc.TypeString)
    print "getattribute TypeFloat plugin_searchpath : ", oiio.getattribute ("plugin_searchpath", oiio.TypeDesc.TypeFloat)
    print "getattribute TypeString blahblah : ", oiio.getattribute ("blahblah", oiio.TypeDesc.TypeString)

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

開發者ID:MrKepzie,項目名稱:oiio,代碼行數:31,代碼來源:test_imagespec.py


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