|
Blender V4.3
|
#include <Python.h>#include "BLI_rect.h"#include "BLI_string.h"#include "BLI_utildefines.h"#include "py_capi_utils.hh"#include "python_compat.hh"#include "python_utildefines.hh"#include "imbuf_py_api.hh"#include "../../imbuf/IMB_imbuf.hh"#include "../../imbuf/IMB_imbuf_types.hh"#include "BLI_fileops.h"#include <cerrno>#include <fcntl.h>Go to the source code of this file.
Classes | |
| struct | Py_ImBuf |
Functions | |
Module Functions | |
| PyDoc_STRVAR (M_imbuf_new_doc, ".. function:: new(size)\n" "\n" " Load a new image.\n" "\n" " :arg size: The size of the image in pixels.\n" " :type size: tuple[int, int]\n" " :return: the newly loaded image.\n" " :rtype: :class:`ImBuf`\n") | |
| static PyObject * | M_imbuf_new (PyObject *, PyObject *args, PyObject *kw) |
| static PyObject * | imbuf_load_impl (const char *filepath) |
| PyDoc_STRVAR (M_imbuf_load_doc, ".. function:: load(filepath)\n" "\n" " Load an image from a file.\n" "\n" " :arg filepath: the filepath of the image.\n" " :type filepath: str | bytes\n" " :return: the newly loaded image.\n" " :rtype: :class:`ImBuf`\n") | |
| static PyObject * | M_imbuf_load (PyObject *, PyObject *args, PyObject *kw) |
| static PyObject * | imbuf_write_impl (ImBuf *ibuf, const char *filepath) |
| PyDoc_STRVAR (M_imbuf_write_doc, ".. function:: write(image, filepath=image.filepath)\n" "\n" " Write an image.\n" "\n" " :arg image: the image to write.\n" " :type image: :class:`ImBuf`\n" " :arg filepath: Optional filepath of the image (fallback to the images file path).\n" " :type filepath: str | bytes | None\n") | |
| static PyObject * | M_imbuf_write (PyObject *, PyObject *args, PyObject *kw) |
Type & Utilities | |
| #define | PY_IMBUF_CHECK_OBJ(obj) |
| #define | PY_IMBUF_CHECK_INT(obj) |
| static int | py_imbuf_valid_check (Py_ImBuf *self) |
Methods | |
| static PyMethodDef | Py_ImBuf_methods [] |
| PyDoc_STRVAR (py_imbuf_resize_doc, ".. method:: resize(size, method='FAST')\n" "\n" " Resize the image.\n" "\n" " :arg size: New size.\n" " :type size: tuple[int, int]\n" " :arg method: Method of resizing ('FAST', 'BILINEAR')\n" " :type method: str\n") | |
| static PyObject * | py_imbuf_resize (Py_ImBuf *self, PyObject *args, PyObject *kw) |
| PyDoc_STRVAR (py_imbuf_crop_doc, ".. method:: crop(min, max)\n" "\n" " Crop the image.\n" "\n" " :arg min: X, Y minimum.\n" " :type min: tuple[int, int]\n" " :arg max: X, Y maximum.\n" " :type max: tuple[int, int]\n") | |
| static PyObject * | py_imbuf_crop (Py_ImBuf *self, PyObject *args, PyObject *kw) |
| PyDoc_STRVAR (py_imbuf_copy_doc, ".. method:: copy()\n" "\n" " :return: A copy of the image.\n" " :rtype: :class:`ImBuf`\n") | |
| static PyObject * | py_imbuf_copy (Py_ImBuf *self) |
| static PyObject * | py_imbuf_deepcopy (Py_ImBuf *self, PyObject *args) |
| PyDoc_STRVAR (py_imbuf_free_doc, ".. method:: free()\n" "\n" " Clear image data immediately (causing an error on re-use).\n") | |
| static PyObject * | py_imbuf_free (Py_ImBuf *self) |
Attributes | |
| static PyGetSetDef | Py_ImBuf_getseters [] |
| PyDoc_STRVAR (py_imbuf_size_doc, "size of the image in pixels.\n" "\n" ":type: pair of ints") | |
| static PyObject * | py_imbuf_size_get (Py_ImBuf *self, void *) |
| PyDoc_STRVAR (py_imbuf_ppm_doc, "pixels per meter.\n" "\n" ":type: pair of floats") | |
| static PyObject * | py_imbuf_ppm_get (Py_ImBuf *self, void *) |
| static int | py_imbuf_ppm_set (Py_ImBuf *self, PyObject *value, void *) |
| PyDoc_STRVAR (py_imbuf_filepath_doc, "filepath associated with this image.\n" "\n" ":type: str") | |
| static PyObject * | py_imbuf_filepath_get (Py_ImBuf *self, void *) |
| static int | py_imbuf_filepath_set (Py_ImBuf *self, PyObject *value, void *) |
| PyDoc_STRVAR (py_imbuf_planes_doc, "Number of bits associated with this image.\n" "\n" ":type: int") | |
| static PyObject * | py_imbuf_planes_get (Py_ImBuf *self, void *) |
| PyDoc_STRVAR (py_imbuf_channels_doc, "Number of bit-planes.\n" "\n" ":type: int") | |
| static PyObject * | py_imbuf_channels_get (Py_ImBuf *self, void *) |
Type & Implementation | |
| PyTypeObject | Py_ImBuf_Type |
| static PyObject * | Py_ImBuf_CreatePyObject (ImBuf *ibuf) |
| static void | py_imbuf_dealloc (Py_ImBuf *self) |
| static PyObject * | py_imbuf_repr (Py_ImBuf *self) |
| static Py_hash_t | py_imbuf_hash (Py_ImBuf *self) |
Module Definition (<tt>imbuf</tt>) | |
| static PyMethodDef | IMB_methods [] |
| static PyModuleDef | IMB_module_def |
| PyDoc_STRVAR (IMB_doc, "This module provides access to Blender's image manipulation API.\n" "\n" "It provides access to image buffers outside of Blender's\n" ":class:`bpy.types.Image` data-block context.\n") | |
| PyObject * | BPyInit_imbuf () |
Module Definition (<tt>imbuf.types</tt>) | |
| |
| static PyModuleDef | IMB_types_module_def |
| static PyObject * | BPyInit_imbuf_types (void) |
| PyDoc_STRVAR (IMB_types_doc, "This module provides access to image buffer types.\n" "\n" ".. note::\n" "\n" " Image buffer is also the structure used by :class:`bpy.types.Image`\n" " ID type to store and manipulate image data at runtime.\n") | |
This file defines the 'imbuf' image manipulation module.
Definition in file imbuf_py_api.cc.
| #define PY_IMBUF_CHECK_INT | ( | obj | ) |
Definition at line 62 of file imbuf_py_api.cc.
Referenced by py_imbuf_filepath_set(), and py_imbuf_ppm_set().
| #define PY_IMBUF_CHECK_OBJ | ( | obj | ) |
Definition at line 57 of file imbuf_py_api.cc.
Referenced by py_imbuf_channels_get(), py_imbuf_copy(), py_imbuf_crop(), py_imbuf_filepath_get(), py_imbuf_planes_get(), py_imbuf_ppm_get(), py_imbuf_resize(), and py_imbuf_size_get().
| PyObject * BPyInit_imbuf | ( | ) |
Definition at line 665 of file imbuf_py_api.cc.
References BPyInit_imbuf_types(), IMB_module_def, and mod().
|
static |
Definition at line 711 of file imbuf_py_api.cc.
References IMB_types_module_def, and Py_ImBuf_Type.
Referenced by BPyInit_imbuf().
|
static |
Definition at line 509 of file imbuf_py_api.cc.
References BLI_open(), ImBuf::filepath, IB_rect, IMB_loadifffile(), O_BINARY, Py_ImBuf_CreatePyObject(), and STRNCPY.
Referenced by M_imbuf_load().
|
static |
Definition at line 566 of file imbuf_py_api.cc.
References IB_rect, and IMB_saveiff().
Referenced by M_imbuf_write().
|
static |
Definition at line 543 of file imbuf_py_api.cc.
References imbuf_load_impl(), PY_ARG_PARSER_HEAD_COMPAT, PyC_ParseUnicodeAsBytesAndSize(), result, PyC_UnicodeAsBytesAndSize_Data::value, and PyC_UnicodeAsBytesAndSize_Data::value_coerce.
|
static |
Definition at line 478 of file imbuf_py_api.cc.
References IB_rect, IMB_allocImBuf(), PY_ARG_PARSER_HEAD_COMPAT, Py_ImBuf_CreatePyObject(), and UNPACK2.
|
static |
Definition at line 588 of file imbuf_py_api.cc.
References ImBuf::filepath, Py_ImBuf::ibuf, imbuf_write_impl(), PY_ARG_PARSER_HEAD_COMPAT, Py_ImBuf_Type, PyC_ParseUnicodeAsBytesAndSize_OrNone(), result, PyC_UnicodeAsBytesAndSize_Data::value, and PyC_UnicodeAsBytesAndSize_Data::value_coerce.
|
static |
Definition at line 347 of file imbuf_py_api.cc.
References ImBuf::channels, PY_IMBUF_CHECK_OBJ, and self.
|
static |
Definition at line 186 of file imbuf_py_api.cc.
References IMB_dupImBuf(), PY_IMBUF_CHECK_OBJ, Py_ImBuf_CreatePyObject(), self, and UNLIKELY.
Referenced by py_imbuf_deepcopy().
|
static |
Definition at line 454 of file imbuf_py_api.cc.
References Py_ImBuf_Type, and self.
Referenced by imbuf_load_impl(), M_imbuf_new(), and py_imbuf_copy().
|
static |
Definition at line 142 of file imbuf_py_api.cc.
References IMB_rect_crop(), PY_ARG_PARSER_HEAD_COMPAT, PY_IMBUF_CHECK_OBJ, self, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
|
static |
Definition at line 373 of file imbuf_py_api.cc.
References IMB_freeImBuf(), and self.
|
static |
Definition at line 200 of file imbuf_py_api.cc.
References py_imbuf_copy(), PyC_CheckArgs_DeepCopy(), and self.
|
static |
Definition at line 300 of file imbuf_py_api.cc.
References ImBuf::filepath, PY_IMBUF_CHECK_OBJ, PyC_UnicodeFromBytes(), and self.
Definition at line 307 of file imbuf_py_api.cc.
References ImBuf::filepath, PY_IMBUF_CHECK_INT, and self.
|
static |
Definition at line 214 of file imbuf_py_api.cc.
References IMB_freeImBuf(), and self.
|
static |
Definition at line 397 of file imbuf_py_api.cc.
References self.
|
static |
Definition at line 334 of file imbuf_py_api.cc.
References ImBuf::planes, PY_IMBUF_CHECK_OBJ, and self.
|
static |
Definition at line 267 of file imbuf_py_api.cc.
References ImBuf::ppm, PY_IMBUF_CHECK_OBJ, PyC_Tuple_Pack_F64(), and self.
Definition at line 274 of file imbuf_py_api.cc.
References ImBuf::ppm, PY_IMBUF_CHECK_INT, PyC_AsArray(), and self.
|
static |
Definition at line 383 of file imbuf_py_api.cc.
References ImBuf::filepath, self, ImBuf::x, and ImBuf::y.
|
static |
Definition at line 85 of file imbuf_py_api.cc.
References BLI_assert_unreachable, Box, IMB_scale(), Nearest, PY_ARG_PARSER_HEAD_COMPAT, PY_IMBUF_CHECK_OBJ, PyC_ParseStringEnum(), self, and UNPACK2.
|
static |
Definition at line 254 of file imbuf_py_api.cc.
References PY_IMBUF_CHECK_OBJ, PyC_Tuple_Pack_I32(), self, ImBuf::x, and ImBuf::y.
Definition at line 46 of file imbuf_py_api.cc.
| PyDoc_STRVAR | ( | IMB_doc | , |
| "This module provides access to Blender's image manipulation API.\n" "\n" "It provides access to image buffers outside of Blender's\n" ":class:`bpy.types.Image` data-block context.\n" | ) |
| PyDoc_STRVAR | ( | IMB_types_doc | , |
| "This module provides access to image buffer types.\n" "\n" ".. note::\n" "\n" " Image buffer is also the structure used by :class:`bpy.types.Image`\n" " ID type to store and manipulate image data at runtime.\n" | ) |
| PyDoc_STRVAR | ( | M_imbuf_load_doc | , |
| ".. function:: load(filepath)\n" "\n" " Load an image from a file.\n" "\n" " :arg filepath: the filepath of the image.\n" " :type filepath: str | bytes\n" " :return: the newly loaded image.\n" " :rtype: :class:`ImBuf`\n" | ) |
| PyDoc_STRVAR | ( | M_imbuf_new_doc | , |
| ".. function:: new(size)\n" "\n" " Load a new image.\n" "\n" " :arg size: The size of the image in pixels.\n" " :type size: tuple\n" " :return: the newly loaded image.\n" " :rtype: :class:`ImBuf`\n" | [int, int] ) |
| PyDoc_STRVAR | ( | M_imbuf_write_doc | , |
| ".. function:: write(image, filepath=image.filepath)\n" "\n" " Write an image.\n" "\n" " :arg image: the image to write.\n" " :type image: :class:`ImBuf`\n" " :arg filepath: Optional filepath of the image (fallback to the images file path).\n" " :type filepath: str | bytes | None\n" | ) |
| PyDoc_STRVAR | ( | py_imbuf_channels_doc | , |
| "Number of bit-planes.\n" "\n" ":type: int" | ) |
| PyDoc_STRVAR | ( | py_imbuf_copy_doc | , |
| ".. method:: copy()\n" "\n" " :return: A copy of the image.\n" " :rtype: :class:`ImBuf`\n" | ) |
| PyDoc_STRVAR | ( | py_imbuf_crop_doc | , |
| ".. method:: crop(min, max)\n" "\n" " Crop the image.\n" "\n" " :arg min: | X, | ||
| Y minimum.\n" " :type min:tuple\n" " :arg max:X | [int, int], | ||
| Y maximum.\n" " :type max:tuple\n" | [int, int] ) |
| PyDoc_STRVAR | ( | py_imbuf_filepath_doc | , |
| "filepath associated with this image.\n" "\n" ":type: str" | ) |
| PyDoc_STRVAR | ( | py_imbuf_free_doc | , |
| ".. method:: free()\n" "\n" " Clear image data immediately (causing an error on re-use).\n" | ) |
| PyDoc_STRVAR | ( | py_imbuf_planes_doc | , |
| "Number of bits associated with this image.\n" "\n" ":type: int" | ) |
| PyDoc_STRVAR | ( | py_imbuf_ppm_doc | , |
| "pixels per meter.\n" "\n" ":type: pair of floats" | ) |
| PyDoc_STRVAR | ( | py_imbuf_resize_doc | , |
| ".. method:: resize(size, method='FAST')\n" "\n" " Resize the image.\n" "\n" " :arg size: New size.\n" " :type size: tuple\n" " :arg method: Method of resizing ('FAST', 'BILINEAR')\n" " :type method: str\n" | [int, int] ) |
| PyDoc_STRVAR | ( | py_imbuf_size_doc | , |
| "size of the image in pixels.\n" "\n" ":type: pair of ints" | ) |
|
static |
Definition at line 635 of file imbuf_py_api.cc.
|
static |
Definition at line 653 of file imbuf_py_api.cc.
Referenced by BPyInit_imbuf().
|
static |
Definition at line 699 of file imbuf_py_api.cc.
Referenced by BPyInit_imbuf_types().
|
static |
Definition at line 354 of file imbuf_py_api.cc.
|
static |
Definition at line 228 of file imbuf_py_api.cc.
| PyTypeObject Py_ImBuf_Type |
Definition at line 402 of file imbuf_py_api.cc.
Referenced by BPyInit_imbuf_types(), M_imbuf_write(), and Py_ImBuf_CreatePyObject().