Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef _READCASM_H_
Toshihiro Shimizu 890ddd
#define _READCASM_H_
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "toonzproc.h"
Toshihiro Shimizu 890ddd
#include "casm_node.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#undef TNZAPI
Toshihiro Shimizu 890ddd
#undef TNZVAR
Toshihiro Shimizu 890ddd
#ifdef TNZ_IS_CASMLIB
Toshihiro Shimizu 890ddd
#define TNZAPI TNZ_EXPORT_API
Toshihiro Shimizu 890ddd
#define TNZVAR TNZ_EXPORT_VAR
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
#define TNZAPI TNZ_IMPORT_API
Toshihiro Shimizu 890ddd
#define TNZVAR TNZ_IMPORT_VAR
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
TNZAPI int n_compute(CASM_NODE *node, int x1, int y1, int x2, int y2, float dx,
Shinya Kitaoka 120a6e
                     float dy, RASTER *raster, CASM_TILE *out);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI int n_compare(CASM_NODE *n1, CASM_NODE *n2);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI void n_write(CASM_NODE *n, T_CHAN fp);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI CASM_NODE *n_insert(CASM_NODE *node);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI CASM_FRAME *readcasm(char *filename, int first_frame, int last_frame,
Shinya Kitaoka 120a6e
                            int frame_step, int shrink,
Shinya Kitaoka 120a6e
                            CASM_COMPUTE_FUNCTION **compute_functions,
Shinya Kitaoka 120a6e
                            TBOOL is_central_affine, TBOOL is_tv_licence);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI int readcasm_get_camera_size(int *lx, int *ly);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI char *readcasm_get_sink_script(char ***argv);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
TNZAPI int readcasm_get_audio_info(int *from_audio, int *to_audio,
Shinya Kitaoka 120a6e
                                   int *from_video, char **audioname);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI int readcasm_set_camera_size(int lx, int ly, int shrink);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI int readcasm_get_field(void);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI void readcasm_get_camera_dpi(double *camera_x_dpi, double *camera_y_dpi);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI int readcasm_get_frames_n(void);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI int is_binary_op(CASM_NODE *arg, CASM_NODE **arg2, CASM_NODE **arg3);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
TNZAPI int is_special_binary_op(CASM_NODE *arg, CASM_NODE **arg2,
Shinya Kitaoka 120a6e
                                CASM_NODE **arg3);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI int is_unary_op(CASM_NODE *arg, CASM_NODE **arg2);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI int is_n_ary_op(CASM_NODE *arg, int *num_args, CASM_NODE ***args);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI int is_affine_op(CASM_NODE *n, CASM_NODE **arg);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI int get_affine_args(CASM_NODE *n, AFFINE *aff, CASM_NODE **arg);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI CASM_NODE *create_affine_op(AFFINE *aff, CASM_NODE *n);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI int n_compare_ric(CASM_NODE *tree1, CASM_NODE *tree2);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI void make_border(RASTER *raster);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI void readcasm_create_new_frame(CASM_NODE *node, char *filename);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI void readcasm_do_for_all_frames(void (*fun)(CASM_FRAME *f));
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI void readcasm_touch_frames(void);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI int is_read_op(CASM_NODE *arg);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI int is_backlit_op(CASM_NODE *arg, CASM_NODE **arg2, CASM_NODE **arg3);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI int n_compare_ric(CASM_NODE *tree1, CASM_NODE *tree2);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI void make_border(RASTER *raster);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI void reset_camera_size(void);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI CASM_NODE *go_to_leaf_node(CASM_NODE *node);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI void apply_extcmap(CASM_NODE *node, char *cmapname);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI int readcasm_frame(CASM_FRAME **frame);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI void init_readcasm_functions(CASM_COMPUTE_FUNCTION **casm_functions,
Shinya Kitaoka 120a6e
                                    int pipeid, int shrink);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI void init_readcasm_input_channel(void);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI CASM_FRAME *get_tree_pointer(void);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI void readcasm_set_msg_trace(void);
Toshihiro Shimizu 890ddd
TNZAPI TBOOL readcasm_open_log_file(char *casmname, char *filename);
Toshihiro Shimizu 890ddd
TNZAPI TBOOL readcasm_close_log_file(void);
Toshihiro Shimizu 890ddd
TNZAPI void readcasm_set_frame(int frame_num);
Toshihiro Shimizu 890ddd
TNZAPI int readcasm_get_frame(void);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI void readcasm_get_render_tile(int *x1, int *y1, int *x2, int *y2);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI int is_matte_op(CASM_NODE *n, CASM_NODE **arg_dn, CASM_NODE **arg_up);
Shinya Kitaoka 120a6e
TNZAPI int is_localblur_op(CASM_NODE *n, CASM_NODE **arg_dn,
Shinya Kitaoka 120a6e
                           CASM_NODE **arg_up);
Shinya Kitaoka 120a6e
TNZAPI int is_localtransp_op(CASM_NODE *n, CASM_NODE **arg_dn,
Shinya Kitaoka 120a6e
                             CASM_NODE **arg_up);
Toshihiro Shimizu 890ddd
TNZAPI int is_ovr_op(CASM_NODE *n, CASM_NODE **arg_dn, CASM_NODE **arg_up);
Toshihiro Shimizu 890ddd
TNZAPI int is_add_op(CASM_NODE *n, CASM_NODE **arg_dn, CASM_NODE **arg_up);
Toshihiro Shimizu 890ddd
TNZAPI int is_warp_op(CASM_NODE *n, CASM_NODE **arg_dn, CASM_NODE **arg_up);
Toshihiro Shimizu 890ddd
TNZAPI int is_colorcard_op(CASM_NODE *n);
Shinya Kitaoka 120a6e
TNZAPI int get_add_args(CASM_NODE *n, CASM_NODE **arg_dn, CASM_NODE **arg_up,
Shinya Kitaoka 120a6e
                        float *value);
Toshihiro Shimizu 890ddd
TNZAPI int there_is_colorcard(CASM_NODE *arg);
Toshihiro Shimizu 890ddd
TNZAPI int there_is_standard_colorcard(CASM_NODE *arg);
Toshihiro Shimizu 890ddd
TNZAPI int there_is_colorcard_with_ovr(CASM_NODE *arg);
Toshihiro Shimizu 890ddd
TNZAPI TBOOL get_colorcard_rgbm(CASM_NODE *arg, LPIXEL *color);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI enum CASM_RESAMPLE_TYPE get_resample_type(void);
Toshihiro Shimizu 890ddd
TNZAPI void casm_set_resample_type(enum CASM_RESAMPLE_TYPE type);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI void free_casmtree(CASM_NODE *n);
Toshihiro Shimizu 890ddd
TNZAPI CASM_NODE *dup_casmtree(CASM_NODE *n);
Toshihiro Shimizu 890ddd
TNZAPI CASM_NODE *make_subtree(CASM_NODE *n, int from_column, int to_column);
Shinya Kitaoka 120a6e
TNZAPI int split_tree(CASM_NODE *tree, CASM_NODE **lefttree,
Shinya Kitaoka 120a6e
                      CASM_NODE **righttree, int occurrence);
Shinya Kitaoka 120a6e
TNZAPI int writecasm(CASM_FRAME *frames_list, T_CHAN fp, int start_frame,
Shinya Kitaoka 120a6e
                     int write_header, TBOOL is_central_affine);
Toshihiro Shimizu 890ddd
TNZAPI int get_level_list(CASM_NODE *tree, char ***levels);
Toshihiro Shimizu 890ddd
TNZAPI CASM_NODE *change_leaf(CASM_NODE *tree, int occurrence,
Shinya Kitaoka 120a6e
                              char *newlevelname, char *newpalette, int dx,
Shinya Kitaoka 120a6e
                              int dy);
Shinya Kitaoka 120a6e
TNZAPI CASM_NODE *make_a_sandwich(CASM_NODE *bread_dn_tree, char *newlevelname,
Shinya Kitaoka 120a6e
                                  char *newpalette, int dx, int dy,
Shinya Kitaoka 120a6e
                                  CASM_NODE *bread_up_tree);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZAPI void write_raster(char *filename, RASTER *raster);
Shinya Kitaoka 120a6e
TNZAPI int read_raster(char *filename, RASTER *raster, int shrink, int border,
Shinya Kitaoka 120a6e
                       double *x_dpi, double *y_dpi);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*
Toshihiro Shimizu 890ddd
#undef  TNZAPI
Toshihiro Shimizu 890ddd
#ifdef WIN32
Toshihiro Shimizu 890ddd
#ifdef TNZ_IS_COMMONLIB
Toshihiro Shimizu 890ddd
  #define TNZAPI TNZ_EXPORT_API
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
  #define TNZAPI TNZ_IMPORT_API
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
  #define TNZAPI extern
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
*/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
TNZVAR int Is_casm;
Toshihiro Shimizu 890ddd
TNZVAR int Always_scale_opt;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif