removed high-level memory allocation functions from q.c to rfxswf.c.
[swftools.git] / lib / rfxswf.h
index 2e8bb43..5fa7d1b 100644 (file)
@@ -71,6 +71,10 @@ extern "C" {
 #define REVERSESWAP32(s) (REVERSESWAP16(((s)>>16)&0x0000ffff)|((REVERSESWAP16(s)<<16)&0xffff0000))
 #endif
 
+#define ALLOC_ARRAY(type, num) (((type)*)rfxalloc(sizeof(type)*(num)))
+void* rfxalloc(int size);
+void rfxdealloc(void*data);
+
 // SWF Types
 
 typedef         unsigned long   U32;
@@ -351,6 +355,12 @@ typedef struct _LINESTYLE
   RGBA          color;
 } LINESTYLE, * LPLINESTYLE;
 
+#define FILL_SOLID      0x00
+#define FILL_LINEAR     0x10  // Gradient
+#define FILL_RADIAL     0x12
+#define FILL_TILED      0x40  // Bitmap
+#define FILL_CLIPPED    0x41
+
 typedef struct _FILLSTYLE
 { U8       type;
   RGBA     color;
@@ -693,6 +703,7 @@ void swf_GetJPEGSize(char * fname, int*width, int*height);
 int swf_SetJPEGBits(TAG * t,char * fname,int quality);
 void swf_SetJPEGBits2(TAG * t,U16 width,U16 height,RGBA * bitmap,int quality);
 int swf_SetJPEGBits3(TAG * tag,U16 width,U16 height,RGBA* bitmap, int quality);
+RGBA* swf_JPEG2TagToImage(TAG*tag, int*width, int*height);
 
 #define BYTES_PER_SCANLINE(width) ((width+3)&0xfffffffc)
 
@@ -703,6 +714,9 @@ int swf_SetJPEGBits3(TAG * tag,U16 width,U16 height,RGBA* bitmap, int quality);
 int swf_SetLosslessBits(TAG * t,U16 width,U16 height,void * bitmap,U8 bitmap_flags);
 int swf_SetLosslessBitsIndexed(TAG * t,U16 width,U16 height,U8 * bitmap,RGBA * palette,U16 ncolors);
 int swf_SetLosslessBitsGrayscale(TAG * t,U16 width,U16 height,U8 * bitmap);
+RGBA* swf_DefineLosslessBitsTagToImage(TAG*tag, int*width, int*height);
+
+RGBA* swf_ExtractImage(TAG*tag, int*dwidth, int*dheight);
 
 // swfsound.c
 void swf_SetSoundStreamHead(TAG*tag, int avgnumsamples);