#include <Python.h>
#include "BLI_utildefines.h"
#include "bl_math_py_api.hh"
Go to the source code of this file.
|
|
| | PyDoc_STRVAR (M_bl_math_doc, "Miscellaneous math utilities module") |
| |
|
| | PyDoc_STRVAR (py_bl_math_clamp_doc, ".. function:: clamp(value, min=0, max=1)\n" "\n" " Clamps the float value between minimum and maximum. To avoid\n" " confusion, any call must use either one or all three arguments.\n" "\n" " :arg value: The value to clamp.\n" " :type value: float\n" " :arg min: The minimum value, defaults to 0.\n" " :type min: float\n" " :arg max: The maximum value, defaults to 1.\n" " :type max: float\n" " :return: The clamped value.\n" " :rtype: float\n") |
| |
| static PyObject * | py_bl_math_clamp (PyObject *, PyObject *args) |
| |
| | PyDoc_STRVAR (py_bl_math_lerp_doc, ".. function:: lerp(from_value, to_value, factor)\n" "\n" " Linearly interpolate between two float values based on factor.\n" "\n" " :arg from_value: The value to return when factor is 0.\n" " :type from_value: float\n" " :arg to_value: The value to return when factor is 1.\n" " :type to_value: float\n" " :arg factor: The interpolation value, normally in [0.0, 1.0].\n" " :type factor: float\n" " :return: The interpolated value.\n" " :rtype: float\n") |
| |
| static PyObject * | py_bl_math_lerp (PyObject *, PyObject *args) |
| |
| | PyDoc_STRVAR (py_bl_math_smoothstep_doc, ".. function:: smoothstep(from_value, to_value, value)\n" "\n" " Performs smooth interpolation between 0 and 1 as value changes between from and " "to values.\n" " Outside the range the function returns the same value as the nearest edge.\n" "\n" " :arg from_value: The edge value where the result is 0.\n" " :type from_value: float\n" " :arg to_value: The edge value where the result is 1.\n" " :type to_value: float\n" " :arg factor: The interpolation value.\n" " :type factor: float\n" " :return: The interpolated value in [0.0, 1.0].\n" " :rtype: float\n") |
| |
| static PyObject * | py_bl_math_smoothstep (PyObject *, PyObject *args) |
| |
This file defines the 'bl_math' module, a module for math utilities.
Definition in file bl_math_py_api.cc.
◆ BPyInit_bl_math()
| PyMODINIT_FUNC BPyInit_bl_math |
( |
| ) |
|
◆ py_bl_math_clamp()
| static PyObject * py_bl_math_clamp |
( |
PyObject * | , |
|
|
PyObject * | args ) |
|
static |
◆ py_bl_math_lerp()
| static PyObject * py_bl_math_lerp |
( |
PyObject * | , |
|
|
PyObject * | args ) |
|
static |
◆ py_bl_math_smoothstep()
| static PyObject * py_bl_math_smoothstep |
( |
PyObject * | , |
|
|
PyObject * | args ) |
|
static |
◆ PyDoc_STRVAR() [1/4]
| PyDoc_STRVAR |
( |
M_bl_math_doc | , |
|
|
"Miscellaneous math utilities module" | ) |
◆ PyDoc_STRVAR() [2/4]
| PyDoc_STRVAR |
( |
py_bl_math_clamp_doc | , |
|
|
".. function:: clamp(value, min=0, max=1)\n" "\n" " Clamps the float value between minimum and maximum. To avoid\n" " | confusion, |
|
|
any call must use either one or all three arguments.\n" "\n" " :arg value:The value to clamp.\n" " :type value:float\n" " :arg min:The minimum | value, |
|
|
defaults to 0.\n" " :type min:float\n" " :arg max:The maximum | value, |
|
|
defaults to 1.\n" " :type max:float\n" " :return:The clamped value.\n" " :rtype:float\n" | ) |
◆ PyDoc_STRVAR() [3/4]
| PyDoc_STRVAR |
( |
py_bl_math_lerp_doc | , |
|
|
".. function:: lerp(from_value, to_value, factor)\n" "\n" " Linearly interpolate between two float values based on factor.\n" "\n" " :arg from_value: The value to return when factor is 0.\n" " :type from_value: float\n" " :arg to_value: The value to return when factor is 1.\n" " :type to_value: float\n" " :arg factor: The interpolation | value, |
|
|
normally in .\n" " :type factor:float\n" " :return:The interpolated value.\n" " :rtype:float\n" | [0.0, 1.0] ) |
◆ PyDoc_STRVAR() [4/4]
| PyDoc_STRVAR |
( |
py_bl_math_smoothstep_doc | , |
|
|
".. function:: smoothstep(from_value, to_value, value)\n" "\n" " Performs smooth interpolation between 0 and 1 as value changes between from and " "to values.\n" " Outside the range the function returns the same value as the nearest edge.\n" "\n" " :arg from_value: The edge value where the result is 0.\n" " :type from_value: float\n" " :arg to_value: The edge value where the result is 1.\n" " :type to_value: float\n" " :arg factor: The interpolation value.\n" " :type factor: float\n" " :return: The interpolated value in .\n" " :rtype: float\n" | [0.0, 1.0] ) |
◆ M_bl_math_methods
| PyMethodDef M_bl_math_methods[] |
|
static |
Initial value:= {
{nullptr, nullptr, 0, nullptr},
}
static PyObject * py_bl_math_smoothstep(PyObject *, PyObject *args)
static PyObject * py_bl_math_clamp(PyObject *, PyObject *args)
static PyObject * py_bl_math_lerp(PyObject *, PyObject *args)
Definition at line 131 of file bl_math_py_api.cc.
◆ M_bl_math_module_def
| PyModuleDef M_bl_math_module_def |
|
static |
Initial value:= {
PyModuleDef_HEAD_INIT,
"bl_math",
M_bl_math_doc,
0,
nullptr,
nullptr,
nullptr,
nullptr,
}
static PyMethodDef M_bl_math_methods[]
Definition at line 138 of file bl_math_py_api.cc.
Referenced by BPyInit_bl_math().