Browse Source

more expicit help

master
tonton Th 3 years ago
parent
commit
0224f6fd37
  1. 6
      floatimg.h
  2. 6
      tools/fimgfx.c
  3. 21
      tools/mkfimg.c

6
floatimg.h

@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
* floatimg.h
*/
#define FIMG_VERSION 84
#define FIMG_VERSION 85
/*
* in memory descriptor
@ -91,6 +91,10 @@ int fimg_cos_010(FloatImg *s, FloatImg *d, double maxval); @@ -91,6 +91,10 @@ int fimg_cos_010(FloatImg *s, FloatImg *d, double maxval);
int fimg_mk_gray_from(FloatImg *src, FloatImg*dst, int k);
/* module funcs/rampes.c */
int fimg_hdeg_a(FloatImg *img, double dcoef);
int fimg_vdeg_a(FloatImg *img, double dcoef);
/* FIMG files module */
int fimg_fileinfos(char *fname, int *datas);
int fimg_dump_to_file(FloatImg *head, char *fname, int notused);

6
tools/fimgfx.c

@ -55,7 +55,11 @@ static void help(int lvl) @@ -55,7 +55,11 @@ static void help(int lvl)
{
Fx *fx;
puts("--- fimg special effects ---");
puts("------ fimg special effects ------");
puts("usage:");
puts("\tfimgfix [options] <effect> source.fimg resultat.fimg");
puts("effects:");
printf("\t");
for (fx=fx_list; fx->name; fx++) {
printf("%s ", fx->name);

21
tools/mkfimg.c

@ -12,6 +12,9 @@ int verbosity; @@ -12,6 +12,9 @@ int verbosity;
#define T_BLACK 1
#define T_DRAND48 2
#define T_GRAY 3
#define T_HDEG_A 4
#define T_VDEG_A 5
typedef struct {
int code;
char *name;
@ -21,7 +24,11 @@ Type types[] = { @@ -21,7 +24,11 @@ Type types[] = {
{ T_BLACK, "black" },
{ T_DRAND48, "drand48" },
{ T_GRAY, "gray" },
{ T_GRAY, "grey" }
{ T_GRAY, "grey" },
{ T_HDEG_A, "hdeg" },
{ T_VDEG_A, "vdeg" },
{ 0, NULL }
};
static int get_type(char *name)
@ -35,7 +42,6 @@ fprintf(stderr, ">>> %s ( '%s' )\n", __func__, name); @@ -35,7 +42,6 @@ fprintf(stderr, ">>> %s ( '%s' )\n", __func__, name);
// #define TEST(str) ( ! strcmp(name, str) )
for (type = types; type->code; type++) {
// printf("\t%-15s %d\n", type->name, type->code);
if (!strcmp(name, type->name)) {
return type->code;
}
@ -46,13 +52,16 @@ return -1; @@ -46,13 +52,16 @@ return -1;
/* --------------------------------------------------------------------- */
static void help(int lj)
{
int foo;
puts("Usage:\tmkfimg [options] quux.fimg width height");
puts("\t-k N.N\tgive a float parameter");
puts("\t-t bla\t\thowto make the pic");
puts("\t\t\tblack, drand48...");
puts("\t-v\tincrease verbosity");
fputs("\t-t bla\thowto make the pic\n\t\t", stdout);
for (foo=0; types[foo].code; foo++) {
printf("%s ", types[foo].name);
}
puts("\n\t-v\tincrease verbosity");
if (verbosity) fimg_print_version(1);
@ -114,6 +123,8 @@ switch(type) { @@ -114,6 +123,8 @@ switch(type) {
case T_DRAND48: fimg_drand48(&fimg, fvalue); break;
case T_GRAY: fimg_rgb_constant(&fimg, fvalue, fvalue, fvalue);
break;
case T_HDEG_A: fimg_hdeg_a(&fimg, 1.0); break;
case T_VDEG_A: fimg_vdeg_a(&fimg, 1.0); break;
}
foo = fimg_dump_to_file(&fimg, fname, 0);

Loading…
Cancel
Save