Compare commits
No commits in common. "162e04e6fcaeff78f3dadefffefbbc6aa9f70d89" and "64489f57074696f09e08c60d2e986f4b78521a87" have entirely different histories.
162e04e6fc
...
64489f5707
1
.gitignore
vendored
1
.gitignore
vendored
@ -11,7 +11,6 @@ Lib/t_t16x24
|
||||
Lib/testbmp
|
||||
|
||||
Tests/*.tga
|
||||
Tests/*.gif
|
||||
Tests/t_t16x24
|
||||
|
||||
Tools/genplot2
|
||||
|
@ -1,9 +0,0 @@
|
||||
# libtthimage
|
||||
|
||||
Les fichiers HTML que vous avez ici sont des versions historiques,
|
||||
qui seront peut-être mise à jour au prochain grand refactoring.
|
||||
Leur contenu est donc à prendre avec des pincettes, ymmv.
|
||||
|
||||
Ceci dit, les principes généraux sont encore bons...
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include "../tthimage.h"
|
||||
|
||||
@ -18,10 +17,6 @@ h = img->height; w = img->width;
|
||||
fprintf(stderr, "%s: %p px=%d py=%d k=%d\n", __func__, img, parX, parY, k);
|
||||
#endif
|
||||
|
||||
if (k) {
|
||||
fprintf(stderr, "%s: k (%d) muste be 0\n", __func__, k);
|
||||
}
|
||||
|
||||
for (y=0; y<h; y++)
|
||||
{
|
||||
for (foo=0; foo<parX; foo++)
|
||||
@ -46,13 +41,6 @@ int foo;
|
||||
fprintf(stderr, "%s ( %p %d %d )\n", __func__, img, k0, k1);
|
||||
#endif
|
||||
|
||||
if (k0) {
|
||||
fprintf(stderr, "%s: k0 (%d) muste be 0\n", __func__, k0);
|
||||
}
|
||||
if (k1) {
|
||||
fprintf(stderr, "%s: k1 (%d) muste be 0\n", __func__, k1);
|
||||
}
|
||||
|
||||
for (x=0; x<img->width; x++)
|
||||
{
|
||||
for (foo=0; foo<k1; foo++)
|
||||
|
@ -191,9 +191,6 @@ int Image_degouline_0(Image_Desc *source, Image_Desc *but, int k1, int k2)
|
||||
int x, y;
|
||||
int foo;
|
||||
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, ">> %s ( %p %p %d %d )\n", __func__, source, but, k1, k2);
|
||||
#endif
|
||||
fprintf(stderr, "Degouline %d %d\n", k1, k2);
|
||||
|
||||
if ( (foo=Image_compare_desc(source, but)) ) {
|
||||
@ -201,6 +198,10 @@ if ( (foo=Image_compare_desc(source, but)) ) {
|
||||
return foo;
|
||||
}
|
||||
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, "%s ( %p %p %d %d )\n", __func__, source, but, k1, k2);
|
||||
#endif
|
||||
|
||||
for (x=0; x<source->width; x++)
|
||||
{
|
||||
|
||||
|
@ -26,20 +26,22 @@ Image_effect_x_0(Image_Desc *src, Image_Desc *dst, int kr, int kg, int kb)
|
||||
int foo, x, y, r, g, b;
|
||||
int cr, cg, cb;
|
||||
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, "*** Effect X_0: coeffs: %d %d %d\n", kr, kg, kb);
|
||||
#endif
|
||||
|
||||
if ( (foo=Image_compare_desc(src, dst)) )
|
||||
{
|
||||
fprintf(stderr, "Image effect x 0: images are differents %d\n", foo);
|
||||
return foo;
|
||||
}
|
||||
|
||||
cr = cg = cb = 0; /* raz des compteurs */
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, "*** Effect X_0: coeffs: %d %d %d\n", kr, kg, kb);
|
||||
#endif
|
||||
|
||||
for (y=0; y<dst->height; y++) {
|
||||
for (x=0; x<dst->width; x++) {
|
||||
cr = cg = cb = 0;
|
||||
|
||||
for (y=0; y<dst->height; y++)
|
||||
{
|
||||
for (x=0; x<dst->width; x++)
|
||||
{
|
||||
Image_getRGB(src, x, y, &r, &g, &b);
|
||||
if (r > kr) {
|
||||
foo = g; g = b; b = foo;
|
||||
@ -59,7 +61,7 @@ for (y=0; y<dst->height; y++) {
|
||||
|
||||
fprintf(stderr, "* %s : counts: %d %d %d\n", __func__, cr, cg, cb);
|
||||
|
||||
return FUNC_IS_BETA;
|
||||
return FUNC_IS_ALPHA;
|
||||
}
|
||||
/*::------------------------------------------------------------------::*/
|
||||
/* 2 fevrier 2003: je fait du n'importe quoi, la... */
|
||||
@ -111,10 +113,10 @@ if ( (foo=Image_compare_desc(src, dst)) )
|
||||
return foo;
|
||||
}
|
||||
|
||||
/* a vrai dire, je ne comprend pas ou caser kx, ky et kz */
|
||||
|
||||
for (y=0; y<dst->height; y++) {
|
||||
for (x=0; x<dst->width; x++) {
|
||||
for (y=0; y<dst->height; y++)
|
||||
{
|
||||
for (x=0; x<dst->width; x++)
|
||||
{
|
||||
r = src->Rpix[y][x];
|
||||
g = src->Gpix[y][x];
|
||||
b = src->Bpix[y][x];
|
||||
@ -157,7 +159,6 @@ return FUNC_IS_BETA;
|
||||
* 27 Oct 2003: je debugge pendant que le thé infuse :)
|
||||
* 16 Mai 2005: je commence a ecrire la documentation.
|
||||
* 29 sept 2015: je devrais finir la doc d'ici 2 ans.
|
||||
* 19 aout 2022: je comprend pas ce que c'est censé faire :)
|
||||
*
|
||||
*/
|
||||
int
|
||||
@ -167,16 +168,16 @@ int foo, sx, sy;
|
||||
int x, y, r, g, b;
|
||||
int cx, cy, dx, dy;
|
||||
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, "%s : kx %d ky %d comp '%s'\n", __func__, kx, ky, comp);
|
||||
#endif
|
||||
|
||||
if ( (foo=Image_compare_desc(src, dst)) )
|
||||
{
|
||||
fprintf(stderr, "%s: images are differents %d\n", __func__, foo);
|
||||
return foo;
|
||||
}
|
||||
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, "%s : kx %d ky %d comp '%s'\n", __func__, kx, ky, comp);
|
||||
#endif
|
||||
|
||||
if (strlen(comp) != 2)
|
||||
{
|
||||
fprintf(stderr, "eff x3: bad comp parameter '%s'\n", comp);
|
||||
@ -241,7 +242,8 @@ for (y=0; y<dst->height; y++)
|
||||
return FUNC_IS_ALPHA;
|
||||
}
|
||||
/*::------------------------------------------------------------------::*/
|
||||
int Image_effect_x_4(Image_Desc *src, Image_Desc *dst, int flags)
|
||||
int
|
||||
Image_effect_x_4(Image_Desc *src, Image_Desc *dst, int flags)
|
||||
{
|
||||
int foo;
|
||||
int x, y;
|
||||
@ -251,13 +253,16 @@ int r, g, b, r2, g2, b2;
|
||||
fprintf(stderr, "*** effect x4 is not ready for prime time ***\n");
|
||||
#endif
|
||||
|
||||
if ( (foo=Image_compare_desc(src, dst)) ) {
|
||||
if ( (foo=Image_compare_desc(src, dst)) )
|
||||
{
|
||||
fprintf(stderr, "Image effect x 4: images are differents %d\n", foo);
|
||||
return foo;
|
||||
}
|
||||
|
||||
for (y=0; y<src->height; y++) {
|
||||
for (x=0; x<src->width; x++) {
|
||||
for (y=0; y<src->height; y++)
|
||||
{
|
||||
for (x=0; x<src->width; x++)
|
||||
{
|
||||
r = src->Rpix[y][x];
|
||||
g = src->Gpix[y][x];
|
||||
b = src->Bpix[y][x];
|
||||
@ -284,7 +289,6 @@ return FUNC_IS_BETA;
|
||||
/* 22 avril 2007: je vais essayer d'inventer un nouveau truc, mais il
|
||||
* faudrait que les gosses arretent de ma casser les oreilles avec leur
|
||||
* machine a batailles. putain de gamecube... */
|
||||
/* 23 aout 2022 : j'ai bien envie d'une SNES et d'un Trinitron */
|
||||
int
|
||||
Image_effect_x_5(Image_Desc *src, Image_Desc *dst, int kx, int ky, int kz)
|
||||
{
|
||||
@ -295,7 +299,7 @@ double dr, dg, db, dr2, dg2, db2;
|
||||
|
||||
fprintf(stderr, "*** effect x5 is not ready for prime time ***\n");
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, ">>> %s ( %p %p %d %d %d )\n", __func__, src, dst,
|
||||
fprintf(stderr, "%s ( %p %p %d %d %d )\n", __func__, src, dst,
|
||||
kx, ky, kz);
|
||||
#endif
|
||||
|
||||
|
@ -24,19 +24,23 @@ Image_save_color_Map(char *file, char *name, RGB_map *map)
|
||||
int foo;
|
||||
FILE *fp;
|
||||
|
||||
if ( (fp=fopen(file, "w")) == NULL ) {
|
||||
if ( (fp=fopen(file, "w")) == NULL )
|
||||
{
|
||||
fprintf(stderr, "Save Color Map: err fopen\n");
|
||||
return FILE_CREATE_ERR;
|
||||
}
|
||||
|
||||
if ( map->nbre == 0 ) {
|
||||
if ( map->nbre == 0 )
|
||||
{
|
||||
fprintf(stderr, "Save Color Map: empty map\n");
|
||||
}
|
||||
|
||||
for (foo=0; foo<map->nbre; foo++) {
|
||||
for (foo=0; foo<map->nbre; foo++)
|
||||
{
|
||||
fprintf(fp, "%3d %3d %3d",
|
||||
map->red[foo], map->green[foo], map->blue[foo]);
|
||||
switch (foo) {
|
||||
switch (foo)
|
||||
{
|
||||
case 0:
|
||||
if (name != NULL)
|
||||
fprintf(fp, " Name: %s", name);
|
||||
@ -81,17 +85,20 @@ FILE *fp;
|
||||
int nbre, r, g, b, foo, errcode;
|
||||
char buffer[256];
|
||||
|
||||
if ( name != NULL ) {
|
||||
if (strlen(name)>IMG_OBJNAME_LEN) return STRING_TOO_LONG;
|
||||
if ( name != NULL )
|
||||
{
|
||||
if (strlen(name)>IMG_OBJNAME_LEN)
|
||||
return STRING_TOO_LONG;
|
||||
strcpy(where->name, name);
|
||||
}
|
||||
else strcpy(where->name, "no name");
|
||||
|
||||
/*
|
||||
* patch du 11 Décembre 2001: on utilise une fonction qui recherche le
|
||||
* fichier dans differents endroits. Cf 'mustopen.c' pour + de détails.
|
||||
* fichier dans differents endroits. Cf 'musopen.c' pour + de détails.
|
||||
*/
|
||||
if ((fp=Image_must_fopen(file, "r", 0)) == NULL) {
|
||||
if ((fp=Image_must_fopen(file, "r", 0)) == NULL)
|
||||
{
|
||||
/* safety poke */
|
||||
where->nbre = 0;
|
||||
fprintf(stderr, "Load color MAP: %s not found\n", file);
|
||||
@ -101,9 +108,11 @@ if ((fp=Image_must_fopen(file, "r", 0)) == NULL) {
|
||||
nbre = 0; errcode = 0;
|
||||
where->nbre = 0; /* kill bad value */
|
||||
|
||||
while ( fgets(buffer, 250, fp) != NULL ) {
|
||||
while ( fgets(buffer, 250, fp) != NULL )
|
||||
{
|
||||
foo = sscanf(buffer, "%d %d %d", &r, &g, &b);
|
||||
if (foo != 3) {
|
||||
if (foo != 3)
|
||||
{
|
||||
fprintf(stderr, "line %d: [%s]\n", nbre, buffer);
|
||||
errcode = BAD_COLOR_NUMBER; break;
|
||||
}
|
||||
@ -111,7 +120,8 @@ while ( fgets(buffer, 250, fp) != NULL ) {
|
||||
where->green[nbre] = g;
|
||||
where->blue[nbre] = b;
|
||||
nbre++;
|
||||
if (nbre > 256) {
|
||||
if (nbre > 256)
|
||||
{
|
||||
fprintf(stderr, "load color map: nbre = %d\n", nbre);
|
||||
errcode = MAP_TOO_BIG; break;
|
||||
}
|
||||
@ -136,7 +146,8 @@ int foo;
|
||||
|
||||
fprintf(stderr, "Image attach Map: cette fonction n'est pas finie\n");
|
||||
foo = Image_load_color_Map(nom_map, "", &map);
|
||||
if (foo == 0) {
|
||||
if (foo == 0)
|
||||
{
|
||||
fprintf(stderr, "Attach Map: foo is zero ?\n");
|
||||
}
|
||||
|
||||
@ -152,13 +163,15 @@ int foo;
|
||||
|
||||
fprintf(stderr, "making a random map named '%s'\n", nom);
|
||||
|
||||
if (nbre < 0 || nbre > 255) {
|
||||
if (nbre < 0 || nbre > 255)
|
||||
{
|
||||
fprintf(stderr, "make random map: nbre = %d\n", map->nbre);
|
||||
return BAD_COLOR_NUMBER;
|
||||
}
|
||||
map->nbre = nbre;
|
||||
|
||||
for (foo=0; foo<nbre; foo++) {
|
||||
for (foo=0; foo<nbre; foo++)
|
||||
{
|
||||
map->red[foo] = rand() & 0xff;
|
||||
map->green[foo] = rand() & 0xff;
|
||||
map->blue[foo] = rand() & 0xff;
|
||||
@ -183,7 +196,8 @@ strcpy(map->name, "* FMBL roulaize *");
|
||||
|
||||
map->nbre = 64;
|
||||
|
||||
for (foo=0; foo<64; foo++) {
|
||||
for (foo=0; foo<64; foo++)
|
||||
{
|
||||
r = ((foo >> 0) & 0x03) * 85;
|
||||
g = ((foo >> 2) & 0x03) * 85;
|
||||
b = ((foo >> 4) & 0x03) * 85;
|
||||
@ -218,7 +232,8 @@ for (foo=0; foo<8; foo++)
|
||||
fprintf(stderr, " %3d %g\n", foo, pars[foo]);
|
||||
#endif
|
||||
|
||||
for (foo=0; foo<256; foo++) {
|
||||
for (foo=0; foo<256; foo++)
|
||||
{
|
||||
dfoo = (double)foo / 255.0 * M_PI * 2;
|
||||
dra = sin((pars[0] * dfoo) + pars[3]);
|
||||
dga = sin((pars[1] * dfoo) + pars[4]);
|
||||
@ -247,23 +262,27 @@ fprintf(stderr, "Image mix palette: work in progress...\n");
|
||||
|
||||
k2 = 10000 - k;
|
||||
|
||||
for (idx=0; idx<256; idx++) {
|
||||
for (idx=0; idx<256; idx++)
|
||||
{
|
||||
if (idx < p1->nbre)
|
||||
{
|
||||
r1 = p1->red[idx];
|
||||
g1 = p1->green[idx];
|
||||
b1 = p1->blue[idx];
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
r1 = g1 = b1 = 0;
|
||||
}
|
||||
|
||||
if (idx < p2->nbre) {
|
||||
if (idx < p2->nbre)
|
||||
{
|
||||
r2 = p2->red[idx];
|
||||
g2 = p2->green[idx];
|
||||
b2 = p2->blue[idx];
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
r2 = g2 = b2 = 0;
|
||||
}
|
||||
|
||||
@ -296,16 +315,19 @@ int foo;
|
||||
int maxval = -99999;
|
||||
#endif
|
||||
|
||||
if (p->nbre < 1 || p->nbre > 256) {
|
||||
if (p->nbre < 1 || p->nbre > 256)
|
||||
{
|
||||
fprintf(stderr, "%s: RGB_map %p has %d entries ?\n",
|
||||
__func__, p, p->nbre);
|
||||
}
|
||||
|
||||
for (foo=0; foo<p->nbre; foo++) {
|
||||
for (foo=0; foo<p->nbre; foo++)
|
||||
{
|
||||
p->red[foo] = round((double)p->red[foo] * v);
|
||||
p->green[foo] = round((double)p->green[foo] * v);
|
||||
p->blue[foo] = round((double)p->blue[foo] * v);
|
||||
if (clip_it) {
|
||||
if (clip_it)
|
||||
{
|
||||
if (p->red[foo] < 0) p->red[foo] = 0;
|
||||
if (p->red[foo] > 255) p->red[foo] = 255;
|
||||
if (p->green[foo] < 0) p->green[foo] = 0;
|
||||
@ -334,16 +356,19 @@ int Image_scale3_palette(RGB_map *p, double rk, double gk, double bk,
|
||||
{
|
||||
int foo;
|
||||
|
||||
if (p->nbre < 1 || p->nbre > 256) {
|
||||
if (p->nbre < 1 || p->nbre > 256)
|
||||
{
|
||||
fprintf(stderr, "%s: RGB_map %p has %d entries ?\n",
|
||||
__func__, p, p->nbre);
|
||||
}
|
||||
|
||||
for (foo=0; foo<p->nbre; foo++) {
|
||||
for (foo=0; foo<p->nbre; foo++)
|
||||
{
|
||||
p->red[foo] = round((double)p->red[foo] * rk);
|
||||
p->green[foo] = round((double)p->green[foo] * gk);
|
||||
p->blue[foo] = round((double)p->blue[foo] * bk);
|
||||
if (clip_it) {
|
||||
if (clip_it)
|
||||
{
|
||||
if (p->red[foo] < 0) p->red[foo] = 0;
|
||||
if (p->red[foo] > 255) p->red[foo] = 255;
|
||||
if (p->green[foo] < 0) p->green[foo] = 0;
|
||||
@ -370,7 +395,8 @@ int foo;
|
||||
fprintf(stderr, "%s (( %p '%s' '%s' ))\n", __func__, p, fname, comment);
|
||||
#endif
|
||||
|
||||
if (NULL == p) {
|
||||
if (NULL==p)
|
||||
{
|
||||
fprintf(stderr, "in %s, can't gruik au nill map\n", __func__);
|
||||
abort();
|
||||
}
|
||||
@ -379,7 +405,8 @@ if (NULL == p) {
|
||||
fprintf(stderr, "we have %d colors in palette at %p\n", p->nbre, p);
|
||||
#endif
|
||||
|
||||
if ( (fp=fopen(fname, "w")) == NULL ) {
|
||||
if ( (fp=fopen(fname, "w")) == NULL )
|
||||
{
|
||||
fprintf(stderr, "%s: err fopen %s\n", __func__, fname);
|
||||
return FILE_CREATE_ERR;
|
||||
}
|
||||
@ -387,8 +414,8 @@ fprintf(fp, "P3\n%d 1\n255\n", p->nbre);
|
||||
if (NULL != comment) {
|
||||
fprintf(fp, "# %s\n", comment);
|
||||
}
|
||||
|
||||
for (foo=0; foo<p->nbre; foo++) {
|
||||
for (foo=0; foo<p->nbre; foo++)
|
||||
{
|
||||
fprintf(fp, "%3d %3d %3d\n", p->red[foo], p->green[foo], p->blue[foo]);
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ int foo;
|
||||
fprintf(stderr, "Pixeliz X: appel de test, pas finalise.\n");
|
||||
#endif
|
||||
|
||||
foo = Image_pixeliz_0(src, dst, 5, 16);
|
||||
foo = Image_pixeliz_0(src, dst, 5, 15);
|
||||
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, "Pixeliz X: valeur obtenue: %d\n", foo);
|
||||
@ -79,13 +79,12 @@ Image_pixeliz_Y(Image_Desc *src, Image_Desc *dst)
|
||||
{
|
||||
int foo;
|
||||
|
||||
#if DEBUG_LEVEL > 1
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, "Pixeliz Y: appel de test, pas finalise.\n");
|
||||
#endif
|
||||
|
||||
foo = Image_pixeliz_0(src, dst, 16, 5);
|
||||
|
||||
#if DEBUG_LEVEL
|
||||
foo = Image_pixeliz_0(src, dst, 15, 5);
|
||||
fprintf(stderr, "Pixeliz Y: valeur obtenue: %d\n", foo);
|
||||
#endif
|
||||
|
||||
|
@ -174,7 +174,7 @@ int len1, len2, len, foo;
|
||||
|
||||
len1 = len2 = 0;
|
||||
if (NULL != lig1) len1 = strlen(lig1);
|
||||
if (NULL != lig2) len2 = strlen(lig2);
|
||||
if (NULL != lig2) len2 - strlen(lig2);
|
||||
if (len2 > len1) len = len2;
|
||||
else len = len1;
|
||||
|
||||
@ -364,9 +364,6 @@ int res[8], foo;
|
||||
|
||||
printf(" R G B A\n");
|
||||
foo = Image_minmax_RGB(img, res);
|
||||
if (foo) {
|
||||
fprintf(stderr, "in %s, minmax rgb -> %d\n", __func__, foo);
|
||||
}
|
||||
printf("min %4d %4d %4d %4d\n", res[0], res[2], res[4], res[6]);
|
||||
printf("max %4d %4d %4d %4d\n", res[1], res[3], res[5], res[7]);
|
||||
return OLL_KORRECT;
|
||||
|
@ -2,12 +2,6 @@
|
||||
|
||||
Tester, c'est douter.
|
||||
|
||||
## État des lieux
|
||||
|
||||
Pas grand chose.
|
||||
|
||||
Allez quand même voir `config.sh` et `functions.sh` pour avoir une idée
|
||||
du désastre actuel
|
||||
|
||||
## Mais encore ?
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
source ./config.sh
|
||||
SRC="/tmp/src.tga"
|
||||
BW="/tmp/bw.tga"
|
||||
|
||||
DST="foo.tga"
|
||||
|
||||
|
@ -1,8 +0,0 @@
|
||||
|
||||
|
||||
SRC="/tmp/src.tga"
|
||||
BW="/tmp/bw.tga"
|
||||
GIF89A="flashy.gif"
|
||||
|
||||
# find the last version of tga_*
|
||||
COMDIR="../Tools"
|
@ -1,43 +0,0 @@
|
||||
|
||||
|
||||
# ---------------------------------------------------------------
|
||||
test_des_xpers ()
|
||||
{
|
||||
command=$1
|
||||
echo ; echo " Test du xper $command"
|
||||
|
||||
# generation d'une image sur laquelle travailler
|
||||
$COMDIR/tga_mires mircol0 $SRC "hard xper '$command'"
|
||||
|
||||
|
||||
case $command in
|
||||
zero)
|
||||
$COMDIR/tga_effects $SRC x0 $DST 64 128 192
|
||||
;;
|
||||
un)
|
||||
$COMDIR/tga_effects $SRC x1 $DST 64 128 192
|
||||
;;
|
||||
deux)
|
||||
$COMDIR/tga_effects $SRC x2 $DST 64 128 192
|
||||
;;
|
||||
trois)
|
||||
$COMDIR/tga_effects $SRC x3 $DST 42 R1 "rg"
|
||||
;;
|
||||
quatre)
|
||||
$COMDIR/tga_effects $SRC x4 $DST 27
|
||||
;;
|
||||
cinq)
|
||||
$COMDIR/tga_effects $SRC x5 $DST 64 128 192
|
||||
;;
|
||||
*)
|
||||
echo "==== ERROR ON $command ===="
|
||||
exit 1 ;;
|
||||
esac
|
||||
|
||||
gif89a=$(printf "flashy_%s.gif" $command)
|
||||
|
||||
convert -delay 80 $SRC $DST $gif89a
|
||||
}
|
||||
# ---------------------------------------------------------------
|
||||
# ---------------------------------------------------------------
|
||||
|
@ -1,17 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
source ./config.sh
|
||||
source ./functions.sh
|
||||
|
||||
DST="foo.tga"
|
||||
|
||||
$COMDIR/tga_tools version
|
||||
|
||||
|
||||
test_des_xpers "zero"
|
||||
test_des_xpers "un"
|
||||
test_des_xpers "deux"
|
||||
test_des_xpers "trois"
|
||||
test_des_xpers "quatre"
|
||||
test_des_xpers "cinq"
|
||||
|
@ -132,9 +132,11 @@ switch (commande)
|
||||
break;
|
||||
}
|
||||
|
||||
#if DEBUG_LEVEL
|
||||
if (foo)
|
||||
fprintf(stderr, "dither %d retour = %d, %s\n", commande,
|
||||
foo, Image_err2str(foo));
|
||||
#endif
|
||||
|
||||
foo = Image_TGA_save(argv[3], dst, 0);
|
||||
|
||||
|
@ -437,16 +437,12 @@ switch (commande)
|
||||
break;
|
||||
}
|
||||
|
||||
if (foo) {
|
||||
fprintf(stderr, "%s: return code is %d\n", __FILE__, foo);
|
||||
Image_print_error(argv[0], foo);
|
||||
}
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, "%s: return code is %d\n", __FILE__, foo);
|
||||
puts(""); /* make a nicer display in debug mode */
|
||||
#endif
|
||||
|
||||
foo = Image_TGA_save(argv[3], dst, 0);
|
||||
if (foo) {
|
||||
fprintf(stderr, "%s: error %d saving '%s'\n", __FILE__, foo, argv[3]);
|
||||
Image_print_error(argv[0], foo);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include "../tthimage.h"
|
||||
|
||||
#define TGA_OUTILS_VERSION "0.61"
|
||||
#define TGA_OUTILS_VERSION "0.60"
|
||||
/*
|
||||
* 13 Dec 2001: v0.11 a cause du 'mustopen' pour les palettes.
|
||||
* 11 Fev 2002: v0.12 a cause du '-ansi' (hein Kerdeuzz, on y vient)
|
||||
@ -21,7 +21,7 @@
|
||||
* 27 Jan 2014: V0.52 added : 'parse_rect_param'.
|
||||
*/
|
||||
|
||||
#define TGA_OUTILS_COPYLEFT "(dwtfywl) TontonTh 2022"
|
||||
#define TGA_OUTILS_COPYLEFT "(dwtfywl) TontonTh 2018"
|
||||
#define TGA_WWW_SITE "http://la.buvette.org/devel/libimage/"
|
||||
|
||||
#define PERR(txt) fprintf(stderr, "\t| %s\n", (txt))
|
||||
|
@ -26,7 +26,7 @@
|
||||
#define TIMESTAMP 34
|
||||
#define PRHISTO 35
|
||||
#define TAG7SEG0 40
|
||||
#define BIZARRE 41
|
||||
|
||||
#define ENVIRON 50
|
||||
/*::------------------------------------------------------------------::*/
|
||||
mot_clef commandes[] =
|
||||
@ -47,7 +47,6 @@ mot_clef commandes[] =
|
||||
{ "prhisto", PRHISTO, "s", "filename.tga" },
|
||||
{ "tag7", TAG7SEG0, "si", "fname.tga nnn" },
|
||||
{ "environ", ENVIRON, "", "" },
|
||||
{ "bizarre", BIZARRE, "", "portnawak..." },
|
||||
{ "mk_rgb", MK_RGB, "siiiii", "fname w h r g b" },
|
||||
{ NULL, 0, NULL, NULL }
|
||||
};
|
||||
@ -67,28 +66,31 @@ if (foo)
|
||||
{
|
||||
fprintf(stderr, "something is bad with %s : %d\n", filename, foo);
|
||||
Image_print_error("explanation", foo);
|
||||
return foo;
|
||||
}
|
||||
|
||||
foo = 0;
|
||||
switch(flags)
|
||||
{
|
||||
case 0:
|
||||
printf("%8d %8d\n", width, height); break;
|
||||
printf("%8d %8d\n", width, height);
|
||||
break;
|
||||
case 1:
|
||||
printf("%dx%d\n", width, height); break;
|
||||
printf("%dx%d\n", width, height);
|
||||
break;
|
||||
case 2:
|
||||
printf(" -w%d -h%d\n", width, height); break;
|
||||
printf(" -w%d -h%d\n", width, height);
|
||||
break;
|
||||
case 3:
|
||||
printf("width=%d height=%d\n", width, height); break;
|
||||
printf("width=%d height=%d\n", width, height);
|
||||
break;
|
||||
case 4:
|
||||
printf("%d\n", width); break;
|
||||
printf("%d\n", width);
|
||||
break;
|
||||
case 5:
|
||||
printf("%d\n", height);
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "bad flag %d in %s\n", flags, __func__);
|
||||
foo = BAD_PARAMETER;
|
||||
abort();
|
||||
break; /* unreached ? */
|
||||
}
|
||||
return foo;
|
||||
@ -102,7 +104,7 @@ int foo;
|
||||
fprintf(stderr, "Show Header '%s' %d\n", filename, flag);
|
||||
#endif
|
||||
|
||||
foo = Image_TGA_show_header(filename, flag);
|
||||
foo = Image_TGA_show_header(filename, 0);
|
||||
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, "%s got %d\n", __func__, foo);
|
||||
@ -238,13 +240,13 @@ char *noms[] =
|
||||
"FIXED_SEED", ENV_DEFAULT_RGBA
|
||||
};
|
||||
|
||||
for (foo=0; foo<(int)(sizeof(noms)/sizeof(char *)); foo++)
|
||||
for (foo=0; foo<(sizeof(noms)/sizeof(char *)); foo++)
|
||||
{
|
||||
ptr = getenv(noms[foo]);
|
||||
printf("%5d %-25s %s\n", foo, noms[foo], ptr);
|
||||
}
|
||||
|
||||
return OLL_KORRECT; /* ? seriously ? */
|
||||
return FUNC_NOT_FINISH;
|
||||
}
|
||||
/*::------------------------------------------------------------------::*/
|
||||
int tag_7_segments_0(char *fname, int value)
|
||||
@ -269,10 +271,6 @@ foo = Image_7seg_tag0(src, buffer, 0);
|
||||
#if DEBUG_LEVEL
|
||||
fprintf(stderr, "%s : tagging %s -> %d\n", __func__, fname, foo);
|
||||
#endif
|
||||
if (foo) {
|
||||
fprintf(stderr, "ERR %d IN %s\n", foo, __func__);
|
||||
abort();
|
||||
}
|
||||
|
||||
foo = Image_TGA_save(fname, src, 0);
|
||||
#if DEBUG_LEVEL > 1
|
||||
@ -282,20 +280,6 @@ fprintf(stderr, "%s : saving %s -> %d\n", __func__, fname, foo);
|
||||
return -1;
|
||||
}
|
||||
/*::------------------------------------------------------------------::*/
|
||||
int bizarre(char *fname, int notused)
|
||||
{
|
||||
|
||||
fprintf(stderr, ">>> %s ( %p %d )\n", __func__, fname, notused);
|
||||
|
||||
if (notused) {
|
||||
fprintf(stderr, "in %s notused must be zero, was %d\n",
|
||||
__func__, notused);
|
||||
return INVALID_PARAM;
|
||||
}
|
||||
|
||||
return OLL_KORRECT;
|
||||
}
|
||||
/*::------------------------------------------------------------------::*/
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
int foo;
|
||||
@ -413,13 +397,8 @@ switch(mode)
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "Hu ho %d ?\n", mode);
|
||||
foo = FULL_NUCKED;
|
||||
break;
|
||||
}
|
||||
|
||||
if (foo) {
|
||||
fprintf(stderr, "*** at end of %s, foo was %d\n", __func__, foo);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/*::------------------------------------------------------------------::*/
|
||||
|
@ -4,7 +4,7 @@
|
||||
http:///la.buvette.org/devel/libimage/
|
||||
*/
|
||||
#ifndef IMAGE_VERSION_STRING
|
||||
#define IMAGE_VERSION_STRING "0.4.51 pl 18"
|
||||
#define IMAGE_VERSION_STRING "0.4.51 pl 16"
|
||||
|
||||
/*::------------------------------------------------------------------::*/
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user