small tweaking
This commit is contained in:
parent
402c80962a
commit
65f396bedd
@ -42,7 +42,7 @@ fprintf(stderr, "* TGA incrustator v 0.1.3 [%s] %s \n",
|
||||
TGA_OUTILS_VERSION, TGA_OUTILS_COPYLEFT);
|
||||
fprintf(stderr, " compiled %s at %s\n", __DATE__, __TIME__);
|
||||
|
||||
fprintf(stderr, "usage:\n\ttga_incrust orig insert mode out\n");
|
||||
fprintf(stderr, "usage:\n\ttga_incrust <orig.tga> <insert.tga> MODE <out.tga>\n");
|
||||
|
||||
if (flag) {
|
||||
Image_print_version(0);
|
||||
|
@ -11,21 +11,27 @@
|
||||
#include "tga_outils.h"
|
||||
|
||||
/*::------------------------------------------------------------------::*/
|
||||
|
||||
/*
|
||||
* Print a textual form of a picture, so you can read it
|
||||
* with a software who can't read TGA files.
|
||||
* Exemples: Fortran or Basic code, R, the statistic
|
||||
* software. And maybe you cant write a shell script
|
||||
* to convert from TGA to PNM :)
|
||||
*/
|
||||
int printf_this_picture(Image_Desc *pic, int flag)
|
||||
{
|
||||
int x, y, r, g, b;
|
||||
|
||||
if (flag) {
|
||||
/* needed for easy import in R */
|
||||
/* needed for easy import in Rstats */
|
||||
printf(" X Y R G B\n");
|
||||
}
|
||||
|
||||
for (y=0; y<pic->height; y++) {
|
||||
for (x=0; x<pic->width; x++) {
|
||||
printf("%5d %5d ", x, y);
|
||||
printf("%5d %5d ", x, y);
|
||||
Image_getRGB(pic, x, y, &r, &g, &b);
|
||||
printf("%4d %4d %4d\n", r, g, b);
|
||||
printf("%3d %3d %3d\n", r, g, b);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user