Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/gpu/gpu_py_framebuffer.c
| Show First 20 Lines • Show All 415 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| PyDoc_STRVAR(pygpu_framebuffer_viewport_set_doc, | PyDoc_STRVAR(pygpu_framebuffer_viewport_set_doc, | ||||
| ".. function:: viewport_set(x, y, xsize, ysize)\n" | ".. function:: viewport_set(x, y, xsize, ysize)\n" | ||||
| "\n" | "\n" | ||||
| " Set the viewport for this framebuffer object.\n" | " Set the viewport for this framebuffer object.\n" | ||||
| " Note: The viewport state is not saved upon framebuffer rebind.\n" | " Note: The viewport state is not saved upon framebuffer rebind.\n" | ||||
| "\n" | "\n" | ||||
| " :param x, y: lower left corner of the viewport_set rectangle, in pixels.\n" | " :arg x, y: lower left corner of the viewport_set rectangle, in pixels.\n" | ||||
| " :param xsize, ysize: width and height of the viewport_set.\n" | " :type x, y: int\n" | ||||
| " :type x, y, xsize, ysize: int\n"); | " :arg xsize, ysize: width and height of the viewport_set.\n" | ||||
| " :type xsize, ysize: int\n"); | |||||
| static PyObject *pygpu_framebuffer_viewport_set(BPyGPUFrameBuffer *self, | static PyObject *pygpu_framebuffer_viewport_set(BPyGPUFrameBuffer *self, | ||||
| PyObject *args, | PyObject *args, | ||||
| void *UNUSED(type)) | void *UNUSED(type)) | ||||
| { | { | ||||
| int x, y, xsize, ysize; | int x, y, xsize, ysize; | ||||
| if (!PyArg_ParseTuple(args, "iiii:viewport_set", &x, &y, &xsize, &ysize)) { | if (!PyArg_ParseTuple(args, "iiii:viewport_set", &x, &y, &xsize, &ysize)) { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| Show All 22 Lines | |||||
| } | } | ||||
| PyDoc_STRVAR( | PyDoc_STRVAR( | ||||
| pygpu_framebuffer_read_color_doc, | pygpu_framebuffer_read_color_doc, | ||||
| ".. function:: read_color(x, y, xsize, ysize, channels, slot, format, data=data)\n" | ".. function:: read_color(x, y, xsize, ysize, channels, slot, format, data=data)\n" | ||||
| "\n" | "\n" | ||||
| " Read a block of pixels from the frame buffer.\n" | " Read a block of pixels from the frame buffer.\n" | ||||
| "\n" | "\n" | ||||
| " :param x, y: Lower left corner of a rectangular block of pixels.\n" | " :arg x, y: Lower left corner of a rectangular block of pixels.\n" | ||||
| " :param xsize, ysize: Dimensions of the pixel rectangle.\n" | " :arg xsize, ysize: Dimensions of the pixel rectangle.\n" | ||||
| " :type x, y, xsize, ysize: int\n" | " :type x, y, xsize, ysize: int\n" | ||||
| " :param channels: Number of components to read.\n" | " :arg channels: Number of components to read.\n" | ||||
| " :type channels: int\n" | " :type channels: int\n" | ||||
| " :param slot: The framebuffer slot to read data from.\n" | " :arg slot: The framebuffer slot to read data from.\n" | ||||
| " :type slot: int\n" | " :type slot: int\n" | ||||
| " :param format: The format that describes the content of a single channel.\n" | " :arg format: The format that describes the content of a single channel.\n" | ||||
| " Possible values are `FLOAT`, `INT`, `UINT`, `UBYTE`, `UINT_24_8` and `10_11_11_REV`.\n" | " Possible values are `FLOAT`, `INT`, `UINT`, `UBYTE`, `UINT_24_8` and `10_11_11_REV`.\n" | ||||
| " :type type: str\n" | " :type format: str\n" | ||||
| " :arg data: Optional Buffer object to fill with the pixels values.\n" | " :arg data: Optional Buffer object to fill with the pixels values.\n" | ||||
| " :type data: :class:`gpu.types.Buffer`\n" | " :type data: :class:`gpu.types.Buffer`\n" | ||||
| " :return: The Buffer with the read pixels.\n" | " :return: The Buffer with the read pixels.\n" | ||||
| " :rtype: :class:`gpu.types.Buffer`\n"); | " :rtype: :class:`gpu.types.Buffer`\n"); | ||||
| static PyObject *pygpu_framebuffer_read_color(BPyGPUFrameBuffer *self, | static PyObject *pygpu_framebuffer_read_color(BPyGPUFrameBuffer *self, | ||||
| PyObject *args, | PyObject *args, | ||||
| PyObject *kwds) | PyObject *kwds) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | static PyObject *pygpu_framebuffer_read_color(BPyGPUFrameBuffer *self, | ||||
| return (PyObject *)py_buffer; | return (PyObject *)py_buffer; | ||||
| } | } | ||||
| PyDoc_STRVAR(pygpu_framebuffer_read_depth_doc, | PyDoc_STRVAR(pygpu_framebuffer_read_depth_doc, | ||||
| ".. function:: read_depth(x, y, xsize, ysize, data=data)\n" | ".. function:: read_depth(x, y, xsize, ysize, data=data)\n" | ||||
| "\n" | "\n" | ||||
| " Read a pixel depth block from the frame buffer.\n" | " Read a pixel depth block from the frame buffer.\n" | ||||
| "\n" | "\n" | ||||
| " :param x, y: Lower left corner of a rectangular block of pixels.\n" | " :arg x, y: Lower left corner of a rectangular block of pixels.\n" | ||||
| " :param xsize, ysize: Dimensions of the pixel rectangle.\n" | " :type x, y: int\n" | ||||
| " :type x, y, xsize, ysize: int\n" | " :arg xsize, ysize: Dimensions of the pixel rectangle.\n" | ||||
| " :type xsize, ysize: int\n" | |||||
| " :arg data: Optional Buffer object to fill with the pixels values.\n" | " :arg data: Optional Buffer object to fill with the pixels values.\n" | ||||
| " :type data: :class:`gpu.types.Buffer`\n" | " :type data: :class:`gpu.types.Buffer`\n" | ||||
| " :return: The Buffer with the read pixels.\n" | " :return: The Buffer with the read pixels.\n" | ||||
| " :rtype: :class:`gpu.types.Buffer`\n"); | " :rtype: :class:`gpu.types.Buffer`\n"); | ||||
| static PyObject *pygpu_framebuffer_read_depth(BPyGPUFrameBuffer *self, | static PyObject *pygpu_framebuffer_read_depth(BPyGPUFrameBuffer *self, | ||||
| PyObject *args, | PyObject *args, | ||||
| PyObject *kwds) | PyObject *kwds) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 169 Lines • Show Last 20 Lines | |||||