Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add scalar offset #2

Merged
merged 3 commits into from
Jan 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/drawing/field.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ PyObject* scalar_field(PyObject* self_in, PyObject* args, PyObject* kwds) {
ScalarFieldObject* scalar_field_obj;
ColorSequenceObject* color_sequence_obj;
unsigned int interp_type = 0;
double offset = 0.0;
char* keywords[] = {
"field", "scalars", "color_sequence", "interp_type", NULL,
"field", "scalars", "color_sequence", "interp_type", "offset", NULL,
};
PyObject* colors_obj = PyList_New(0);
if (!PyArg_ParseTupleAndKeywords(
args, kwds, "O!O!O!|I", keywords, &ScreenType, &field_obj,
args, kwds, "O!O!O!|Id", keywords, &ScreenType, &field_obj,
&ScalarFieldType, &scalar_field_obj, &ColorSequenceType,
&color_sequence_obj, &interp_type)) {
&color_sequence_obj, &interp_type, &offset)) {
return NULL;
}

Expand Down Expand Up @@ -67,7 +67,8 @@ PyObject* scalar_field(PyObject* self_in, PyObject* args, PyObject* kwds) {

// apply the field
ret = sicgl_scalar_field(
&self->interface, field_obj->screen, scalars, &sequence, interp_map_fn);
&self->interface, field_obj->screen, scalars, offset, &sequence,
interp_map_fn);
if (0 != ret) {
PyErr_SetNone(PyExc_OSError);
return NULL;
Expand Down
1 change: 0 additions & 1 deletion src/field.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ static int mp_ass_subscript(PyObject* self_in, PyObject* key, PyObject* v) {
return 0;
}


static void tp_dealloc(PyObject* self_in) {
ScalarFieldObject* self = (ScalarFieldObject*)self_in;
PyBuffer_Release(&self->_scalars_buffer);
Expand Down
2 changes: 1 addition & 1 deletion third-party/sicgl
Submodule sicgl updated from 5bff77 to 853089