-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update sicgl * fix build * setuptools and wrapper for c extension * Update README.md * update sicgl sources list * add compositors module * format * add functional module and pixel get fns * add a lot of docs and stuff * upates fix Py_None ownership error switch to color submodule format * pass all tests * compositors -> compostition * drastic overhaul * Update sequence.c * simplify scalar field * refactor * sorted * format * move interpolation * move core tests * Update color_sequence.h * idk * increase strictness * fix errors with mp_length * add scale utility * format * remove inconsistent leading underscores * update color sequence interpolation architecture * add sic logo
- Loading branch information
Showing
64 changed files
with
2,564 additions
and
1,578 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,58 @@ | ||
![popsicgl](./docs/assets/popsicgl.WEBP) | ||
|
||
# pysicgl | ||
|
||
pysicgl is a Python C extension interface for the [sicgl](https://github.com/oclyke/sicgl) graphics library. | ||
|
||
both projects are young and would benefit from community involvement. | ||
|
||
# getting started as a developer | ||
|
||
**get submodules** | ||
|
||
```bash | ||
git submodule update --init --recursive | ||
``` | ||
|
||
**set up the python environment** | ||
|
||
* remove any existing virtual environment | ||
* create a new virtual environment | ||
* activate the virtual environment | ||
* install development dependencies | ||
|
||
```bash | ||
rm -rf venv | ||
python3 -m venv venv # use your Python 3 interpreter | ||
source venv/bin/activate | ||
pip install -r requirements.dev.txt | ||
``` | ||
|
||
**build and develop pysicl** | ||
|
||
```bash | ||
python setup.py build | ||
python setup.py develop | ||
``` | ||
|
||
**run tests and install** | ||
|
||
```bash | ||
python -m pytest | ||
python setup.py test | ||
python setup.py install | ||
``` | ||
|
||
# formatting | ||
|
||
``` | ||
source venv/bin/activate | ||
./scripts/third-party/run-clang-format/run-clang-format.py -r include src | ||
black . | ||
``` | ||
|
||
# design choices | ||
|
||
## color sequences | ||
|
||
color sequences are immutable. side effects are not allowed. |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#pragma once | ||
|
||
#define PY_SSIZE_T_CLEAN | ||
#include <Python.h> | ||
// python includes first (clang-format) | ||
|
||
PyMODINIT_FUNC PyInit_color(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#pragma once | ||
|
||
#define PY_SSIZE_T_CLEAN | ||
#include <Python.h> | ||
// python includes first (clang-format) | ||
|
||
PyMODINIT_FUNC PyInit_composition(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#pragma once | ||
|
||
#define PY_SSIZE_T_CLEAN | ||
#include <Python.h> | ||
// python includes first (clang-format) | ||
|
||
PyMODINIT_FUNC PyInit_functional(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#define PY_SSIZE_T_CLEAN | ||
#include <Python.h> | ||
// python includes first (clang-format) | ||
|
||
PyObject* color_from_rgba(PyObject* self, PyObject* args); | ||
PyObject* color_to_rgba(PyObject* self, PyObject* args); | ||
PyObject* interpolate_color_sequence( | ||
PyObject* self_in, PyObject* args, PyObject* kwds); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#define PY_SSIZE_T_CLEAN | ||
#include <Python.h> | ||
// python includes first (clang-format) | ||
|
||
PyObject* gamma_correct(PyObject* self, PyObject* args); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#define PY_SSIZE_T_CLEAN | ||
#include <Python.h> | ||
// python includes first (clang-format) | ||
|
||
PyObject* scalar_field(PyObject* self_in, PyObject* args, PyObject* kwds); | ||
PyObject* compose(PyObject* self_in, PyObject* args); | ||
PyObject* blit(PyObject* self_in, PyObject* args); | ||
PyObject* scale(PyObject* self_in, PyObject* args); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#pragma once | ||
|
||
#define PY_SSIZE_T_CLEAN | ||
#include <Python.h> | ||
// python includes first (clang-format) | ||
|
||
PyMODINIT_FUNC PyInit_interpolation(void); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#pragma once | ||
|
||
#define PY_SSIZE_T_CLEAN | ||
#include <Python.h> | ||
// python includes first (clang-format) | ||
|
||
#include "pysicgl/types/color_sequence_interpolator.h" | ||
#include "sicgl/color_sequence.h" | ||
|
||
// declare the type | ||
extern PyTypeObject ColorSequenceType; | ||
|
||
typedef struct { | ||
PyObject_HEAD color_sequence_t sequence; | ||
ColorSequenceInterpolatorObject* interpolator; | ||
|
||
// iterator state | ||
// protected by the GIL | ||
size_t iterator_index; | ||
} ColorSequenceObject; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#pragma once | ||
|
||
#define PY_SSIZE_T_CLEAN | ||
#include <Python.h> | ||
// python includes first (clang-format) | ||
|
||
#include "sicgl/color_sequence.h" | ||
|
||
// declare the type | ||
extern PyTypeObject ColorSequenceInterpolatorType; | ||
|
||
typedef struct { | ||
PyObject_HEAD sequence_map_fn fn; | ||
void* args; | ||
} ColorSequenceInterpolatorObject; | ||
|
||
ColorSequenceInterpolatorObject* new_color_sequence_interpolator_object( | ||
sequence_map_fn fn, void* args); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#pragma once | ||
|
||
#define PY_SSIZE_T_CLEAN | ||
#include <Python.h> | ||
// python includes first (clang-format) | ||
|
||
#include <stdbool.h> | ||
|
||
#include "sicgl/compose.h" | ||
#include "sicgl/compositors.h" | ||
|
||
// declare the type | ||
extern PyTypeObject CompositorType; | ||
|
||
typedef struct { | ||
PyObject_HEAD | ||
/* Type-specific fields go here. */ | ||
compositor_fn fn; | ||
void* args; | ||
} CompositorObject; | ||
|
||
// public constructors | ||
CompositorObject* new_compositor_object(compositor_fn fn, void* args); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from ._core import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
black >= 22.12.0, < 23.0.0 | ||
pytest >= 7.2.1, < 8.0.0 | ||
setuptools >= 67.0.0, < 68.0.0 | ||
sphinx >= 6.1.3, < 7.0.0 |
Oops, something went wrong.