「gifFile(API)」の版間の差分
提供: Eospedia
(ページの作成:「DataExpress/'''gifFile'''はgifファイルを取り扱うのためのAPI です。 == 定数 == #define scdGCT (0x80) #define scdGCTcres (0x70) #define scdGC...」) |
|||
| 行19: | 行19: | ||
#define OPEN_ERROR -3 | #define OPEN_ERROR -3 | ||
#define CREATE_ERROR -4 | #define CREATE_ERROR -4 | ||
| + | |||
| + | #define LOCAL static | ||
| + | #define IMPORT extern | ||
| + | |||
| + | #define FAST register | ||
| + | |||
| + | typedef short WORD; | ||
| + | typedef unsigned short UWORD; | ||
| + | typedef char TEXT; | ||
| + | typedef unsigned char UTINY; | ||
| + | typedef long LONG; | ||
| + | typedef unsigned long ULONG; | ||
| + | typedef int INT; | ||
== 構造体 == | == 構造体 == | ||
| 行90: | 行103: | ||
char Tailer; | char Tailer; | ||
} gifFile; | } gifFile; | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
== API == | == API == | ||
2014年5月16日 (金) 01:02時点における版
DataExpress/gifFileはgifファイルを取り扱うのためのAPI です。
定数
#define scdGCT (0x80) #define scdGCTcres (0x70) #define scdGCTsort (0x08) #define scdGCTsize (0x07)
#define imdLCT (0x80) #define imdInterlace (0x40) #define imdLCTsort (0x20) #define imdRESV (0x18) #define imdLCTsize (0x07)
#define OUT_OF_MEMORY -10 #define BAD_CODE_SIZE -20 #define READ_ERROR -1 #define WRITE_ERROR -2 #define OPEN_ERROR -3 #define CREATE_ERROR -4
#define LOCAL static #define IMPORT extern
#define FAST register
typedef short WORD; typedef unsigned short UWORD; typedef char TEXT; typedef unsigned char UTINY; typedef long LONG; typedef unsigned long ULONG; typedef int INT;
構造体
typedef struct gifFileHeader {
char sig[3];
char ver[3];
} gifFileHeader;
typedef struct gifFileImageDesc {
unsigned char id;
unsigned short xleft;
unsigned short ytop;
unsigned short imwidth;
unsigned short imheight;
unsigned char flags;
} gifFileImageDesc;
typedef struct gifFileColorTable {
unsigned char r;
unsigned char g;
unsigned char b;
} gifFileColorTable;
typedef struct gifFileImageDefinition {
gifFileImageDesc Desc;
gifFileColorTable* LCT;
} gifFileImageDefinition;
typedef struct gifFileCtrlExtensions {
unsigned char id;
unsigned char label;
unsigned char size;
unsigned char flags;
unsigned short delay;
unsigned char trcrl;
} gifFileCtrlExtensions;
typedef struct gifFileCommentExtensions {
unsigned char id;
unsigned char label;
} gifFileCommentExtensions;
typedef struct gifFileTextExtensions {
unsigned char id;
unsigned char label;
unsigned char size;
unsigned char xleft;
unsigned short ytop;
unsigned char txwidth;
unsigned char txheight;
unsigned char cewidth;
unsigned char ceheight;
unsigned char fgclr;
unsigned short bgclr;
} gifFileTextExtensions;
typedef struct gifFileApplicationExtensions {
unsigned char id;
unsigned char label;
unsigned char size;
char apname[8];
char apcode[3];
} gifFileApplicationExtensions;
typedef struct gifFile {
gifFileHeader Header;
gifFileScreenDesc ScrDesc;
gifFileColorTable* GCT;
long nImage;
gifFileImageDefinition* ImageDef;
char Tailer;
} gifFile;
API
extern int lmrc2gif(char* out, mrcImage* in, ColorMapObject* ColorMap, long mode); extern int lmrc2gifColor(char* out, mrcImage* r, mrcImage* g, mrcImage* b, ColorMapObject* ColorMap, int n, int nr, int ng, int nb, long mode);
extern ColorMapObject* gifColorMapInit(int n, long mode); extern ColorMapObject* gifColorMapGrey(ColorMapObject* ColorMap, int n); extern ColorMapObject* gifColorMapColor(ColorMapObject* ColorMap, int n, int nr, int ng, int nb);