Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include <stdio.h></stdio.h>
Toshihiro Shimizu 890ddd
#include <stdlib.h></stdlib.h>
Toshihiro Shimizu 890ddd
#include <string.h></string.h>
Toshihiro Shimizu 890ddd
#include <gl gl.h=""></gl>
Toshihiro Shimizu 890ddd
#include <gl device.h=""></gl>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#define _TOONZ_PROTOTYPES_
Toshihiro Shimizu 890ddd
#include "toonz.h"
Toshihiro Shimizu 890ddd
#include "file.h"
Toshihiro Shimizu 890ddd
#include "tim.h"
Toshihiro Shimizu 890ddd
#include "version.h"
Toshihiro Shimizu 890ddd
#include "security.h"
Toshihiro Shimizu 890ddd
#include "history.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
void main(int argc, char *argv[])
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	char outname[512], inname[512], *boh;
Toshihiro Shimizu 890ddd
	int len, i, j, total;
Toshihiro Shimizu 890ddd
	IMAGE *img = NIL, *newimg = 0;
Toshihiro Shimizu 890ddd
	struct cmap_color *cmap;
Toshihiro Shimizu 890ddd
	struct gl_color *gl_buffer;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	toonz_init(DUMMY_KEY_SLOT, (int *)&argc, argv);
Toshihiro Shimizu 890ddd
	InibisciDongle();
Toshihiro Shimizu 890ddd
	unprotect_lib();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	if (argc < 2) {
Toshihiro Shimizu 890ddd
		printf("### %s error: missing argument\n", argv[0]);
Toshihiro Shimizu 890ddd
		printf(" usage: %s infile \n", argv[0]);
Toshihiro Shimizu 890ddd
		exit(0);
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	if (*argv[1] == '-') {
Toshihiro Shimizu 890ddd
		printf("bad filename <%s> \n", argv[1]);
Toshihiro Shimizu 890ddd
		exit(0);
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	printf("\n\n");
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	for (i = 1; i < argc; i++) {
Toshihiro Shimizu 890ddd
		strcpy(inname, argv[i]);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
		len = strlen(inname);
Toshihiro Shimizu 890ddd
		if (len < 4 || STR_NE(inname + len - 4, ".plt")) {
Toshihiro Shimizu 890ddd
			printf("### %s error: file %s is not plt\n", argv[0], inname);
Toshihiro Shimizu 890ddd
			continue;
Toshihiro Shimizu 890ddd
		}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
		/*   printf(">> Loading %s\n", inname); */
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
		img = img_read_plt_info(inname);
Toshihiro Shimizu 890ddd
		if (!img) {
Toshihiro Shimizu 890ddd
			printf("### %s error: file %s not found\n", argv[0], inname);
Toshihiro Shimizu 890ddd
			continue;
Toshihiro Shimizu 890ddd
		}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
		printf(" > IMAGE: %s \n\n", inname);
Toshihiro Shimizu 890ddd
		printf("   > Dimension:    xsize=%d\t\tysize=%d\n",
Toshihiro Shimizu 890ddd
			   img->pixmap.xsize, img->pixmap.ysize);
Toshihiro Shimizu 890ddd
		printf("   > Savebox:\n");
Toshihiro Shimizu 890ddd
		printf("   >   Start       x0=%d\t\ty0=%d \n",
Toshihiro Shimizu 890ddd
			   img->pixmap.xD, img->pixmap.yD);
Toshihiro Shimizu 890ddd
		printf("   >   Dimensions  xsize=%d\t\tysize=%d \n",
Toshihiro Shimizu 890ddd
			   img->pixmap.xSBsize, img->pixmap.ySBsize);
Toshihiro Shimizu 890ddd
		printf("   > Resolution:   x_dpi=%g\ty_dpi=%g \n",
Toshihiro Shimizu 890ddd
			   img->pixmap.x_dpi, img->pixmap.y_dpi);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
		printf("\n");
Toshihiro Shimizu 890ddd
		if (img->history)
Toshihiro Shimizu 890ddd
			print_history(img->history);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
		printf("\n\n");
Toshihiro Shimizu 890ddd
		free_img(img);
Toshihiro Shimizu 890ddd
		img = NIL;
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	printf(" Bye!!\n");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/* ---------------------- */