8 void write_pbm(uint8_t *tp, int w, int h, const char *fmt, ...)
10 va_list ap; va_start(ap, fmt);
11 char fn[256]; vsnprintf(fn, sizeof(fn), fmt, ap);
13 FILE *fp = !strcmp(fn,"-") ? stdout : fopen(fn,"w");
15 fprintf(fp,"P5\n%d %d\n255\n",w,h);
21 int main(int ac, char **av)
23 int ret; setbuf(stdout,0);
26 //db.access(av[1], 34543, 0);
27 if( !db.opened() || db.error() ) exit(1);
29 unsigned int id = atoi(av[2]);
30 if( (ret=db.video_frame.FindId(id)) != 0 ) {
31 printf(" not found, ret = %d\n",ret);
34 uint8_t *dat = db.video_frame._Frame_data();
35 write_pbm(dat,80,45,"%s",av[3]);