Blender V5.0
mathutils_Color.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include <Python.h>
12
13#include "mathutils.hh"
14
15extern PyTypeObject color_Type;
16#define ColorObject_Check(v) PyObject_TypeCheck((v), &color_Type)
17#define ColorObject_CheckExact(v) (Py_TYPE(v) == &color_Type)
18
22
23/* struct data contains a pointer to the actual data that the
24 * object uses. It can use either PyMem allocated data (which will
25 * be stored in py_data) or be a wrapper for data allocated through
26 * Blender (stored in blend_data). This is an either/or struct not both. */
27
28/* Prototypes. */
29
30[[nodiscard]] PyObject *Color_CreatePyObject(const float col[3], PyTypeObject *base_type);
31[[nodiscard]] PyObject *Color_CreatePyObject_wrap(float col[3], PyTypeObject *base_type)
32 ATTR_NONNULL(1);
33[[nodiscard]] PyObject *Color_CreatePyObject_cb(PyObject *cb_user,
34 unsigned char cb_type,
35 unsigned char cb_subtype);
#define ATTR_NONNULL(...)
uint col
PyTypeObject color_Type
PyObject * Color_CreatePyObject(const float col[3], PyTypeObject *base_type)
PyObject * Color_CreatePyObject_wrap(float col[3], PyTypeObject *base_type) ATTR_NONNULL(1)
PyObject * Color_CreatePyObject_cb(PyObject *cb_user, unsigned char cb_type, unsigned char cb_subtype)
BASE_MATH_MEMBERS(col)