X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswffilter.c;h=02ef5dbdcfc15624bf7e57003afaa2edacc98576;hb=879d0eec420fe0fd5ddcd56c8fe62b82a6744edd;hp=6ca873907b4e51bd91020b213ccaabda97aab77d;hpb=6c3ab5574d31504d24710c2756899d49275c1a37;p=swftools.git diff --git a/lib/modules/swffilter.c b/lib/modules/swffilter.c index 6ca8739..02ef5db 100644 --- a/lib/modules/swffilter.c +++ b/lib/modules/swffilter.c @@ -1,3 +1,7 @@ +#include +#include +#include "../rfxswf.h" + char* filtername[] = {"dropshadow","blur","glow","bevel","gradientglow","convolution","colormatrix","gradientbevel", 0}; void swf_SetFilter(TAG*tag, FILTER*filter) @@ -9,6 +13,8 @@ void swf_SetFilter(TAG*tag, FILTER*filter) swf_SetFixed(tag, f->blury); U8 flags = f->passes << 3; swf_SetU8(tag, flags); + } else if(filter->type == FILTERTYPE_GLOW) { + FILTER_GLOW*f = (FILTER_GLOW*)filter; } else if(filter->type == FILTERTYPE_DROPSHADOW) { FILTER_DROPSHADOW*f = (FILTER_DROPSHADOW*)filter; swf_SetRGBA(tag, &f->color); @@ -63,6 +69,19 @@ FILTER*swf_GetFilter(TAG*tag) U8 flags = swf_GetU8(tag); f->passes = (flags&15)<<3; return (FILTER*)f; + } else if(type == FILTERTYPE_GLOW) { + FILTER_GLOW* f = (FILTER_GLOW*)rfx_calloc(sizeof(FILTER_GLOW)); + f->type = type; + swf_GetRGBA(tag, &f->rgba); + f->blurx = swf_GetFixed(tag); + f->blury = swf_GetFixed(tag); + f->strength = swf_GetFixed8(tag); + U8 flags = swf_GetU8(tag); + f->passes = flags&31; + f->innerglow = (flags>>7)&1; + f->knockout = (flags>>6)&1; + f->composite = (flags>>5)&1; + return (FILTER*)f; } else if(type == FILTERTYPE_GRADIENTGLOW) { FILTER_GRADIENTGLOW* f = (FILTER_GRADIENTGLOW*)rfx_calloc(sizeof(FILTER_GRADIENTGLOW)); f->type = type; @@ -143,3 +162,9 @@ FILTER*swf_NewFilter(U8 type) f->type = type; return f; } + +void swf_DeleteFilter(FILTER*f) +{ + //FIXME + free(f); +}