X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Frfxswf.h;h=9189cf4fdb049cb9ecf0a2dd25790e8493798c2a;hb=69884d51cc4c66b5811d4f6318c0c85745e09345;hp=03b6ef2bdd5bb0c9eee64f9e43a709901b8a374b;hpb=c011b1c37df2a64a1f8e454c23bb5b7e9854ab67;p=swftools.git diff --git a/lib/rfxswf.h b/lib/rfxswf.h index 03b6ef2..9189cf4 100644 --- a/lib/rfxswf.h +++ b/lib/rfxswf.h @@ -38,6 +38,7 @@ extern "C" { #include "../config.h" #include "./bitio.h" #include "./drawer.h" +#include "./mem.h" #define DEBUG_RFXSWF #ifdef RFXSWF_DISABLESOUND @@ -72,16 +73,6 @@ 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* rfx_alloc(int size); -void* rfx_calloc(int size); -void* rfx_realloc(void*data, int size); -void rfx_free(void*data); -#ifdef MEMORY_INFO -long rfx_memory_used(); -char* rfx_memory_used_str(); -#endif - // SWF Types typedef unsigned long U32; @@ -460,7 +451,6 @@ void swf_Shape2Free(SHAPE2 * s); void swf_DumpShape(SHAPE2*shape2); void swf_ParseDefineShape(TAG*tag, SHAPE2*shape); -void swf_Shape2ToShape(SHAPE2*shape2, SHAPE*shape); void swf_SetShape2(TAG*tag, SHAPE2*shape2); void swf_RecodeShapeData(U8*data, int bitlen, int in_bits_fill, int in_bits_line, @@ -724,6 +714,8 @@ int swf_SetJPEGBits3(TAG * tag,U16 width,U16 height,RGBA* bitmap, int quality); RGBA* swf_JPEG2TagToImage(TAG*tag, int*width, int*height); void swf_RemoveJPEGTables(SWF*swf); +void swf_SaveJPEG(char*filename, RGBA*pixels, int width, int height, int quality); + #define BYTES_PER_SCANLINE(width) ((width+3)&0xfffffffc) #define BMF_8BIT 3 // Bitmap formats @@ -745,6 +737,10 @@ TAG* swf_AddImage(TAG*tag, int bitid, RGBA*mem, int width, int height, int quali void swf_SetSoundStreamHead(TAG*tag, int avgnumsamples); void swf_SetSoundStreamBlock(TAG*tag, S16*samples, int seek, char first); /* expects 2304 samples */ void swf_SetSoundDefine(TAG*tag, S16*samples, int num); +void swf_SetSoundDefineMP3(TAG*tag, U8* data, unsigned length, + unsigned SampRate, + unsigned Channels, + unsigned NumFrames); void swf_SetSoundInfo(TAG*tag, SOUNDINFO*info); // swftools.c @@ -755,6 +751,9 @@ U8 swf_isPseudoDefiningTag(TAG * t); U8 swf_isAllowedSpriteTag(TAG * t); U8 swf_isImageTag(TAG*tag); U8 swf_isShapeTag(TAG*tag); +U8 swf_isTextTag(TAG*tag); +U8 swf_isFontTag(TAG*tag); +U8 swf_isPlaceTag(TAG*tag); U16 swf_GetDefineID(TAG * t); SRECT swf_GetDefineBBox(TAG * t); @@ -774,6 +773,8 @@ void swf_RelocateDepth(SWF*swf, char*bitmap); // bitmap is 65536 bytes, bitmap[d TAG* swf_Concatenate (TAG*list1,TAG*list2); // warning: both list1 and list2 are invalid after this call. +RGBA swf_GetSWFBackgroundColor(SWF*swf); + // swfcgi.c void swf_uncgi(); // same behaviour as Steven Grimm's uncgi-library @@ -974,11 +975,12 @@ typedef struct RENDERBUF void*internal; } RENDERBUF; -void swf_Render_Init(RENDERBUF*buf, int posx, int posy, int width, int height, char antialize, int scale); +void swf_Render_Init(RENDERBUF*buf, int posx, int posy, int width, int height, int antialize, int multiply); void swf_Render_SetBackground(RENDERBUF*buf, RGBA*img, int width, int height); void swf_Render_SetBackgroundColor(RENDERBUF*buf, RGBA color); RGBA* swf_Render(RENDERBUF*dest); void swf_RenderShape(RENDERBUF*dest, SHAPE2*shape, MATRIX*m, CXFORM*c, U16 depth,U16 clipdepth); +void swf_RenderSWF(RENDERBUF*buf, SWF*swf); void swf_Render_AddImage(RENDERBUF*buf, U16 id, RGBA*img, int width, int height); void swf_Render_ClearCanvas(RENDERBUF*dest); void swf_Render_Delete(RENDERBUF*dest);