add a gradient generator

This commit is contained in:
tTh
2023-09-18 08:46:13 +02:00
parent 42fafdc570
commit 907f538cff
5 changed files with 108 additions and 17 deletions

View File

@@ -25,6 +25,8 @@
#define HEADER 33
#define TIMESTAMP 34
#define PRHISTO 35
#define H_GRAD 36
#define V_GRAD 37
#define TAG7SEG0 40
#define BIZARRE 41
#define ENVIRON 50
@@ -49,6 +51,7 @@ mot_clef commandes[] =
{ "environ", ENVIRON, "", "" },
{ "bizarre", BIZARRE, "", "portnawak..." },
{ "mk_rgb", MK_RGB, "siiiii", "fname w h r g b" },
{ "mk_hgrad", H_GRAD, "sii", "fname w h" },
{ NULL, 0, NULL, NULL }
};
@@ -109,6 +112,24 @@ fprintf(stderr, "%s got %d\n", __func__, foo);
return foo;
}
/*::------------------------------------------------------------------::*/
/* new: Mon Sep 18 06:28:51 UTC 2023
this is just a dummy wraper */
int make_a_H_gradient(char *fname, int w, int h)
{
int foo;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %s %d %d )\n", __func__, fname, w, h);
#endif
foo = Image_plot_H_gradient(fname, w, h);
#if DEBUG_LEVEL
fprintf(stderr, " got a %d\n", foo);
#endif
return foo;
}
/*::------------------------------------------------------------------::*/
int make_a_rgb_tga(char *fname, int w, int h, int r, int g, int b)
{
@@ -304,13 +325,13 @@ dump_command_line(argc, argv, 0);
/* new 4 feb 2014 */
foo = set_new_seed(42);
#if DEBUG_LEVEL
fprintf(stderr, "set new seed -> %d\n", foo);
#if DEBUG_LEVEL > 1
fprintf(stderr, "!!! set new seed -> %d\n", foo);
#endif
if (1 == argc)
{
fprintf(stderr, "* tga_tools v 0.1.32 (%s) *\n", __DATE__);
fprintf(stderr, "* tga_tools v 0.1.33 (%s) *\n", __DATE__);
fprintf(stderr, "usage:\n\t%s action f.tga [params]\n", argv[0]);
liste_mots_clefs(commandes, 42);
exit(0);
@@ -380,6 +401,11 @@ switch(mode)
foo = make_a_rgb_tga(cptr, GIP(1), GIP(2),
GIP(3), GIP(4), GIP(5));
break;
case H_GRAD:
cptr = GSP(0);
fprintf(stderr, "MK_HGRAD -> %s\n", cptr);
foo = make_a_H_gradient(cptr, GIP(1), GIP(2));
break;
case MK_NOISE:
cptr = GSP(0);
fprintf(stderr, "MK_NOISE -> %s\n", cptr);