本文整理汇总了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
示例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
示例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