Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef _UDIT_H
Toshihiro Shimizu 890ddd
#define _UDIT_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "pixel.h"
Toshihiro Shimizu 890ddd
#include "toonz.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*------------------------------------------------------------------------*/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/****************** UDIT 4.1 VERSION **************************/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/**************************************************************/
Toshihiro Shimizu 890ddd
/*********   GENERAL STRUCTURE DECLARATIONS   *****************/
Toshihiro Shimizu 890ddd
/**************************************************************/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef struct UD_RECT {
Toshihiro Shimizu 890ddd
	int lx, ly;
Toshihiro Shimizu 890ddd
	double x_pos, y_pos;
Toshihiro Shimizu 890ddd
} UD_RECT;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef struct UD_RENDER_INFO {
Toshihiro Shimizu 890ddd
	int xsize, ysize;
Toshihiro Shimizu 890ddd
	int shrink;
Toshihiro Shimizu 890ddd
} UD_RENDER_INFO;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/**************************************************************/
Toshihiro Shimizu 890ddd
/************  USER PIXEL TYPES DECLARATIONS   ****************/
Toshihiro Shimizu 890ddd
/**************************************************************/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#define UD_PIXEL32 LPIXEL
Toshihiro Shimizu 890ddd
#define UD_PIXEL64 SPIXEL
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef USHORT UD_CMAPINDEX;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/**************************************************************/
Toshihiro Shimizu 890ddd
/**********  USER IMAGE STRUCTURES DECLARATIONS   *************/
Toshihiro Shimizu 890ddd
/**************************************************************/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef enum UD_IMG_TYPE {
Toshihiro Shimizu 890ddd
	UD_NONE = 0,
Toshihiro Shimizu 890ddd
	UD_CMAPPED,
Toshihiro Shimizu 890ddd
	UD_RGBM32,
Toshihiro Shimizu 890ddd
	UD_RGBM64
Toshihiro Shimizu 890ddd
} UD_IMG_TYPE;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef union UD_PIXEL_PTR {
Toshihiro Shimizu 890ddd
	UD_PIXEL32 p32;
Toshihiro Shimizu 890ddd
	UD_PIXEL64 p64;
Toshihiro Shimizu 890ddd
	UD_CMAPINDEX ci;
Toshihiro Shimizu 890ddd
} UD_PIXEL_PTR;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef struct UD_COLORMAP {
Toshihiro Shimizu 890ddd
	UD_PIXEL32 *buffer;
Toshihiro Shimizu 890ddd
	int offset, size;
Toshihiro Shimizu 890ddd
} UD_COLORMAP;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef struct UD_USR_IMAGE {
Toshihiro Shimizu 890ddd
	enum UD_IMG_TYPE type;
Toshihiro Shimizu 890ddd
	UD_PIXEL_PTR *buffer;
Toshihiro Shimizu 890ddd
	int scanline;
Toshihiro Shimizu 890ddd
	int lx, ly;
Toshihiro Shimizu 890ddd
	double x_pos, y_pos;
Toshihiro Shimizu 890ddd
	UD_COLORMAP cmap;
Toshihiro Shimizu 890ddd
} UD_USR_IMAGE;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/**************************************************************/
Toshihiro Shimizu 890ddd
/*********  UDIT FUNCTION PROTOTYPES DECLARATIONS   ***********/
Toshihiro Shimizu 890ddd
/**************************************************************/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
enum UD_GOP_TYPE { UD_GOP_SOURCE_TO_DEST,
Toshihiro Shimizu 890ddd
				   UD_GOP_DEST_TO_SOURCE };
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef int UD_GOP_FUNC_TYPE(enum UD_GOP_TYPE type,
Toshihiro Shimizu 890ddd
							 int num_rectin, UD_RECT src_rects[], UD_RECT *dst_rect,
Toshihiro Shimizu 890ddd
							 int argc, const char *argv[],
Toshihiro Shimizu 890ddd
							 const UD_RENDER_INFO *info);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef int UD_ROP_FUNC_TYPE(int num_imgs_in, const UD_USR_IMAGE imgs_in[],
Toshihiro Shimizu 890ddd
							 const UD_USR_IMAGE *img_out,
Toshihiro Shimizu 890ddd
							 int argc, const char *argv[],
Toshihiro Shimizu 890ddd
							 const UD_RENDER_INFO *info);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef struct UD_DATA_V41U1 {
Toshihiro Shimizu 890ddd
	char *version;
Toshihiro Shimizu 890ddd
	char *udit_name;
Toshihiro Shimizu 890ddd
	UD_GOP_FUNC_TYPE *gop;
Toshihiro Shimizu 890ddd
	UD_ROP_FUNC_TYPE *rop;
Toshihiro Shimizu 890ddd
	int num_args;
Toshihiro Shimizu 890ddd
	int num_params;
Toshihiro Shimizu 890ddd
} UD_DATA_V41U1;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*------------------------------------------------------------------------*/
Toshihiro Shimizu 890ddd
/*------------------------------------------------------------------------*/
Toshihiro Shimizu 890ddd
/*------------------------------------------------------------------------*/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/****************** UDIT 4.4 VERSION **************************/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/**************************************************************/
Toshihiro Shimizu 890ddd
/*********   GENERAL STRUCTURE DECLARATIONS   *****************/
Toshihiro Shimizu 890ddd
/**************************************************************/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef struct UD44_RENDER_INFO {
Toshihiro Shimizu 890ddd
	int xsize, ysize;
Toshihiro Shimizu 890ddd
	int shrink;
Toshihiro Shimizu 890ddd
	int frame;
Toshihiro Shimizu 890ddd
} UD44_RENDER_INFO;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/**************************************************************/
Toshihiro Shimizu 890ddd
/************  USER PIXEL TYPES DECLARATIONS   ****************/
Toshihiro Shimizu 890ddd
/**************************************************************/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#define UD44_PIXEL32 LPIXEL
Toshihiro Shimizu 890ddd
#define UD44_PIXEL64 SPIXEL
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef USHORT UD44_CMAPINDEX16;
Toshihiro Shimizu 890ddd
typedef TUINT32 UD44_CMAPINDEX32;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/**************************************************************/
Toshihiro Shimizu 890ddd
/**********  USER IMAGE STRUCTURES DECLARATIONS   *************/
Toshihiro Shimizu 890ddd
/**************************************************************/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef enum UD44_IMG_TYPE {
Toshihiro Shimizu 890ddd
	UD44_NONE = 0,
Toshihiro Shimizu 890ddd
	UD44_CM16,
Toshihiro Shimizu 890ddd
	UD44_CM32,
Toshihiro Shimizu 890ddd
	UD44_RGBM32,
Toshihiro Shimizu 890ddd
	UD44_RGBM64
Toshihiro Shimizu 890ddd
} UD44_IMG_TYPE;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef union UD44_PIXEL_PTR {
Toshihiro Shimizu 890ddd
	UD44_PIXEL32 p32;
Toshihiro Shimizu 890ddd
	UD44_PIXEL64 p64;
Toshihiro Shimizu 890ddd
	UD44_CMAPINDEX16 ci16;
Toshihiro Shimizu 890ddd
	UD44_CMAPINDEX32 ci32;
Toshihiro Shimizu 890ddd
} UD44_PIXEL_PTR;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef struct UD44_COLORMAP {
Toshihiro Shimizu 890ddd
	UD44_PIXEL32 *buffer16;
Toshihiro Shimizu 890ddd
	UD44_PIXEL32 *penbuf32; /* for > 16 bits, pencil component buffer (") */
Toshihiro Shimizu 890ddd
	UD44_PIXEL32 *colbuf32; /* for > 16 bits, color  component buffer (") */
Toshihiro Shimizu 890ddd
	int offset, size;
Toshihiro Shimizu 890ddd
} UD44_COLORMAP;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef struct UD44_USR_IMAGE {
Toshihiro Shimizu 890ddd
	enum UD44_IMG_TYPE type;
Toshihiro Shimizu 890ddd
	UD44_PIXEL_PTR *buffer;
Toshihiro Shimizu 890ddd
	int scanline;
Toshihiro Shimizu 890ddd
	int lx, ly;
Toshihiro Shimizu 890ddd
	double x_pos, y_pos;
Toshihiro Shimizu 890ddd
	UD44_COLORMAP cmap;
Toshihiro Shimizu 890ddd
	int img_lx, img_ly;
Toshihiro Shimizu 890ddd
	char *fullpath;
Toshihiro Shimizu 890ddd
	double img_x_pos, img_y_pos; /*WARNING: leggi sotto!!! */
Toshihiro Shimizu 890ddd
} UD44_USR_IMAGE;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/* WARNING: i due campi img_x_pos, img_y_pos sono stati aggiunti alla fine, 
Toshihiro Shimizu 890ddd
            e per questo valgono SOLO per le UDIT dei plugin e fx.
Toshihiro Shimizu 890ddd
	    essi rappresentano, insieme a img_lx, img_ly
Toshihiro Shimizu 890ddd
	    (che quindi hanno un significato diverso nel caso UDIT user defined), 
Toshihiro Shimizu 890ddd
	    il rect che contiene  TUTTA l'immagine di input transformata dagli
Toshihiro Shimizu 890ddd
	     fx seguenti alla udit corrente.
Toshihiro Shimizu 890ddd
	    Quindi, il rect rappresentato da lx, ly, x_pos, y_pos 
Toshihiro Shimizu 890ddd
	    deve essere contenuto  o coincidente con il rect suddetto.  */
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/**************************************************************/
Toshihiro Shimizu 890ddd
/*********  UDIT FUNCTION PROTOTYPES DECLARATIONS   ***********/
Toshihiro Shimizu 890ddd
/**************************************************************/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
enum UD44_GOP_TYPE { UD44_GOP_SOURCE_TO_DEST,
Toshihiro Shimizu 890ddd
					 UD44_GOP_DEST_TO_SOURCE };
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef int UD44_GOP_FUNC_TYPE(enum UD44_GOP_TYPE type,
Toshihiro Shimizu 890ddd
							   int num_rectin,
Toshihiro Shimizu 890ddd
							   UD44_USR_IMAGE src_rects[],
Toshihiro Shimizu 890ddd
							   UD44_USR_IMAGE *dst_rect,
Toshihiro Shimizu 890ddd
							   int argc, const char *argv[],
Toshihiro Shimizu 890ddd
							   const UD44_RENDER_INFO *info);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef int UD44_ROP_FUNC_TYPE(int num_imgs_in,
Toshihiro Shimizu 890ddd
							   const UD44_USR_IMAGE imgs_in[],
Toshihiro Shimizu 890ddd
							   const UD44_USR_IMAGE *img_out,
Toshihiro Shimizu 890ddd
							   int argc, const char *argv[],
Toshihiro Shimizu 890ddd
							   const UD44_RENDER_INFO *info);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef struct UDIT_DATA_V44U1 {
Toshihiro Shimizu 890ddd
	char *version;
Toshihiro Shimizu 890ddd
	char *udit_name;
Toshihiro Shimizu 890ddd
	UD44_GOP_FUNC_TYPE *gop;
Toshihiro Shimizu 890ddd
	UD44_ROP_FUNC_TYPE *rop;
Toshihiro Shimizu 890ddd
	int num_args;
Toshihiro Shimizu 890ddd
	int num_params;
Toshihiro Shimizu 890ddd
} UDIT_DATA_V44U1;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#define UD44_RECT UD44_USR_IMAGE
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif