#include "pluginst.h" #include char evalstr[]="Plugin for creating html tables from images"; /* input parameters fname - file to add the html to. */ void html_art(void *INP) { i_img *im; i_color rcolor; int i,x,y; int info[4]; FILE *fp; char *fname; if ( !getSTR("fname",&fname) ) { fprintf(stderr,"Error: filename is missing\n"); return; } if ( !getOBJ("image","Imager::ImgRaw",&im) ) { fprintf(stderr,"Error: image is missing\n"); return; } printf("parameters: (im 0x%x,fname %s)\n",im,fname); printf("image info:\n size (%d,%d)\n channels (%d)\n channel mask (%d)\n bytes (%d)\n",im->xsize,im->ysize,im->channels,im->ch_mask,im->bytes); fp=fopen(fname,"ab+"); fprintf(fp,""); for(y=0;yysize;y+=2) { fprintf(fp,""); for(x=0;xxsize;x++) { i_gpix(im,x,y,&rcolor); fprintf(fp,"",rcolor.rgb.r,rcolor.rgb.g,rcolor.rgb.b); } fprintf(fp,""); } fprintf(fp,"
  
"); fclose(fp); } func_ptr function_list[]={ { "html_art", html_art, "callseq => ['image','fname'], \ callsub => sub { my %hsh=@_; DSO_call($DSO_handle,0,\\%hsh); } \ " }, {NULL,NULL,NULL}}; /* Remember to double backslash backslashes within Double quotes in C */