2022-06-26 11:23:53 +11:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2022-06-27 07:55:56 +11:00
|
|
|
#include "../tthimage.h"
|
2022-06-26 11:23:53 +11:00
|
|
|
|
2022-09-20 20:21:41 +11:00
|
|
|
/* ============================== */
|
|
|
|
int essai_show_t16x24( char *text)
|
|
|
|
{
|
|
|
|
if (NULL != text)
|
|
|
|
Image_t16x24_essai("16x24thin", text, "16x24.tga");
|
|
|
|
else
|
2022-10-28 14:54:07 +11:00
|
|
|
Image_t16x24_essai("16x24gruik", "0123456789abcdef", "16x24.tga");
|
2022-09-20 20:21:41 +11:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
/* ============================== */
|
|
|
|
int essai_draw_paint_rect(char *outga)
|
|
|
|
{
|
|
|
|
Image_Desc *img;
|
|
|
|
Image_Rect rect;
|
|
|
|
int foo, x, y;
|
|
|
|
|
|
|
|
fprintf(stderr, ">>> %s ( '%s' )\n", __func__, outga);
|
|
|
|
|
|
|
|
rect.x = 8; rect.y = 8;
|
|
|
|
rect.w = 6; rect.h = 6;
|
|
|
|
|
|
|
|
if (NULL==(img=Image_alloc(64, 32, 3))) {
|
|
|
|
abort();
|
|
|
|
}
|
|
|
|
|
|
|
|
for (x=0; x<img->width; x+=2) {
|
|
|
|
for (y=0; y<img->height; y+=2) {
|
|
|
|
Image_plotRGB(img, x, y, 200, 200, 200);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
foo = Image_draw_rect(img, &rect, 192, 128, 64);
|
|
|
|
if (foo) {
|
|
|
|
fprintf(stderr, "%s: err %d draw rect\n", __func__, foo);
|
|
|
|
return foo;
|
|
|
|
}
|
|
|
|
|
|
|
|
rect.x = 24;
|
|
|
|
foo = Image_paint_rect(img, &rect, 64, 128, 192);
|
|
|
|
if (foo) {
|
|
|
|
fprintf(stderr, "%s: err %d paint rect\n", __func__, foo);
|
|
|
|
return foo;
|
|
|
|
}
|
|
|
|
|
|
|
|
foo = Image_TGA_save(outga, img, 0);
|
|
|
|
if (foo) {
|
|
|
|
fprintf(stderr, "%s: err %d save '%s'\n", __func__, foo, outga);
|
|
|
|
return foo;
|
|
|
|
}
|
|
|
|
|
|
|
|
return OLL_KORRECT;
|
|
|
|
}
|
|
|
|
/* ============================== */
|
|
|
|
|
2022-06-26 11:23:53 +11:00
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2022-09-20 20:21:41 +11:00
|
|
|
int foo;
|
|
|
|
|
2022-06-26 11:23:53 +11:00
|
|
|
Image_print_version(2);
|
2022-06-27 07:55:56 +11:00
|
|
|
Image_print_sizeof_structs("foo");
|
|
|
|
|
2022-10-28 14:54:07 +11:00
|
|
|
foo = essai_show_t16x24(NULL);
|
|
|
|
fprintf(stderr, "essai show t16x24 --> %d\n", foo);
|
|
|
|
|
2022-09-20 20:21:41 +11:00
|
|
|
foo = essai_draw_paint_rect("foo.tga");
|
|
|
|
fprintf(stderr, "essai draw rect --> %d\n", foo);
|
2022-09-16 05:14:59 +11:00
|
|
|
|
2022-06-26 11:23:53 +11:00
|
|
|
return 0;
|
|
|
|
}
|