Blender
V3.3
|
#include <Python.h>
#include "BLI_rect.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
#include "py_capi_utils.h"
#include "python_utildefines.h"
#include "imbuf_py_api.h"
#include "../../imbuf/IMB_imbuf.h"
#include "../../imbuf/IMB_imbuf_types.h"
#include "BLI_fileops.h"
#include <errno.h>
#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: pair of ints\n" " :return: the newly loaded image.\n" " :rtype: :class:`ImBuf`\n") | |
static PyObject * | M_imbuf_new (PyObject *UNUSED(self), PyObject *args, PyObject *kw) |
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: string\n" " :return: the newly loaded image.\n" " :rtype: :class:`ImBuf`\n") | |
static PyObject * | M_imbuf_load (PyObject *UNUSED(self), PyObject *args, PyObject *kw) |
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: string\n") | |
static PyObject * | M_imbuf_write (PyObject *UNUSED(self), PyObject *args, PyObject *kw) |
Type & Utilities | |
#define | PY_IMBUF_CHECK_OBJ(obj) |
#define | PY_IMBUF_CHECK_INT(obj) |
typedef struct Py_ImBuf | Py_ImBuf |
static int | py_imbuf_valid_check (Py_ImBuf *self) |
Methods | |
static struct 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: pair of ints\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: pair of ints\n" " :arg max: X, Y maximum.\n" " :type max: pair of ints\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 *UNUSED(closure)) |
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 *UNUSED(closure)) |
static int | py_imbuf_ppm_set (Py_ImBuf *self, PyObject *value, void *UNUSED(closure)) |
PyDoc_STRVAR (py_imbuf_filepath_doc, "filepath associated with this image.\n\n:type: string") | |
static PyObject * | py_imbuf_filepath_get (Py_ImBuf *self, void *UNUSED(closure)) |
static int | py_imbuf_filepath_set (Py_ImBuf *self, PyObject *value, void *UNUSED(closure)) |
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 *UNUSED(closure)) |
PyDoc_STRVAR (py_imbuf_channels_doc, "Number of bit-planes.\n\n:type: int") | |
static PyObject * | py_imbuf_channels_get (Py_ImBuf *self, void *UNUSED(closure)) |
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 struct 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 (void) |
Module Definition (<tt>imbuf.types</tt>) | |
| |
static struct 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.c.
#define PY_IMBUF_CHECK_INT | ( | obj | ) |
Definition at line 59 of file imbuf_py_api.c.
#define PY_IMBUF_CHECK_OBJ | ( | obj | ) |
Definition at line 54 of file imbuf_py_api.c.
PyObject* BPyInit_imbuf | ( | void | ) |
Definition at line 579 of file imbuf_py_api.c.
References BPyInit_imbuf_types(), IMB_module_def, and mod().
|
static |
Definition at line 623 of file imbuf_py_api.c.
References IMB_types_module_def, NULL, and Py_ImBuf_Type.
Referenced by BPyInit_imbuf().
|
static |
Definition at line 471 of file imbuf_py_api.c.
References BLI_open(), BLI_strncpy(), file, IB_rect, IMB_loadifffile(), ImBuf::name, NULL, O_BINARY, and Py_ImBuf_CreatePyObject().
|
static |
Definition at line 432 of file imbuf_py_api.c.
References IB_rect, IMB_allocImBuf(), NULL, Py_ImBuf_CreatePyObject(), size(), and UNPACK2.
|
static |
Definition at line 517 of file imbuf_py_api.c.
References IB_rect, Py_ImBuf::ibuf, IMB_saveiff(), ImBuf::name, NULL, and Py_ImBuf_Type.
Definition at line 297 of file imbuf_py_api.c.
References ImBuf::channels, and PY_IMBUF_CHECK_OBJ.
|
static |
Definition at line 172 of file imbuf_py_api.c.
References IMB_dupImBuf(), NULL, PY_IMBUF_CHECK_OBJ, Py_ImBuf_CreatePyObject(), self, and UNLIKELY.
Referenced by py_imbuf_deepcopy().
|
static |
Definition at line 410 of file imbuf_py_api.c.
References Py_ImBuf_Type.
Referenced by M_imbuf_load(), M_imbuf_new(), and py_imbuf_copy().
|
static |
Definition at line 133 of file imbuf_py_api.c.
References IMB_rect_crop(), NULL, PY_IMBUF_CHECK_OBJ, self, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
Definition at line 323 of file imbuf_py_api.c.
References IMB_freeImBuf(), NULL, and self.
|
static |
Definition at line 186 of file imbuf_py_api.c.
References NULL, py_imbuf_copy(), and PyC_CheckArgs_DeepCopy().
Definition at line 260 of file imbuf_py_api.c.
References ImBuf::name, PY_IMBUF_CHECK_OBJ, and PyC_UnicodeFromByte().
Definition at line 267 of file imbuf_py_api.c.
References ImBuf::name, and PY_IMBUF_CHECK_INT.
|
static |
Definition at line 198 of file imbuf_py_api.c.
References IMB_freeImBuf(), NULL, and self.
|
static |
Definition at line 344 of file imbuf_py_api.c.
References self.
Definition at line 289 of file imbuf_py_api.c.
References ImBuf::planes, and PY_IMBUF_CHECK_OBJ.
Definition at line 232 of file imbuf_py_api.c.
References ImBuf::ppm, PY_IMBUF_CHECK_OBJ, and PyC_Tuple_Pack_F64.
Definition at line 239 of file imbuf_py_api.c.
References ImBuf::ppm, PY_IMBUF_CHECK_INT, and PyC_AsArray().
|
static |
Definition at line 333 of file imbuf_py_api.c.
References ImBuf::name, NULL, ImBuf::x, and ImBuf::y.
|
static |
Definition at line 80 of file imbuf_py_api.c.
References BLI_assert_unreachable, IMB_scalefastImBuf(), IMB_scaleImBuf(), NULL, PY_IMBUF_CHECK_OBJ, PyC_ParseStringEnum(), self, size(), UNPACK2, and PyC_StringEnum::value_found.
Definition at line 224 of file imbuf_py_api.c.
References PY_IMBUF_CHECK_OBJ, PyC_Tuple_Pack_I32, ImBuf::x, and ImBuf::y.
|
static |
Definition at line 43 of file imbuf_py_api.c.
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: string\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: pair of ints\n" " :return: the newly loaded image.\n" " :rtype: :class:`ImBuf`\n" | |||
) |
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: string\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:pair of ints\n" " :arg max:X | , | ||
Y maximum.\n" " :type max:pair of ints\n" | |||
) |
PyDoc_STRVAR | ( | py_imbuf_filepath_doc | , |
"filepath associated with this image.\n\n:type: string" | |||
) |
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: pair of ints\n" " :arg method: Method of resizing ('FAST', 'BILINEAR')\n" " :type method: str\n" | |||
) |
PyDoc_STRVAR | ( | py_imbuf_size_doc | , |
"size of the image in pixels.\n\n:type: pair of ints" | |||
) |
|
static |
Definition at line 555 of file imbuf_py_api.c.
|
static |
Definition at line 562 of file imbuf_py_api.c.
Referenced by BPyInit_imbuf().
|
static |
Definition at line 603 of file imbuf_py_api.c.
Referenced by BPyInit_imbuf_types().
|
static |
Definition at line 304 of file imbuf_py_api.c.
|
static |
Definition at line 198 of file imbuf_py_api.c.
PyTypeObject Py_ImBuf_Type |
Definition at line 349 of file imbuf_py_api.c.
Referenced by BPyInit_imbuf_types(), M_imbuf_write(), and Py_ImBuf_CreatePyObject().