forked from tTh/FloatImg
thermocolr updated
This commit is contained in:
parent
4ecce5bdc0
commit
953462eb6e
|
@ -20,7 +20,7 @@
|
|||
* https://git.tetalab.org/tTh/FloatImg
|
||||
*/
|
||||
|
||||
#define FIMG_VERSION (231)
|
||||
#define FIMG_VERSION (234)
|
||||
#define RELEASE_NAME ("noname")
|
||||
#define PATCH_LEVEL ("aaaa")
|
||||
|
||||
|
@ -32,8 +32,7 @@
|
|||
/*
|
||||
* new 11 mars 2022, and a lot of iterations
|
||||
* around the concept of metadata for my work.
|
||||
*/
|
||||
/*
|
||||
*
|
||||
* we MUST look at packing and endianess problems NOW
|
||||
* and we can think about a fixed size of this datablock
|
||||
*/
|
||||
|
@ -232,6 +231,7 @@ int fimg_falsecolors_0(FloatImg *src, FloatImg *dst, int k, float valf);
|
|||
/* funcs/fmorpho.c */
|
||||
int fimg_filtre_morpho_0(FloatImg *sfimg, FloatImg *dfimg, int index);
|
||||
|
||||
int fimg_auto_thermique(FloatImg *src, FloatImg *dst, int k);
|
||||
|
||||
/* --> funcs/plasmas.c */
|
||||
int fimg_prototype_plasma(FloatImg *img, double time, int type);
|
||||
|
|
|
@ -1192,7 +1192,7 @@ memset(&dst, 0, sizeof(FloatImg));
|
|||
foo = fimg_clone(&src, &dst, 0);
|
||||
if (foo) return -888;
|
||||
|
||||
fimg_auto_thermique(&src, &dst, 0);
|
||||
foo = fimg_auto_thermique(&src, &dst, 0);
|
||||
|
||||
foo = fimg_export_picture(&dst, outfile, 0);
|
||||
if (foo) {
|
||||
|
|
|
@ -15,7 +15,9 @@
|
|||
extern int verbosity;
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* parameter k in not used, but may be in the futur.
|
||||
*/
|
||||
int fimg_auto_thermique(FloatImg *src, FloatImg *dst, int k)
|
||||
{
|
||||
// int x, y, off;
|
||||
|
@ -29,11 +31,11 @@ fprintf(stderr, ">>> %s ( %p %p %d )\n", __func__, src, dst, k);
|
|||
#endif
|
||||
|
||||
if (0!=k) {
|
||||
fprintf(stderr, "%s: k mus be 0, was %d\n", __func__, k);
|
||||
fprintf(stderr, "%s: k must be 0, was %d\n", __func__, k);
|
||||
}
|
||||
|
||||
surface = src->width * src->height;
|
||||
fprintf(stderr, "surface = %d\n", surface);
|
||||
// fprintf(stderr, "surface = %d\n", surface);
|
||||
|
||||
graymean = 0.0;
|
||||
for (idx=0; idx<surface; idx++) {
|
||||
|
@ -43,6 +45,9 @@ for (idx=0; idx<surface; idx++) {
|
|||
seuil = (float) (graymean / surface);
|
||||
// fprintf(stderr, "graymean = %f seuil = %f\n", graymean, seuil);
|
||||
|
||||
/*
|
||||
* please, explain this number brotching
|
||||
*/
|
||||
for (idx=0; idx<surface; idx++) {
|
||||
gray = src->R[idx] + src->G[idx] + src->B[idx];
|
||||
if (gray > seuil) {
|
||||
|
|
Loading…
Reference in New Issue