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


Python BufferUtils.get_buffer_size方法代码示例

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


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

示例1: setup

# 需要导入模块: from lib.buffer_utils import BufferUtils [as 别名]
# 或者: from lib.buffer_utils.BufferUtils import get_buffer_size [as 别名]
    def setup(self):
        self.num_strands, self.num_pixels = BufferUtils.get_buffer_size(self._app)

        self.scene_bb = self._app.scene.get_fixture_bounding_box()
        self.scene_center = (self.scene_bb[0] + (self.scene_bb[2] - self.scene_bb[0]) / 2, self.scene_bb[1] + (self.scene_bb[3] - self.scene_bb[1]) / 2)
        dx = self.scene_bb[2] - self.scene_center[0]
        dy = self.scene_bb[3] - self.scene_center[1]
        self.radius = math.sqrt(math.pow(dx,2) + math.pow(dy, 2))
开发者ID:bhitov,项目名称:firemix,代码行数:10,代码来源:radial_wipe.py

示例2: setup

# 需要导入模块: from lib.buffer_utils import BufferUtils [as 别名]
# 或者: from lib.buffer_utils.BufferUtils import get_buffer_size [as 别名]
    def setup(self):
        self.num_strands, self.num_pixels = BufferUtils.get_buffer_size(self._app)

        bb = self._app.scene.get_fixture_bounding_box()
        self.scene_center = np.asarray([bb[0] + (bb[2] - bb[0]) / 2, bb[1] + (bb[3] - bb[1]) / 2])
        self.bb = bb

        self.reset()
开发者ID:bhitov,项目名称:firemix,代码行数:10,代码来源:wipe.py

示例3: setup

# 需要导入模块: from lib.buffer_utils import BufferUtils [as 别名]
# 或者: from lib.buffer_utils.BufferUtils import get_buffer_size [as 别名]
    def setup(self):
        self.x, self.y = BufferUtils.get_buffer_size(self._app)

        self.pixel_locations = self._app.scene.get_all_pixel_locations()
        self.pixel_addr = {}
        for pixel, _ in self.pixel_locations:
            self.pixel_addr[pixel] = BufferUtils.get_buffer_address(self._app, pixel)

        self.reset()
开发者ID:underwatercolor,项目名称:firemix,代码行数:11,代码来源:additive_blend.py

示例4: reset

# 需要导入模块: from lib.buffer_utils import BufferUtils [as 别名]
# 或者: from lib.buffer_utils.BufferUtils import get_buffer_size [as 别名]
    def reset(self):
        self.buffer_size = BufferUtils.get_buffer_size()
        self.mask = np.tile(False, self.buffer_size)

        np.random.seed()
        self.rand_index = np.arange(self.buffer_size)
        np.random.shuffle(self.rand_index)

        self.last_idx = 0
开发者ID:Openlights,项目名称:firemix,代码行数:11,代码来源:fuzz.py

示例5: reset

# 需要导入模块: from lib.buffer_utils import BufferUtils [as 别名]
# 或者: from lib.buffer_utils.BufferUtils import get_buffer_size [as 别名]
    def reset(self):
        x, y = BufferUtils.get_buffer_size(self._app)
        self.mask = np.tile(False, (x, y, 3))

        np.random.seed()
        self.rand_index = np.arange(len(self.fixtures))
        np.random.shuffle(self.rand_index)

        self.last_idx = 0
开发者ID:underwatercolor,项目名称:firemix,代码行数:11,代码来源:fixture_step.py

示例6: reset

# 需要导入模块: from lib.buffer_utils import BufferUtils [as 别名]
# 或者: from lib.buffer_utils.BufferUtils import get_buffer_size [as 别名]
    def reset(self):
        x, y = BufferUtils.get_buffer_size(self._app)
        self.mask = np.tile(False, (x, y, 3))

        num_elements = np.ndarray.flatten(self.mask).size
        np.random.seed()
        self.rand_index = np.arange(num_elements)
        np.random.shuffle(self.rand_index)

        self.last_idx = 0
开发者ID:bhitov,项目名称:firemix,代码行数:12,代码来源:fuzz.py

示例7: reset

# 需要导入模块: from lib.buffer_utils import BufferUtils [as 别名]
# 或者: from lib.buffer_utils.BufferUtils import get_buffer_size [as 别名]
    def reset(self):
        self.fixtures = self._app.scene.fixtures()
        buffer_size = BufferUtils.get_buffer_size()
        self.mask = np.tile(False, (buffer_size, 3))

        np.random.seed()
        self.rand_index = np.arange(len(self.fixtures))
        np.random.shuffle(self.rand_index)

        self.last_idx = 0
开发者ID:tibbon,项目名称:firemix,代码行数:12,代码来源:fixture_strobe.py

示例8: setup

# 需要导入模块: from lib.buffer_utils import BufferUtils [as 别名]
# 或者: from lib.buffer_utils.BufferUtils import get_buffer_size [as 别名]
    def setup(self):
        self.num_strands, self.num_pixels = BufferUtils.get_buffer_size(self._app)

        self.scene_bb = self._app.scene.get_fixture_bounding_box()
        self.scene_center = (self.scene_bb[0] + (self.scene_bb[2] - self.scene_bb[0]) / 2, self.scene_bb[1] + (self.scene_bb[3] - self.scene_bb[1]) / 2)
        dx = self.scene_bb[2] - self.scene_center[0]
        dy = self.scene_bb[3] - self.scene_center[1]
        self.scene_radius = sqrt(pow(dx,2) + pow(dy, 2))

        self.locations = self._app.scene.get_all_pixel_locations()
        self.buffer_addr = {}
        self.angles = {}
        self.radii = {}
        for pixel, location in self.locations:
            self.buffer_addr[pixel] = BufferUtils.get_buffer_address(self._app, pixel)
            dy = location[1] - self.scene_center[1]
            dx = location[0] - self.scene_center[0]
            angle = (atan2(dy, dx) + pi) / (2.0 * pi)
            self.radii[pixel] = sqrt(pow(dx,2) + pow(dy, 2))
            self.angles[pixel] = angle
开发者ID:bhitov,项目名称:firemix,代码行数:22,代码来源:spiral.py

示例9: reset

# 需要导入模块: from lib.buffer_utils import BufferUtils [as 别名]
# 或者: from lib.buffer_utils.BufferUtils import get_buffer_size [as 别名]
    def reset(self):
        self.buffer_size = BufferUtils.get_buffer_size()

        self.scene_bb = self._app.scene.get_fixture_bounding_box()
        self.scene_center = (self.scene_bb[0] + (self.scene_bb[2] - self.scene_bb[0]) / 2, self.scene_bb[1] + (self.scene_bb[3] - self.scene_bb[1]) / 2)
        dx = self.scene_bb[2] - self.scene_center[0]
        dy = self.scene_bb[3] - self.scene_center[1]
        self.scene_radius = sqrt(pow(dx,2) + pow(dy, 2))

        self.locations = self._app.scene.get_all_pixel_locations()
        self.angles = {}
        self.radii = {}
        for pixel, location in enumerate(self.locations):
            dy = location[1] - self.scene_center[1]
            dx = location[0] - self.scene_center[0]
            angle = (atan2(dy, dx) + pi) / (2.0 * pi)
            self.radii[pixel] = sqrt(pow(dx,2) + pow(dy, 2))
            self.angles[pixel] = angle

        self.mask = np.tile(False, (self.buffer_size, 3))
        self.angle = 0.0
        self.radius = 0.0
        self.active = deepcopy(self.locations)
开发者ID:tobywaite,项目名称:firemix,代码行数:25,代码来源:spiral.py

示例10: reset

# 需要导入模块: from lib.buffer_utils import BufferUtils [as 别名]
# 或者: from lib.buffer_utils.BufferUtils import get_buffer_size [as 别名]
    def reset(self):
        self.buffer_size = BufferUtils.get_buffer_size()

        self.scene_bb = self._app.scene.get_fixture_bounding_box()
        self.scene_center = (self.scene_bb[0] + old_div((self.scene_bb[2] - self.scene_bb[0]), 2), self.scene_bb[1] + old_div((self.scene_bb[3] - self.scene_bb[1]), 2))
        dx = self.scene_bb[2] - self.scene_center[0]
        dy = self.scene_bb[3] - self.scene_center[1]

        self.locations = self._app.scene.get_all_pixel_locations()
        self.angles = {}
        self.radii = {}
        for pixel, location in enumerate(self.locations):
            dy = location[1] - self.scene_center[1]
            dx = location[0] - self.scene_center[0]
            angle = old_div((atan2(dy, dx) + pi), (2.0 * pi))
            self.radii[pixel] = sqrt(pow(dx,2) + pow(dy, 2))
            self.angles[pixel] = angle

        self.scene_radius = max(self.radii)

        self.mask = np.tile(False, self.buffer_size)
        self.angle = 0.0
        self.radius = 0.0
        self.active = [True,] * len(self.locations)
开发者ID:Openlights,项目名称:firemix,代码行数:26,代码来源:spiral.py

示例11: reset

# 需要导入模块: from lib.buffer_utils import BufferUtils [as 别名]
# 或者: from lib.buffer_utils.BufferUtils import get_buffer_size [as 别名]
 def reset(self):
     x, y = BufferUtils.get_buffer_size(self._app)
     self.frame = np.tile(0.0, (x, y, 3))
开发者ID:bhitov,项目名称:firemix,代码行数:5,代码来源:simplex_blend.py

示例12: reset

# 需要导入模块: from lib.buffer_utils import BufferUtils [as 别名]
# 或者: from lib.buffer_utils.BufferUtils import get_buffer_size [as 别名]
 def reset(self):
     buffer_size = BufferUtils.get_buffer_size()
     self.frame = np.tile(0.0, (buffer_size, 3))
     self.pixel_locations = self._app.scene.get_all_pixel_locations()
开发者ID:ikea-lisp-code,项目名称:firemix,代码行数:6,代码来源:simplex_blend.py

示例13: reset

# 需要导入模块: from lib.buffer_utils import BufferUtils [as 别名]
# 或者: from lib.buffer_utils.BufferUtils import get_buffer_size [as 别名]
 def reset(self):
     self.buffer_len = BufferUtils.get_buffer_size()
     self.frame = np.tile(np.array([0.0], dtype=np.float), (self.buffer_len, 3))
开发者ID:ikea-lisp-code,项目名称:firemix,代码行数:5,代码来源:additive_blend.py


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