Blender V2.61 - r43446
|
#include <Python.h>
#include "mathutils.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLI_dynstr.h"
Go to the source code of this file.
Defines | |
#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_repr (ColorObject *self) |
static PyObject * | Color_str (ColorObject *self) |
static PyObject * | Color_richcmpr (PyObject *a, PyObject *b, int op) |
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,"This object gives access to Colors in Blender.") | |
PyObject * | Color_CreatePyObject (float *col, int type, PyTypeObject *base_type) |
PyObject * | Color_CreatePyObject_cb (PyObject *cb_user, int cb_type, int 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 |
Definition in file mathutils_Color.c.
#define COLOR_SIZE 3 |
Definition at line 37 of file mathutils_Color.c.
Referenced by Color_add(), Color_ass_item(), Color_ass_slice(), Color_ass_subscript(), Color_CreatePyObject(), Color_iadd(), Color_idiv(), Color_imul(), Color_isub(), Color_item(), Color_len(), color_mul_float(), Color_neg(), Color_new(), Color_richcmpr(), Color_slice(), Color_sub(), Color_subscript(), and Color_ToTupleExt().
static PyObject* Color_add | ( | PyObject * | v1, |
PyObject * | v2 | ||
) | [static] |
Definition at line 383 of file mathutils_Color.c.
References add_vn_vnvn(), BaseMath_ReadCallback, Color_CreatePyObject(), COLOR_SIZE, ColorObject_Check, NULL, and Py_NEW.
static int Color_ass_item | ( | ColorObject * | self, |
int | i, | ||
PyObject * | value | ||
) | [static] |
Definition at line 210 of file mathutils_Color.c.
References BaseMath_WriteIndexCallback, COLOR_SIZE, and i.
Referenced by Color_ass_subscript(), and Color_channel_set().
static int Color_ass_slice | ( | ColorObject * | self, |
int | begin, | ||
int | end, | ||
PyObject * | seq | ||
) | [static] |
Definition at line 260 of file mathutils_Color.c.
References BaseMath_ReadCallback, BaseMath_WriteCallback, CLAMP(), COLOR_SIZE, i, mathutils_array_parse(), MIN2, and size().
Referenced by Color_ass_subscript().
static int Color_ass_subscript | ( | ColorObject * | self, |
PyObject * | item, | ||
PyObject * | value | ||
) | [static] |
Definition at line 327 of file mathutils_Color.c.
References Color_ass_item(), Color_ass_slice(), COLOR_SIZE, i, and step().
static PyObject* Color_channel_get | ( | ColorObject * | self, |
void * | type | ||
) | [static] |
Definition at line 677 of file mathutils_Color.c.
References Color_item(), and GET_INT_FROM_POINTER.
static PyObject* Color_channel_hsv_get | ( | ColorObject * | self, |
void * | type | ||
) | [static] |
Definition at line 692 of file mathutils_Color.c.
References BaseMath_ReadCallback, GET_INT_FROM_POINTER, i, NULL, and rgb_to_hsv().
static int Color_channel_hsv_set | ( | ColorObject * | self, |
PyObject * | value, | ||
void * | type | ||
) | [static] |
Definition at line 705 of file mathutils_Color.c.
References BaseMath_ReadCallback, BaseMath_WriteCallback, CLAMP(), GET_INT_FROM_POINTER, hsv_to_rgb(), i, and rgb_to_hsv().
static int Color_channel_set | ( | ColorObject * | self, |
PyObject * | value, | ||
void * | type | ||
) | [static] |
Definition at line 682 of file mathutils_Color.c.
References Color_ass_item(), and GET_INT_FROM_POINTER.
static PyObject* Color_copy | ( | ColorObject * | self | ) | [static] |
Definition at line 103 of file mathutils_Color.c.
References BaseMath_ReadCallback, Color_CreatePyObject(), NULL, and Py_NEW.
PyObject* Color_CreatePyObject | ( | float * | col, |
int | type, | ||
PyTypeObject * | base_type | ||
) |
Definition at line 855 of file mathutils_Color.c.
References COLOR_SIZE, copy_v3_v3(), NULL, Py_NEW, Py_WRAP, 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().
PyObject* Color_CreatePyObject_cb | ( | PyObject * | cb_user, |
int | cb_type, | ||
int | cb_subtype | ||
) |
Definition at line 888 of file mathutils_Color.c.
References Color_CreatePyObject(), and Py_NEW.
Referenced by pyrna_math_object_from_array().
static PyObject* Color_div | ( | PyObject * | v1, |
PyObject * | v2 | ||
) | [static] |
Definition at line 530 of file mathutils_Color.c.
References BaseMath_ReadCallback, color_mul_float(), ColorObject_Check, and NULL.
static PyObject* Color_hsv_get | ( | ColorObject * | self, |
void * | UNUSEDclosure | ||
) | [static] |
Definition at line 734 of file mathutils_Color.c.
References BaseMath_ReadCallback, NULL, and rgb_to_hsv().
static int Color_hsv_set | ( | ColorObject * | self, |
PyObject * | value, | ||
void * | UNUSEDclosure | ||
) | [static] |
Definition at line 751 of file mathutils_Color.c.
References BaseMath_WriteCallback, CLAMP(), hsv_to_rgb(), and mathutils_array_parse().
static PyObject* Color_iadd | ( | PyObject * | v1, |
PyObject * | v2 | ||
) | [static] |
Definition at line 407 of file mathutils_Color.c.
References add_vn_vn(), BaseMath_ReadCallback, BaseMath_WriteCallback, COLOR_SIZE, ColorObject_Check, and NULL.
static PyObject* Color_idiv | ( | PyObject * | v1, |
PyObject * | v2 | ||
) | [static] |
Definition at line 590 of file mathutils_Color.c.
References BaseMath_ReadCallback, BaseMath_WriteCallback, MakeCursor::color, COLOR_SIZE, mul_vn_fl(), and NULL.
static PyObject* Color_imul | ( | PyObject * | v1, |
PyObject * | v2 | ||
) | [static] |
Definition at line 564 of file mathutils_Color.c.
References BaseMath_ReadCallback, BaseMath_WriteCallback, MakeCursor::color, COLOR_SIZE, mul_vn_fl(), and NULL.
static PyObject* Color_isub | ( | PyObject * | v1, |
PyObject * | v2 | ||
) | [static] |
Definition at line 456 of file mathutils_Color.c.
References BaseMath_ReadCallback, BaseMath_WriteCallback, COLOR_SIZE, ColorObject_Check, NULL, and sub_vn_vn().
static PyObject* Color_item | ( | ColorObject * | self, |
int | i | ||
) | [static] |
Definition at line 191 of file mathutils_Color.c.
References BaseMath_ReadIndexCallback, COLOR_SIZE, i, and NULL.
Referenced by Color_channel_get(), and Color_subscript().
static int Color_len | ( | ColorObject * | UNUSEDself | ) | [static] |
Definition at line 185 of file mathutils_Color.c.
References COLOR_SIZE.
static PyObject* Color_mul | ( | PyObject * | v1, |
PyObject * | v2 | ||
) | [static] |
Definition at line 488 of file mathutils_Color.c.
References BaseMath_ReadCallback, BLI_assert, color_mul_float(), ColorObject_Check, and NULL.
static PyObject* color_mul_float | ( | ColorObject * | color, |
const float | scalar | ||
) | [static] |
Definition at line 480 of file mathutils_Color.c.
References Color_CreatePyObject(), COLOR_SIZE, mul_vn_vn_fl(), and Py_NEW.
Referenced by Color_div(), and Color_mul().
static PyObject* Color_neg | ( | ColorObject * | self | ) | [static] |
Definition at line 623 of file mathutils_Color.c.
References BaseMath_ReadCallback, Color_CreatePyObject(), COLOR_SIZE, negate_vn_vn(), NULL, and Py_NEW.
static PyObject* Color_new | ( | PyTypeObject * | type, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
Definition at line 41 of file mathutils_Color.c.
References Color_CreatePyObject(), COLOR_SIZE, mathutils_array_parse(), NULL, and Py_NEW.
static PyObject* Color_repr | ( | ColorObject * | self | ) | [static] |
Definition at line 114 of file mathutils_Color.c.
References BaseMath_ReadCallback, Color_ToTupleExt(), and NULL.
static PyObject* Color_richcmpr | ( | PyObject * | a, |
PyObject * | b, | ||
int | op | ||
) | [static] |
Definition at line 146 of file mathutils_Color.c.
References BaseMath_ReadCallback, COLOR_SIZE, ColorObject_Check, EXPP_VectorsAreEqual(), and NULL.
static PyObject* Color_slice | ( | ColorObject * | self, |
int | begin, | ||
int | end | ||
) | [static] |
Definition at line 238 of file mathutils_Color.c.
References BaseMath_ReadCallback, CLAMP(), COLOR_SIZE, MIN2, and NULL.
Referenced by Color_subscript().
static PyObject* Color_str | ( | ColorObject * | self | ) | [static] |
Definition at line 129 of file mathutils_Color.c.
References BaseMath_ReadCallback, BLI_dynstr_appendf(), BLI_dynstr_new(), mathutils_dynstr_to_py(), and NULL.
static PyObject* Color_sub | ( | PyObject * | v1, |
PyObject * | v2 | ||
) | [static] |
Definition at line 432 of file mathutils_Color.c.
References BaseMath_ReadCallback, Color_CreatePyObject(), COLOR_SIZE, ColorObject_Check, NULL, Py_NEW, and sub_vn_vnvn().
static PyObject* Color_subscript | ( | ColorObject * | self, |
PyObject * | item | ||
) | [static] |
Definition at line 290 of file mathutils_Color.c.
References Color_item(), COLOR_SIZE, Color_slice(), i, NULL, and step().
static PyObject* Color_ToTupleExt | ( | ColorObject * | self, |
int | ndigits | ||
) | [static] |
Definition at line 71 of file mathutils_Color.c.
References COLOR_SIZE, double_round(), and i.
Referenced by Color_repr().
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_channel_g_doc | , |
"Green color channel.\n\n:type: float" | |||
) |
PyDoc_STRVAR | ( | color_doc | , |
"This object gives access to Colors in Blender." | |||
) |
PyDoc_STRVAR | ( | Color_hsv_doc | , |
"HSV Values in .\n\n:type: float triplet" | [0, 1] | ||
) |
PyDoc_STRVAR | ( | Color_channel_hsv_h_doc | , |
"HSV Hue component in .\n\n:type: float" | [0, 1] | ||
) |
PyDoc_STRVAR | ( | Color_channel_hsv_s_doc | , |
"HSV Saturation component in .\n\n:type: float" | [0, 1] | ||
) |
PyDoc_STRVAR | ( | Color_channel_hsv_v_doc | , |
"HSV Value component in .\n\n:type: float" | [0, 1] | ||
) |
PyDoc_STRVAR | ( | Color_channel_b_doc | , |
"Blue color channel.\n\n:type: float" | |||
) |
PyMappingMethods Color_AsMapping [static] |
{ (lenfunc)Color_len, (binaryfunc)Color_subscript, (objobjargproc)Color_ass_subscript }
Definition at line 373 of file mathutils_Color.c.
PyGetSetDef Color_getseters[] [static] |
{ {(char *)"r", (getter)Color_channel_get, (setter)Color_channel_set, Color_channel_r_doc, (void *)0}, {(char *)"g", (getter)Color_channel_get, (setter)Color_channel_set, Color_channel_g_doc, (void *)1}, {(char *)"b", (getter)Color_channel_get, (setter)Color_channel_set, Color_channel_b_doc, (void *)2}, {(char *)"h", (getter)Color_channel_hsv_get, (setter)Color_channel_hsv_set, (char *)Color_channel_hsv_h_doc, (void *)0}, {(char *)"s", (getter)Color_channel_hsv_get, (setter)Color_channel_hsv_set, (char *)Color_channel_hsv_s_doc, (void *)1}, {(char *)"v", (getter)Color_channel_hsv_get, (setter)Color_channel_hsv_set, (char *)Color_channel_hsv_v_doc, (void *)2}, {(char *)"hsv", (getter)Color_hsv_get, (setter)Color_hsv_set, (char *)Color_hsv_doc, (void *)0}, {(char *)"is_wrapped", (getter)BaseMathObject_is_wrapped_get, (setter)NULL, BaseMathObject_is_wrapped_doc, NULL}, {(char *)"owner", (getter)BaseMathObject_owner_get, (setter)NULL, BaseMathObject_owner_doc, NULL}, {NULL, NULL, NULL, NULL, NULL} }
Definition at line 773 of file mathutils_Color.c.
struct PyMethodDef Color_methods[] [static] |
{ {"__copy__", (PyCFunction) Color_copy, METH_NOARGS, Color_copy_doc}, {"copy", (PyCFunction) Color_copy, METH_NOARGS, Color_copy_doc}, {NULL, NULL, 0, NULL} }
Definition at line 791 of file mathutils_Color.c.
PyNumberMethods Color_NumMethods [static] |
Definition at line 635 of file mathutils_Color.c.
PySequenceMethods Color_SeqMethods [static] |
{ (lenfunc) Color_len, (binaryfunc) NULL, (ssizeargfunc) NULL, (ssizeargfunc) Color_item, NULL, (ssizeobjargproc) Color_ass_item, NULL, (objobjproc) NULL, (binaryfunc) NULL, (ssizeargfunc) NULL, }
Definition at line 360 of file mathutils_Color.c.
PyTypeObject color_Type |
Definition at line 801 of file mathutils_Color.c.
Referenced by PyInit_mathutils().