is trinarize really ok ?

This commit is contained in:
2020-12-02 19:55:06 +01:00
parent a450ac4291
commit 8f29cb0db0
6 changed files with 29 additions and 21 deletions

View File

@@ -8,9 +8,10 @@
#include <stdlib.h>
#include <malloc.h>
#include <floatimg.h>
#include "../floatimg.h"
#include "fonctions.h"
#include "sfx.h"
/* -------------------------------------------------------------- */
/* here are global vars exported by the main module
@@ -72,25 +73,23 @@ mBb = (mm[5] - mm[4]) * 0.66666;
size = pimg->width * pimg->height;
#define VAL (255.0)
for (foo=0; foo<size; foo++) {
fptr = pimg->R;
if (fptr[foo] < mRa || fptr[foo] > mRb)
fptr[foo] = 0.0;
fptr[foo] = mm[0];
else
fptr[foo] = mm[1];
fptr = pimg->G;
if (fptr[foo] < mGa || fptr[foo] > mGb)
fptr[foo] = 0.0;
fptr[foo] = mm[2];
else
fptr[foo] = mm[3];
fptr = pimg->B;
if (fptr[foo] < mBa || fptr[foo] > mBb)
fptr[foo] = 0.0;
fptr[foo] = mm[4];
else
fptr[foo] = mm[5];