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
Shinya Kitaoka 120a6e
void main(int argc, char *argv[]) {
Shinya Kitaoka 120a6e
  char outname[512], inname[512], *boh;
Shinya Kitaoka 120a6e
  int len, i, j, total;
Shinya Kitaoka 120a6e
  IMAGE *img = NIL, *newimg = 0;
Shinya Kitaoka 120a6e
  struct cmap_color *cmap;
Shinya Kitaoka 120a6e
  struct gl_color *gl_buffer;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  toonz_init(DUMMY_KEY_SLOT, (int *)&argc, argv);
Shinya Kitaoka 120a6e
  InibisciDongle();
Shinya Kitaoka 120a6e
  unprotect_lib();
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  if (argc < 2) {
Shinya Kitaoka 120a6e
    printf("### %s error: missing argument\n", argv[0]);
Shinya Kitaoka 120a6e
    printf(" usage: %s infile \n", argv[0]);
Shinya Kitaoka 120a6e
    exit(0);
Shinya Kitaoka 120a6e
  }
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  if (*argv[1] == '-') {
Shinya Kitaoka 120a6e
    printf("bad filename <%s> \n", argv[1]);
Shinya Kitaoka 120a6e
    exit(0);
Shinya Kitaoka 120a6e
  }
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  printf("\n\n");
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  for (i = 1; i < argc; i++) {
Shinya Kitaoka 120a6e
    strcpy(inname, argv[i]);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
    len = strlen(inname);
Shinya Kitaoka 120a6e
    if (len < 4 || (STR_NE(inname + len - 4, ".tzu") &&
Shinya Kitaoka 120a6e
                    STR_NE(inname + len - 4, ".tzp"))) {
Shinya Kitaoka 120a6e
      printf("### %s error: file %s is not tz(up)\n", argv[0], inname);
Shinya Kitaoka 120a6e
      continue;
Shinya Kitaoka 120a6e
    }
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
    /*   printf(">> Loading %s\n", inname); */
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
    img = img_read_tzup_info(inname);
Shinya Kitaoka 120a6e
    if (!img) {
Shinya Kitaoka 120a6e
      printf("### %s error: file %s not found\n", argv[0], inname);
Shinya Kitaoka 120a6e
      continue;
Shinya Kitaoka 120a6e
    }
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
    printf(" > IMAGE: %s \n\n", inname);
Shinya Kitaoka 120a6e
    printf("   > Dimension:    xsize=%d\t\tysize=%d\n", img->pixmap.xsize,
Shinya Kitaoka 120a6e
           img->pixmap.ysize);
Shinya Kitaoka 120a6e
    printf("   > Savebox:\n");
Shinya Kitaoka 120a6e
    printf("   >   Start       x0=%d\t\ty0=%d \n", img->pixmap.xD,
Shinya Kitaoka 120a6e
           img->pixmap.yD);
Shinya Kitaoka 120a6e
    printf("   >   Dimensions  xsize=%d\t\tysize=%d \n", img->pixmap.xSBsize,
Shinya Kitaoka 120a6e
           img->pixmap.ySBsize);
Shinya Kitaoka 120a6e
    printf("   > Resolution:   x_dpi=%g\ty_dpi=%g \n", img->pixmap.x_dpi,
Shinya Kitaoka 120a6e
           img->pixmap.y_dpi);
Shinya Kitaoka 120a6e
    printf("   > H-position (pixels): %g \n", img->pixmap.h_pos);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
    printf("\n");
Shinya Kitaoka 120a6e
    if (img->history) print_history(img->history);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
    printf("\n\n");
Shinya Kitaoka 120a6e
    free_img(img);
Shinya Kitaoka 120a6e
    img = NIL;
Shinya Kitaoka 120a6e
  }
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  printf(" Bye!!\n");
Toshihiro Shimizu 890ddd
}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/* ---------------------- */