12345678910111213141516171819202122232425262728293031323334353637 |
- #define _XOPEN_SOURCE
- #include "img.h"
- #include <stdlib.h>
- #include <stdio.h>
- int main(){
- pix_row rows[1920];
- pix p;
- char filename[60];
- int i,j,x,y,count;
- image img;
- p.r = 200;
- p.g = 200;
- p.b = 200;
-
- for (count=0; count<(3600*60);count++){
- for (i=0;i<1920;i++){
- rows[i].p = malloc (1080 * sizeof(pix));
- for (j=0 ;j<1080; j++){
- p.r = (int) (drand48() * 255);
- p.g = (int) (drand48() * 255);
- p.b = (int) (drand48() * 255);
- rows[i].p[j] = p;
- }
- }
- sprintf(filename, "images/image%5d.png", count);
- img = initialize_png("image010", filename, 1920, 1080);
- write_image(&img, rows);
- finish_image(&img);
- }
- return (0);
- }
|