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


Python Texture.setup_1d_texture方法代码示例

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


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

示例1: peeker_from_pixel

# 需要导入模块: from panda3d.core import Texture [as 别名]
# 或者: from panda3d.core.Texture import setup_1d_texture [as 别名]
def peeker_from_pixel(component_type, format, data):
    """ Creates a 1-pixel texture with the given settings and pixel data,
    then returns a TexturePeeker as result of calling texture.peek(). """

    tex = Texture("")
    tex.setup_1d_texture(1, component_type, format)
    tex.set_ram_image(data)
    peeker = tex.peek()
    assert peeker.has_pixel(0, 0)
    return peeker
开发者ID:Moteesh,项目名称:panda3d,代码行数:12,代码来源:test_texture_peek.py

示例2: image_from_stored_pixel

# 需要导入模块: from panda3d.core import Texture [as 别名]
# 或者: from panda3d.core.Texture import setup_1d_texture [as 别名]
def image_from_stored_pixel(component_type, format, data):
    """ Creates a 1-pixel texture with the given settings and pixel data,
    then returns a PNMImage as result of calling texture.store(). """

    tex = Texture("")
    tex.setup_1d_texture(1, component_type, format)
    tex.set_ram_image(data)

    img = PNMImage()
    assert tex.store(img)
    return img
开发者ID:mfwass,项目名称:panda3d,代码行数:13,代码来源:test_texture.py

示例3: peek_tex_with_clear_color

# 需要导入模块: from panda3d.core import Texture [as 别名]
# 或者: from panda3d.core.Texture import setup_1d_texture [as 别名]
def peek_tex_with_clear_color(component_type, format, clear_color):
    """ Creates a 1-pixel texture with the given settings and clear color,
    then peeks the value at this pixel and returns it. """

    tex = Texture("")
    tex.setup_1d_texture(1, component_type, format)
    tex.set_clear_color(clear_color)
    tex.make_ram_image()

    col = LColor()
    tex.peek().fetch_pixel(col, 0, 0)
    return col
开发者ID:Moteesh,项目名称:panda3d,代码行数:14,代码来源:test_texture.py


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