forked from tTh/FloatImg
no milestone here
This commit is contained in:
parent
2ee1645a4a
commit
e96c940baa
|
@ -2,7 +2,7 @@
|
|||
* floatimg.h
|
||||
*/
|
||||
|
||||
#define FIMG_VERSION 74
|
||||
#define FIMG_VERSION 75
|
||||
|
||||
/*
|
||||
* in memory descriptor
|
||||
|
@ -41,6 +41,7 @@ typedef struct {
|
|||
*/
|
||||
int fimg_create(FloatImg *fimg, int w, int h, int t);
|
||||
int fimg_destroy(FloatImg *fimg);
|
||||
int fimg_clone(FloatImg *fimg, FloatImg *newpic, int flags);
|
||||
|
||||
int fimg_print_version(int k);
|
||||
void fimg_printhead(FloatImg *h);
|
||||
|
@ -69,6 +70,10 @@ int fimg_load_from_pnm(char *fname, FloatImg *head, int notused);
|
|||
double fimg_timer_set(int whot);
|
||||
double fimg_timer_get(int whot);
|
||||
|
||||
/* --> lib/contrast.c */
|
||||
int fimg_square_root(FloatImg *s, FloatImg *d, double maxval);
|
||||
int fimg_power_2(FloatImg *s, FloatImg *d, double maxval);
|
||||
|
||||
|
||||
int fimg_mk_gray_from(FloatImg *src, FloatImg*dst, int k);
|
||||
|
||||
|
|
|
@ -75,7 +75,9 @@ printf(" pixels@ %p %p %p %p\n",
|
|||
return 0;
|
||||
}
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
int fimg_create(FloatImg *fimg, int w, int h, int t)
|
||||
{
|
||||
int surface, size;
|
||||
|
@ -146,6 +148,35 @@ if (NULL == fimg->R) {
|
|||
free(fimg->R);
|
||||
memset(fimg, 0, sizeof(FloatImg));
|
||||
|
||||
return 0;
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
||||
int fimg_clone(FloatImg *old, FloatImg *new, int flags)
|
||||
{
|
||||
int foo;
|
||||
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, ">>> %-25s ( %p %p 0x%x)\n", __func__, old, new, flags);
|
||||
#endif
|
||||
|
||||
if ( ! fimg_type_is_valid(old->type) ) {
|
||||
fprintf(stderr, "invalid type %d in %s\n", old->type, __func__);
|
||||
return -2;
|
||||
}
|
||||
|
||||
memset(new, 0, sizeof(FloatImg));
|
||||
|
||||
foo = fimg_create(new, old->width, old->height, old->type);
|
||||
if (foo) {
|
||||
fprintf(stderr, "error %d in %s\n", foo, __func__);
|
||||
return -3;
|
||||
}
|
||||
|
||||
if (flag & 0x01) {
|
||||
/* XXX copy all the pixels's datas */
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
|
6
lib/t.c
6
lib/t.c
|
@ -68,9 +68,6 @@ return 0;
|
|||
}
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
int fimg_square_root(FloatImg *s, FloatImg *d, double maxval);
|
||||
int fimg_power_2(FloatImg *s, FloatImg *d, double maxval);
|
||||
|
||||
int essai_contraste(char *fname)
|
||||
{
|
||||
int foo;
|
||||
|
@ -113,7 +110,6 @@ while ((opt = getopt(argc, argv, "gn:v")) != -1) {
|
|||
if (verbosity) fimg_print_version(0);
|
||||
|
||||
foo = essai_contraste("src.fimg");
|
||||
|
||||
|
||||
fprintf(stderr, "retour essai contraste -> %d\n",
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue