78 lines
1.3 KiB
C
78 lines
1.3 KiB
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <unistd.h>
|
|
#include <stdint.h>
|
|
#include <math.h>
|
|
|
|
#include "../tthimage.h"
|
|
|
|
/* ============================== */
|
|
|
|
/* new Wed Aug 14 19:17:20 UTC 2024
|
|
*
|
|
* parameters :
|
|
* ip: Image_Desc * of input picture
|
|
* ix, iy: coordinate of the pixel in this pic.
|
|
* op, ox, oy : same things for output picture
|
|
*/
|
|
#define PIXEL_COPY(ip, ix, iy, op, ox, oy) \
|
|
do { \
|
|
\
|
|
} while (0)
|
|
|
|
#define SZPIC 7777
|
|
|
|
double tthi_dtime(void);
|
|
|
|
void essai_pixcopy(void)
|
|
{
|
|
Image_Desc *alice, *bob;
|
|
int x, y;
|
|
double T0, T1;
|
|
long count;
|
|
|
|
alice = Image_alloc(SZPIC, SZPIC, IMAGE_RGB);
|
|
bob = Image_alloc(SZPIC, SZPIC, IMAGE_RGB);
|
|
|
|
T0 = tthi_dtime();
|
|
count = 0L;
|
|
for (y=0; y<SZPIC; y++) {
|
|
for (x=0; x<SZPIC; x++) {
|
|
|
|
Image_pixel_copy(alice, x, y, bob, x, y);
|
|
count++;
|
|
|
|
}
|
|
}
|
|
|
|
T1 = tthi_dtime();
|
|
|
|
fprintf(stderr, "count %ld, elapsed %g\n", count, T1-T0);
|
|
|
|
/* end */
|
|
}
|
|
|
|
/* ============================== */
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
|
|
fprintf(stderr, "*** %s is running\n", argv[0]);
|
|
|
|
if (argc > 1) {
|
|
fprintf(stderr, "argument: %s\n", argv[1]);
|
|
Image_print_version(2);
|
|
Image_print_sizeof_structs("foo");
|
|
}
|
|
else {
|
|
essai_pixcopy();
|
|
}
|
|
|
|
/*
|
|
foo = essai_show_t16x24(NULL);
|
|
fprintf(stderr, "essai show t16x24 --> %d\n", foo);
|
|
*/
|
|
|
|
return 0;
|
|
}
|