diff options
Diffstat (limited to 'doc/python_api/examples/gpu.9.py')
-rw-r--r-- | doc/python_api/examples/gpu.9.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/python_api/examples/gpu.9.py b/doc/python_api/examples/gpu.9.py index 84e279946da..470bd8a2dad 100644 --- a/doc/python_api/examples/gpu.9.py +++ b/doc/python_api/examples/gpu.9.py @@ -6,7 +6,8 @@ This will create a new image with the given name. If it already exists, it will override the existing one. Currently almost all of the execution time is spent in the last line. -In the future this will hopefully be solved by implementing the Python buffer protocol for `bgl.Buffer` and `Image.pixels` (aka `bpy_prop_array`). +In the future this will hopefully be solved by implementing the Python buffer protocol +for :class:`bgl.Buffer` and :class:`bpy.types.Image.pixels` (aka ``bpy_prop_array``). """ import bpy import gpu @@ -35,7 +36,6 @@ with offscreen.bind(): (random.uniform(-1, 1), random.uniform(-1, 1)), (1, 1, 1, 1), random.uniform(0.1, 1), 20) - buffer = bgl.Buffer(bgl.GL_BYTE, WIDTH * HEIGHT * 4) bgl.glReadBuffer(bgl.GL_BACK) bgl.glReadPixels(0, 0, WIDTH, HEIGHT, bgl.GL_RGBA, bgl.GL_UNSIGNED_BYTE, buffer) @@ -47,4 +47,4 @@ if not IMAGE_NAME in bpy.data.images: bpy.data.images.new(IMAGE_NAME, WIDTH, HEIGHT) image = bpy.data.images[IMAGE_NAME] image.scale(WIDTH, HEIGHT) -image.pixels = [v / 255 for v in buffer]
\ No newline at end of file +image.pixels = [v / 255 for v in buffer] |