Shinya Kitaoka 810553
#pragma once
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 {
Shinya Kitaoka 120a6e
  int lx, ly;
Shinya Kitaoka 120a6e
  double x_pos, y_pos;
Toshihiro Shimizu 890ddd
} UD_RECT;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef struct UD_RENDER_INFO {
Shinya Kitaoka 120a6e
  int xsize, ysize;
Shinya Kitaoka 120a6e
  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 {
Shinya Kitaoka 120a6e
  UD_NONE = 0,
Shinya Kitaoka 120a6e
  UD_CMAPPED,
Shinya Kitaoka 120a6e
  UD_RGBM32,
Shinya Kitaoka 120a6e
  UD_RGBM64
Toshihiro Shimizu 890ddd
} UD_IMG_TYPE;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef union UD_PIXEL_PTR {
Shinya Kitaoka 120a6e
  UD_PIXEL32 p32;
Shinya Kitaoka 120a6e
  UD_PIXEL64 p64;
Shinya Kitaoka 120a6e
  UD_CMAPINDEX ci;
Toshihiro Shimizu 890ddd
} UD_PIXEL_PTR;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef struct UD_COLORMAP {
Shinya Kitaoka 120a6e
  UD_PIXEL32 *buffer;
Shinya Kitaoka 120a6e
  int offset, size;
Toshihiro Shimizu 890ddd
} UD_COLORMAP;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef struct UD_USR_IMAGE {
Shinya Kitaoka 120a6e
  enum UD_IMG_TYPE type;
Shinya Kitaoka 120a6e
  UD_PIXEL_PTR *buffer;
Shinya Kitaoka 120a6e
  int scanline;
Shinya Kitaoka 120a6e
  int lx, ly;
Shinya Kitaoka 120a6e
  double x_pos, y_pos;
Shinya Kitaoka 120a6e
  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
Shinya Kitaoka 120a6e
enum UD_GOP_TYPE { UD_GOP_SOURCE_TO_DEST, UD_GOP_DEST_TO_SOURCE };
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
typedef int UD_GOP_FUNC_TYPE(enum UD_GOP_TYPE type, int num_rectin,
Shinya Kitaoka 120a6e
                             UD_RECT src_rects[], UD_RECT *dst_rect, int argc,
Shinya Kitaoka 120a6e
                             const char *argv[], 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[],
Shinya Kitaoka 120a6e
                             const UD_USR_IMAGE *img_out, int argc,
Shinya Kitaoka 120a6e
                             const char *argv[], const UD_RENDER_INFO *info);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef struct UD_DATA_V41U1 {
Shinya Kitaoka 120a6e
  char *version;
Shinya Kitaoka 120a6e
  char *udit_name;
Shinya Kitaoka 120a6e
  UD_GOP_FUNC_TYPE *gop;
Shinya Kitaoka 120a6e
  UD_ROP_FUNC_TYPE *rop;
Shinya Kitaoka 120a6e
  int num_args;
Shinya Kitaoka 120a6e
  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 {
Shinya Kitaoka 120a6e
  int xsize, ysize;
Shinya Kitaoka 120a6e
  int shrink;
Shinya Kitaoka 120a6e
  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 {
Shinya Kitaoka 120a6e
  UD44_NONE = 0,
Shinya Kitaoka 120a6e
  UD44_CM16,
Shinya Kitaoka 120a6e
  UD44_CM32,
Shinya Kitaoka 120a6e
  UD44_RGBM32,
Shinya Kitaoka 120a6e
  UD44_RGBM64
Toshihiro Shimizu 890ddd
} UD44_IMG_TYPE;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef union UD44_PIXEL_PTR {
Shinya Kitaoka 120a6e
  UD44_PIXEL32 p32;
Shinya Kitaoka 120a6e
  UD44_PIXEL64 p64;
Shinya Kitaoka 120a6e
  UD44_CMAPINDEX16 ci16;
Shinya Kitaoka 120a6e
  UD44_CMAPINDEX32 ci32;
Toshihiro Shimizu 890ddd
} UD44_PIXEL_PTR;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef struct UD44_COLORMAP {
Shinya Kitaoka 120a6e
  UD44_PIXEL32 *buffer16;
Shinya Kitaoka 120a6e
  UD44_PIXEL32 *penbuf32; /* for > 16 bits, pencil component buffer (") */
Shinya Kitaoka 120a6e
  UD44_PIXEL32 *colbuf32; /* for > 16 bits, color  component buffer (") */
Shinya Kitaoka 120a6e
  int offset, size;
Toshihiro Shimizu 890ddd
} UD44_COLORMAP;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef struct UD44_USR_IMAGE {
Shinya Kitaoka 120a6e
  enum UD44_IMG_TYPE type;
Shinya Kitaoka 120a6e
  UD44_PIXEL_PTR *buffer;
Shinya Kitaoka 120a6e
  int scanline;
Shinya Kitaoka 120a6e
  int lx, ly;
Shinya Kitaoka 120a6e
  double x_pos, y_pos;
Shinya Kitaoka 120a6e
  UD44_COLORMAP cmap;
Shinya Kitaoka 120a6e
  int img_lx, img_ly;
Shinya Kitaoka 120a6e
  char *fullpath;
Shinya Kitaoka 120a6e
  double img_x_pos, img_y_pos; /*WARNING: leggi sotto!!! */
Toshihiro Shimizu 890ddd
} UD44_USR_IMAGE;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
/* 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.
Shinya Kitaoka 120a6e
            essi rappresentano, insieme a img_lx, img_ly
Shinya Kitaoka 120a6e
            (che quindi hanno un significato diverso nel caso UDIT user
Shinya Kitaoka 120a6e
   defined),
Shinya Kitaoka 120a6e
            il rect che contiene  TUTTA l'immagine di input transformata dagli
Shinya Kitaoka 120a6e
             fx seguenti alla udit corrente.
Shinya Kitaoka 120a6e
            Quindi, il rect rappresentato da lx, ly, x_pos, y_pos
Shinya Kitaoka 120a6e
            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
Shinya Kitaoka 120a6e
enum UD44_GOP_TYPE { UD44_GOP_SOURCE_TO_DEST, UD44_GOP_DEST_TO_SOURCE };
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
typedef int UD44_GOP_FUNC_TYPE(enum UD44_GOP_TYPE type, int num_rectin,
Shinya Kitaoka 120a6e
                               UD44_USR_IMAGE src_rects[],
Shinya Kitaoka 120a6e
                               UD44_USR_IMAGE *dst_rect, int argc,
Shinya Kitaoka 120a6e
                               const char *argv[],
Shinya Kitaoka 120a6e
                               const UD44_RENDER_INFO *info);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
typedef int UD44_ROP_FUNC_TYPE(int num_imgs_in, const UD44_USR_IMAGE imgs_in[],
Shinya Kitaoka 120a6e
                               const UD44_USR_IMAGE *img_out, int argc,
Shinya Kitaoka 120a6e
                               const char *argv[],
Shinya Kitaoka 120a6e
                               const UD44_RENDER_INFO *info);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef struct UDIT_DATA_V44U1 {
Shinya Kitaoka 120a6e
  char *version;
Shinya Kitaoka 120a6e
  char *udit_name;
Shinya Kitaoka 120a6e
  UD44_GOP_FUNC_TYPE *gop;
Shinya Kitaoka 120a6e
  UD44_ROP_FUNC_TYPE *rop;
Shinya Kitaoka 120a6e
  int num_args;
Shinya Kitaoka 120a6e
  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