X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=lib%2Frfxswf.h;h=fc9afd55df97cd11bcdd9cd8b2ecf6a50e846e65;hb=1cbf8c7915e3202e87e73ccb342dba6207141908;hp=5efc48a82fe4d86e33a76e6430d8c7347923a8f6;hpb=cfb06dab4b1674078f1306d1c537ad03d00def26;p=swftools.git diff --git a/lib/rfxswf.h b/lib/rfxswf.h index 5efc48a..fc9afd5 100644 --- a/lib/rfxswf.h +++ b/lib/rfxswf.h @@ -40,10 +40,10 @@ typedef struct _SPOINT } SPOINT, * LPSPOINT; typedef struct _RGBA -{ U8 r; +{ U8 a; + U8 r; U8 g; U8 b; - U8 a; } RGBA, * LPRGBA; typedef struct _SRECT @@ -85,6 +85,18 @@ typedef struct _TAG // NEVER access a Tag-Struct directly ! U8 bitcount; // [write] } TAG, * LPTAG; +typedef struct _ActionTAG +{ U8 op; + U16 len; + U8 * data; + + struct _ActionTAG * next; + struct _ActionTAG * prev; + + TAG* parent; // may be null +} ActionTAG; + + typedef struct _SWF { U8 FileVersion; U32 FileSize; // valid after load and save @@ -420,6 +432,24 @@ int SetJPEGBitsFinish(JPEGBITS * jpegbits); int SetJPEGBits(TAG * t,char * fname,int quality); // paste jpg file into swf stream +#define BYTES_PER_SCANLINE(width) ((width+3)&0xfffffffc) + +#define BMF_8BIT 3 // Bitmap formats +#define BMF_16BIT 4 +#define BMF_32BIT 5 + +#define BM16_BLUE 0xf800 // Bitmasks for 16 Bit Color +#define BM16_RED 0x00f0 +#define BM16_GREEN 0x000f + +#define BM32_BLUE 0xff000000 // Bitmasks for 32 Bit Color +#define BM32_GREEN 0x00ff0000 +#define BM32_RED 0x0000ff00 + +int SetLosslessBits(TAG * t,U16 width,U16 height,void * bitmap,U8 bitmap_flags); +int SetLosslessBitsIndexed(TAG * t,U16 width,U16 height,U8 * bitmap,RGBA * palette,U16 ncolors); +int SetLosslessBitsGrayscale(TAG * t,U16 width,U16 height,U8 * bitmap); + // swftools.c char isDefiningTag(TAG * t); @@ -437,4 +467,9 @@ MATRIX * MatrixMapTriangle(MATRIX * m,int dx,int dy, void uncgi(); // same behaviour as Steven Grimm's uncgi-library +// swfaction.c + +ActionTAG* GetActions(TAG*tag); +void DumpActions(ActionTAG*atag, char*prefix); + #endif