Skip to content

Commit

Permalink
Fixed bug in magicflute.c
Browse files Browse the repository at this point in the history
  • Loading branch information
Pantarheon committed Sep 11, 2021
1 parent 17cca7e commit ebea37d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/magicflute.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
http://www.pantarheon.org
This is a frei0r-compatible plug-in, demonstrating
the use of multiple LUTs in Koliba. It needs
the use of a sequence of two LUTs in Koliba. It needs
to be linked dynamically using the -lkoliba switch
in Unix and its derivatives, or koliba.lib in Windows.
*/
Expand Down Expand Up @@ -102,7 +102,7 @@ void f0r_get_plugin_info(f0r_plugin_info_t* info) {
info->color_model = F0R_COLOR_MODEL_RGBA8888;
info->frei0r_version = FREI0R_MAJOR_VERSION;
info->major_version = 1;
info->minor_version = 0;
info->minor_version = 1;
info->num_params = 11;
info->explanation = "Crimsonite and Color Roller.";
}
Expand All @@ -115,12 +115,16 @@ f0r_instance_t f0r_construct(unsigned int width, unsigned int height) {
f0r_instance_t instance;

if ((instance = malloc(sizeof(magicflute_instance))) != NULL) {
// We set these values once and keep them that way for the
// life of this instance.
KOLIBA_SlutToVertices(instance->vertices, instance->sLut);
KOLIBA_SlutToVertices(instance->vertices+1, instance->sLut+1);
instance->ffLut[0].fLut = instance->fLut;
instance->ffLut[1].fLut = instance->fLut+1;
instance->count = (size_t)width * (size_t)height;

// We set the initial values for these parameters,
// but allow the user to change them.
instance->lut = 0.5;
instance->magenta = 1.0;

Expand Down Expand Up @@ -342,7 +346,7 @@ void f0r_update(f0r_instance_t instance, double time, const KOLIBA_RGBA8PIXEL *i

// Changed or not, if both efficacies are 0, just do a quick copy
// of all input pixels to corresponding output pixels.
if ((instance->efficacy[0] == 0.0) && (instance->efficacy[0] == 0.0))
if ((instance->efficacy[0] == 0.0) && (instance->efficacy[1] == 0.0))
memcpy(outframe, inframe, i*sizeof(KOLIBA_RGBA8PIXEL));
else {
if (instance->changed[0]) {
Expand Down
10 changes: 10 additions & 0 deletions src/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ objects=601-2020.o \
lifts.o \
lut.o \
lutty.o \
magicflute.o \
monofarba.o \
natcon.o \
objective.o \
Expand Down Expand Up @@ -120,6 +121,7 @@ libs=$(K)601-2020.so \
$(K)lifts.so \
$(K)lut.so \
$(K)lutty.so \
$(K)magicflute.so \
$(K)monofarba.so \
$(K)natcon.so \
$(K)objective.so \
Expand Down Expand Up @@ -172,6 +174,7 @@ installs=install-601-2020 \
install-lifts \
install-lut \
install-lutty \
install-magicflute \
install-monofarba \
install-natcon \
install-objective \
Expand Down Expand Up @@ -281,6 +284,9 @@ $(K)lut.so: lut.o
$(K)lutty.so: lutty.o
$(CC) $(LDFLAGS) $< -o $@ -lkoliba

$(K)magicflute.so: magicflute.o
$(CC) $(LDFLAGS) $< -o $@ -lkoliba

$(K)monofarba.so: monofarba.o
$(CC) $(LDFLAGS) $< -o $@ -lkoliba

Expand Down Expand Up @@ -466,6 +472,10 @@ install-lutty: $(K)lutty.so
install -p -s $? $(PREFIX)
touch install-lutty

install-magicflute: $(K)magicflute.so
install -p -s $? $(PREFIX)
touch install-monofarba

install-monofarba: $(K)monofarba.so
install -p -s $? $(PREFIX)
touch install-monofarba
Expand Down

0 comments on commit ebea37d

Please sign in to comment.