|
Blender
V2.93
|
#include <Python.h>#include "mathutils.h"#include "BLI_math.h"#include "BLI_utildefines.h"#include "../generic/py_capi_utils.h"#include "../generic/python_utildefines.h"#include "BLI_dynstr.h"Go to the source code of this file.
Macros | |
| #define | COLOR_SIZE 3 |
Functions | |
| static PyObject * | Color_new (PyTypeObject *type, PyObject *args, PyObject *kwds) |
| static PyObject * | Color_ToTupleExt (ColorObject *self, int ndigits) |
| PyDoc_STRVAR (Color_copy_doc, ".. function:: copy()\n" "\n" " Returns a copy of this color.\n" "\n" " :return: A copy of the color.\n" " :rtype: :class:`Color`\n" "\n" " .. note:: use this to get a copy of a wrapped color with\n" " no reference to the original data.\n") | |
| static PyObject * | Color_copy (ColorObject *self) |
| static PyObject * | Color_deepcopy (ColorObject *self, PyObject *args) |
| static PyObject * | Color_repr (ColorObject *self) |
| static PyObject * | Color_str (ColorObject *self) |
| static PyObject * | Color_richcmpr (PyObject *a, PyObject *b, int op) |
| static Py_hash_t | Color_hash (ColorObject *self) |
| static int | Color_len (ColorObject *UNUSED(self)) |
| static PyObject * | Color_item (ColorObject *self, int i) |
| static int | Color_ass_item (ColorObject *self, int i, PyObject *value) |
| static PyObject * | Color_slice (ColorObject *self, int begin, int end) |
| static int | Color_ass_slice (ColorObject *self, int begin, int end, PyObject *seq) |
| static PyObject * | Color_subscript (ColorObject *self, PyObject *item) |
| static int | Color_ass_subscript (ColorObject *self, PyObject *item, PyObject *value) |
| static PyObject * | Color_add (PyObject *v1, PyObject *v2) |
| static PyObject * | Color_iadd (PyObject *v1, PyObject *v2) |
| static PyObject * | Color_sub (PyObject *v1, PyObject *v2) |
| static PyObject * | Color_isub (PyObject *v1, PyObject *v2) |
| static PyObject * | color_mul_float (ColorObject *color, const float scalar) |
| static PyObject * | Color_mul (PyObject *v1, PyObject *v2) |
| static PyObject * | Color_div (PyObject *v1, PyObject *v2) |
| static PyObject * | Color_imul (PyObject *v1, PyObject *v2) |
| static PyObject * | Color_idiv (PyObject *v1, PyObject *v2) |
| static PyObject * | Color_neg (ColorObject *self) |
| PyDoc_STRVAR (Color_channel_r_doc, "Red color channel.\n\n:type: float") | |
| PyDoc_STRVAR (Color_channel_g_doc, "Green color channel.\n\n:type: float") | |
| PyDoc_STRVAR (Color_channel_b_doc, "Blue color channel.\n\n:type: float") | |
| static PyObject * | Color_channel_get (ColorObject *self, void *type) |
| static int | Color_channel_set (ColorObject *self, PyObject *value, void *type) |
| PyDoc_STRVAR (Color_channel_hsv_h_doc, "HSV Hue component in [0, 1].\n\n:type: float") | |
| PyDoc_STRVAR (Color_channel_hsv_s_doc, "HSV Saturation component in [0, 1].\n\n:type: float") | |
| PyDoc_STRVAR (Color_channel_hsv_v_doc, "HSV Value component in [0, 1].\n\n:type: float") | |
| static PyObject * | Color_channel_hsv_get (ColorObject *self, void *type) |
| static int | Color_channel_hsv_set (ColorObject *self, PyObject *value, void *type) |
| PyDoc_STRVAR (Color_hsv_doc, "HSV Values in [0, 1].\n\n:type: float triplet") | |
| static PyObject * | Color_hsv_get (ColorObject *self, void *UNUSED(closure)) |
| static int | Color_hsv_set (ColorObject *self, PyObject *value, void *UNUSED(closure)) |
| PyDoc_STRVAR (color_doc, ".. class:: Color(rgb)\n" "\n" " This object gives access to Colors in Blender.\n" "\n" " :param rgb: (r, g, b) color values\n" " :type rgb: 3d vector\n") | |
| PyObject * | Color_CreatePyObject (const float col[3], PyTypeObject *base_type) |
| PyObject * | Color_CreatePyObject_wrap (float col[3], PyTypeObject *base_type) |
| PyObject * | Color_CreatePyObject_cb (PyObject *cb_user, uchar cb_type, uchar cb_subtype) |
Variables | |
| static PySequenceMethods | Color_SeqMethods |
| static PyMappingMethods | Color_AsMapping |
| static PyNumberMethods | Color_NumMethods |
| static PyGetSetDef | Color_getseters [] |
| static struct PyMethodDef | Color_methods [] |
| PyTypeObject | color_Type |
| #define COLOR_SIZE 3 |
Definition at line 35 of file mathutils_Color.c.
|
static |
Definition at line 428 of file mathutils_Color.c.
References add_vn_vnvn(), BaseMath_ReadCallback, col, Color_CreatePyObject(), COLOR_SIZE, ColorObject_Check, NULL, v1, and v2.
|
static |
Definition at line 239 of file mathutils_Color.c.
References BaseMath_Prepare_ForWrite, BaseMath_WriteIndexCallback, and COLOR_SIZE.
Referenced by Color_ass_subscript(), and Color_channel_set().
|
static |
Definition at line 301 of file mathutils_Color.c.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, CLAMP, col, COLOR_SIZE, mathutils_array_parse(), MIN2, and size().
Referenced by Color_ass_subscript().
|
static |
Definition at line 373 of file mathutils_Color.c.
References Color_ass_item(), Color_ass_slice(), and COLOR_SIZE.
|
static |
Definition at line 734 of file mathutils_Color.c.
References Color_item(), POINTER_AS_INT, and type.
|
static |
Definition at line 749 of file mathutils_Color.c.
References BaseMath_ReadCallback, NULL, POINTER_AS_INT, rgb_to_hsv(), self, and type.
|
static |
Definition at line 763 of file mathutils_Color.c.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, CLAMP, hsv_to_rgb_v(), POINTER_AS_INT, rgb_to_hsv_v(), self, and type.
|
static |
Definition at line 739 of file mathutils_Color.c.
References Color_ass_item(), POINTER_AS_INT, and type.
|
static |
Definition at line 103 of file mathutils_Color.c.
References BaseMath_ReadCallback, Color_CreatePyObject(), NULL, and self.
Referenced by Color_deepcopy().
| PyObject* Color_CreatePyObject | ( | const float | col[3], |
| PyTypeObject * | base_type | ||
| ) |
Definition at line 944 of file mathutils_Color.c.
References BASE_MATH_FLAG_DEFAULT, BASE_MATH_NEW, col, COLOR_SIZE, color_Type, copy_v3_v3(), NULL, self, UNLIKELY, and zero_v3().
Referenced by Color_add(), Color_copy(), Color_CreatePyObject_cb(), color_mul_float(), Color_neg(), Color_new(), Color_sub(), and pyrna_math_object_from_array().
Definition at line 1000 of file mathutils_Color.c.
References Color_CreatePyObject(), and NULL.
Referenced by pyrna_math_object_from_array(), and StrokeAttribute_color_get().
| PyObject* Color_CreatePyObject_wrap | ( | float | col[3], |
| PyTypeObject * | base_type | ||
| ) |
Definition at line 982 of file mathutils_Color.c.
References BASE_MATH_FLAG_DEFAULT, BASE_MATH_FLAG_IS_WRAP, BASE_MATH_NEW, col, color_Type, and NULL.
|
static |
Definition at line 111 of file mathutils_Color.c.
References Color_copy(), NULL, and PyC_CheckArgs_DeepCopy().
|
static |
Definition at line 584 of file mathutils_Color.c.
References BaseMath_ReadCallback, color_mul_float(), ColorObject_Check, NULL, v1, and v2.
|
static |
Definition at line 196 of file mathutils_Color.c.
References BaseMath_ReadCallback, BaseMathObject_Prepare_ForHash, COLOR_SIZE, mathutils_array_hash(), and self.
|
static |
Definition at line 794 of file mathutils_Color.c.
References BaseMath_ReadCallback, NULL, PyTuple_SET_ITEMS, ret, rgb_to_hsv(), and self.
|
static |
Definition at line 811 of file mathutils_Color.c.
References BaseMath_Prepare_ForWrite, BaseMath_WriteCallback, clamp_v3(), hsv_to_rgb_v(), mathutils_array_parse(), and self.
|
static |
Definition at line 454 of file mathutils_Color.c.
References add_vn_vn(), BaseMath_ReadCallback, BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, COLOR_SIZE, ColorObject_Check, NULL, v1, and v2.
|
static |
Definition at line 646 of file mathutils_Color.c.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, COLOR_SIZE, mul_vn_fl(), NULL, v1, and v2.
|
static |
Definition at line 618 of file mathutils_Color.c.
References BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, COLOR_SIZE, mul_vn_fl(), NULL, v1, and v2.
|
static |
Definition at line 507 of file mathutils_Color.c.
References BaseMath_ReadCallback, BaseMath_ReadCallback_ForWrite, BaseMath_WriteCallback, COLOR_SIZE, ColorObject_Check, NULL, sub_vn_vn(), v1, and v2.
|
static |
Definition at line 218 of file mathutils_Color.c.
References BaseMath_ReadIndexCallback, COLOR_SIZE, NULL, and self.
Referenced by Color_channel_get(), and Color_subscript().
|
static |
Definition at line 212 of file mathutils_Color.c.
References COLOR_SIZE.
|
static |
Definition at line 540 of file mathutils_Color.c.
References BaseMath_ReadCallback, BLI_assert, color_mul_float(), ColorObject_Check, NULL, v1, and v2.
|
static |
Definition at line 533 of file mathutils_Color.c.
References Color_CreatePyObject(), COLOR_SIZE, and mul_vn_vn_fl().
Referenced by Color_div(), and Color_mul().
|
static |
Definition at line 680 of file mathutils_Color.c.
References BaseMath_ReadCallback, Color_CreatePyObject(), COLOR_SIZE, negate_vn_vn(), NULL, and self.
|
static |
Definition at line 39 of file mathutils_Color.c.
References col, Color_CreatePyObject(), COLOR_SIZE, mathutils_array_parse(), NULL, and type.
|
static |
Definition at line 122 of file mathutils_Color.c.
References BaseMath_ReadCallback, Color_ToTupleExt(), NULL, and ret.
|
static |
Definition at line 158 of file mathutils_Color.c.
References Freestyle::a, ATTR_FALLTHROUGH, BaseMath_ReadCallback, COLOR_SIZE, ColorObject_Check, EXPP_VectorsAreEqual(), and NULL.
|
static |
Definition at line 276 of file mathutils_Color.c.
References BaseMath_ReadCallback, CLAMP, COLOR_SIZE, count, MIN2, NULL, and self.
Referenced by Color_subscript().
|
static |
Definition at line 139 of file mathutils_Color.c.
References BaseMath_ReadCallback, BLI_dynstr_appendf(), BLI_dynstr_new(), mathutils_dynstr_to_py(), NULL, and self.
|
static |
Definition at line 481 of file mathutils_Color.c.
References BaseMath_ReadCallback, col, Color_CreatePyObject(), COLOR_SIZE, ColorObject_Check, NULL, sub_vn_vnvn(), v1, and v2.
|
static |
Definition at line 337 of file mathutils_Color.c.
References Color_item(), COLOR_SIZE, Color_slice(), and NULL.
|
static |
Definition at line 72 of file mathutils_Color.c.
References COLOR_SIZE, double_round(), ret, and self.
Referenced by Color_repr().
| PyDoc_STRVAR | ( | Color_channel_b_doc | , |
| "Blue color channel.\n\n:type: float" | |||
| ) |
| PyDoc_STRVAR | ( | Color_channel_g_doc | , |
| "Green color channel.\n\n:type: float" | |||
| ) |
| PyDoc_STRVAR | ( | Color_channel_hsv_s_doc | , |
| "HSV Saturation component in .\n\n:type: float" | [0, 1] | ||
| ) |
| PyDoc_STRVAR | ( | Color_channel_r_doc | , |
| "Red color channel.\n\n:type: float" | |||
| ) |
| PyDoc_STRVAR | ( | Color_copy_doc | , |
| ".. function:: copy()\n" "\n" " Returns a copy of this color.\n" "\n" " :return: A copy of the color.\n" " :rtype: :class:`Color`\n" "\n" " .. note:: use this to get a copy of a wrapped color with\n" " no reference to the original data.\n" | |||
| ) |
| PyDoc_STRVAR | ( | color_doc | , |
| ".. class:: Color(rgb)\n" "\n" " This object gives access to Colors in Blender.\n" "\n" " :param rgb: (r, g, b) color values\n" " :type rgb: 3d vector\n" | |||
| ) |
| PyDoc_STRVAR | ( | Color_hsv_doc | , |
| "HSV Values in .\n\n:type: float triplet" | [0, 1] | ||
| ) |
|
static |
Definition at line 419 of file mathutils_Color.c.
|
static |
Definition at line 836 of file mathutils_Color.c.
|
static |
Definition at line 836 of file mathutils_Color.c.
|
static |
Definition at line 692 of file mathutils_Color.c.
|
static |
Definition at line 406 of file mathutils_Color.c.
| PyTypeObject color_Type |
Definition at line 892 of file mathutils_Color.c.
Referenced by Color_CreatePyObject(), Color_CreatePyObject_wrap(), and PyInit_mathutils().