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


Python OpenImageIO.get_string_attribute方法代码示例

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


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

示例1: oiioSupportsRaw

# 需要导入模块: import OpenImageIO [as 别名]
# 或者: from OpenImageIO import get_string_attribute [as 别名]
def oiioSupportsRaw():
    '''
    Check to see if raw files can be loaded natively
    '''
    # Check to see if the raw plugin has been loaded
    format_list = oiio.get_string_attribute( "format_list" ).split(',')
    raw_plugin_present = 'raw' in format_list

    # Check to see if version is above when raw reading was fixed
    # Update this version number to reflect when the functionality is fixed
    version_great_enough = oiio.VERSION >= 10707

    return (raw_plugin_present and version_great_enough)
开发者ID:hpd,项目名称:general,代码行数:15,代码来源:mkhdr.py

示例2: len

# 需要导入模块: import OpenImageIO [as 别名]
# 或者: from OpenImageIO import get_string_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.get_string_attribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。