Re: [swfmill] Filter and blending mode support

2006-06-09 Thread Steve Webster
HI Dan,

> Steve, great work! I'm not following so closely- so make sure to let me know 
> when you consider the flash8 stuff finished enough to apply and do a release, 
> or in fact when it's interesting maybe to push out another pre.

Another pre will be necessary. I want to get the usual suspects
testing the builds before we consider a new release.

>   > Just to keep you all updated, I now have a working implementation of a
>   > ColorMatrix class in C++. All I need to do now (he says, tongue in
>   > cheek) is plum this into swfmill-s somehow.
>
> it shouldnt be that hard really- have a look at the swft_* stuff to see how 
> to roll your own xslt:extension function. make sure they are registered in 
> swft.cpp (there you also might find the most simple examples). the idea is 
> ofcourse to then call this function from the simple-to-lowlevel xslt. those 
> functions can both receive and produce nodesets (i'm unsure if i have a 
> function that takes a nodeset as parameter- but it shouldnt be so hard. 
> libxslt/exslt source is also a good source of knowledge). let me know in case 
> you need help.

Yeah, I've fond it surprisingly easy to implement the
swft:color-matrix element. This is now all working, translating
brightness, contrast, saturation and hue coloe adjustments into an
IDE-compatible matrix. However, something's up with my earlier work on
filter support in swfmill-ll. It seems to read to much information for
two of the filters (though I'm not sure which ones yet), and writes
too much information for the color matrix filter. I'll get to the
bottom of it though, but not tomorrow - a small matter of a World Cup
opener for England.

Night all,

Steve

PS. Dan. Did you get chance to have a look at the float bug test case
as mentioned in my original mail? No worries if not - I know you're
busy with xinf - but I need that bug fix to be committed before my
filter stuff.

-- 
Steve Webster
http://dynamicflash.com

___
swfmill mailing list
swfmill@osflash.org
http://osflash.org/mailman/listinfo/swfmill_osflash.org


Re: [swfmill] Filter and blending mode support

2006-06-09 Thread daniel fischer

Steve, great work! I'm not following so closely- so make sure to let me know 
when you consider the flash8 stuff finished enough to apply and do a release, 
or in fact when it's interesting maybe to push out another pre.

"Steve Webster" <[EMAIL PROTECTED]> (on Fri, 9 Jun 2006 15:26:09 +0100):

  > Just to keep you all updated, I now have a working implementation of a
  > ColorMatrix class in C++. All I need to do now (he says, tongue in
  > cheek) is plum this into swfmill-s somehow.

it shouldnt be that hard really- have a look at the swft_* stuff to see how to 
roll your own xslt:extension function. make sure they are registered in 
swft.cpp (there you also might find the most simple examples). the idea is 
ofcourse to then call this function from the simple-to-lowlevel xslt. those 
functions can both receive and produce nodesets (i'm unsure if i have a 
function that takes a nodeset as parameter- but it shouldnt be so hard. 
libxslt/exslt source is also a good source of knowledge). let me know in case 
you need help.

-dan

-- 
http://0xDF.com/
http://iterative.org/

___
swfmill mailing list
swfmill@osflash.org
http://osflash.org/mailman/listinfo/swfmill_osflash.org


Re: [swfmill] Filter and blending mode support

2006-06-09 Thread Steve Webster
Hi Folks,

Just to keep you all updated, I now have a working implementation of a
ColorMatrix class in C++. All I need to do now (he says, tongue in
cheek) is plum this into swfmill-s somehow.

I also noticed that the  element contains one two many
s. I'll look into that soon-ish.

Cheers,

Steve

-- 
Steve Webster
http://dynamicflash.com

___
swfmill mailing list
swfmill@osflash.org
http://osflash.org/mailman/listinfo/swfmill_osflash.org


Re: [swfmill] Filter and blending mode support

2006-06-08 Thread Steve Webster
> Actually the IDE exposes the colour matrix filter as brightness,
> contrast, saturation and hue sliders from -100 to 100. So, what I'm
> thinking is do away with the matrix and just have:
>
>  saturation="[-100 - 100]" hue="[-100 - 100]" />

Slight correction on this. Hue is specified in degrees (think rotation
around a colour wheel) and has a range of -180 to 180, so we have:



Cheers,

Steve

-- 
Steve Webster
http://dynamicflash.com

___
swfmill mailing list
swfmill@osflash.org
http://osflash.org/mailman/listinfo/swfmill_osflash.org


Re: [swfmill] Filter and blending mode support

2006-06-08 Thread Steve Webster
Hi Ian,
>   Great idea!
>
>   Grant Skinner has written a pretty comprehensive AS2 ColorMatrix
> class which should help:
> http://www.gskinner.com/blog/archives/2005/09/flash_8_source.html
>
> as has Mario/Quasimondo:
> http://www.quasimondo.com/archives/000565.php
>
> I think that should give you all the needed info.

Perfect - thank you very much for these. No wonder I couldn't guess my
way to an implementation.

It'll take a while to get this implemented. XSLT can't handle this
type of calculation natively, but thankfully we can inject our own
functions. I just need to familiarise myself with that part of
swfmill.

Thanks again!

Steve

-- 
Steve Webster
http://dynamicflash.com

___
swfmill mailing list
swfmill@osflash.org
http://osflash.org/mailman/listinfo/swfmill_osflash.org


Re: [swfmill] Filter and blending mode support

2006-06-08 Thread Steve Webster
> Steve, why don't keep it simple ?
> Since the IDE gives this representation
>
> >  > saturation="[-100 - 100]" hue="[-100 - 100]" />
>
> why not stick with that for 

That's exactly what I'm going to do, thanks to Ian's links. Also, if
you wanted more control you could use swfmill-ll syntax, which has the
full matrix.

Cheers,

Steve

-- 
Steve Webster
http://dynamicflash.com

___
swfmill mailing list
swfmill@osflash.org
http://osflash.org/mailman/listinfo/swfmill_osflash.org


Re: [swfmill] Filter and blending mode support

2006-06-08 Thread Ian Thomas
Hi Steve,
  Great idea!

  Grant Skinner has written a pretty comprehensive AS2 ColorMatrix
class which should help:
http://www.gskinner.com/blog/archives/2005/09/flash_8_source.html

as has Mario/Quasimondo:
http://www.quasimondo.com/archives/000565.php

I think that should give you all the needed info.

Cheers,
  Ian

On 6/8/06, Steve Webster <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> > 
> >  
> >  
> >  
> >  
> > 
>
> Actually the IDE exposes the colour matrix filter as brightness,
> contrast, saturation and hue sliders from -100 to 100. So, what I'm
> thinking is do away with the matrix and just have:
>
>  saturation="[-100 - 100]" hue="[-100 - 100]" />

___
swfmill mailing list
swfmill@osflash.org
http://osflash.org/mailman/listinfo/swfmill_osflash.org


Re: [swfmill] Filter and blending mode support

2006-06-08 Thread erixtekila
Steve, why don't keep it simple ?
Since the IDE gives this representation

>  saturation="[-100 - 100]" hue="[-100 - 100]" />

why not stick with that for 

We could anyhow use matrix directly from script.
Should suffice ain't it ?
---
erixtekila
http://blog.v-i-a.net/


___
swfmill mailing list
swfmill@osflash.org
http://osflash.org/mailman/listinfo/swfmill_osflash.org


Re: [swfmill] Filter and blending mode support

2006-06-08 Thread Steve Webster
Hi All,

> 
>  
>  
>  
>  
> 

Actually the IDE exposes the colour matrix filter as brightness,
contrast, saturation and hue sliders from -100 to 100. So, what I'm
thinking is do away with the matrix and just have:



However, I need to work out a way to translate those values into a
matrix. So far I've been reverse engineering a couple of IDE-generated
examples, but I can't work out how they get from the BCSH values to
the matrix.

I can tell you that with all the values at 0, we get an identity matrix:

1, 0, 0, 0, 0
0, 1, 0, 0, 0
0, 0, 1, 0, 0
0, 0, 0, 1, 0

Note that there is a final row to this matrix (so it's 5x5) which is always:

0, 0, 0, 0, 1

...and is NOT stored in the SWF because it never changes. This
completes the identity matrix.

The product of this matrix and RBGA value for each pixel to which the
filter is applied is the resultant value for each component of the
rendered pixel.

[R']  [1, 0, 0, 0, 0] [R]
[G']  [0, 1, 0, 0, 0] [G]
[B']  =  [0, 0, 1, 0, 0] [B]
[A']  [0, 0, 0, 1, 0] [A]
[1']   [0, 0, 0, 0, 1] [1]

So the RGBA values stay the same.

Here are some of the other values I've reverse engineered thus far:

B0 C0 S0 H0

1, 0, 0, 0, 0
0, 1, 0, 0, 0
0, 0, 1, 0, 0
0, 0, 0, 1, 0


B100 C0 S0 H0

1, 0, 0, 0, 100
0, 1, 0, 0, 100
0, 0, 1, 0, 100
0, 0, 0, 1, 0


B0 C100 S0 H0

11, 0, 0, 0, -635
0, 11, 0, 0, -635
0, 0, 11, 0, -635
0, 0, 0, 11, 0


B0 C50 S0 H0

2, 0, 0, 0, -63.5
0, 2, 0, 0, -63.5
0, 0, 2, 0, -63.5
0, 0, 0, 1, 0


B0 C-100 S0 H0

0, 0, 0, 0, 63.5
0, 0, 0, 0, 63.5
0, 0, 0, 0, 63.5
0, 0, 0, 1, 0


B0 C-50 S0 H0

0.5, 0, 0, 0, 31.75
0, 0.5, 0, 0, 31.75
0, 0, 0.5, 0, 31.75
0, 0, 0, 1, 0


If there's a standard algorithm for doing this that someone knows
(anyone want to contact [EMAIL PROTECTED] - this is right up his street)
then please feel free to enlighten me.

Cheers,

Steve

-- 
Steve Webster
http://dynamicflash.com

___
swfmill mailing list
swfmill@osflash.org
http://osflash.org/mailman/listinfo/swfmill_osflash.org


Re: [swfmill] Filter and blending mode support

2006-06-08 Thread erixtekila
> Sorry, Erix, didn't want to pick on you! Just trying to put words on
> why I was uncomfortable with your version... :-)
You're welcome ;)

Le 8 juin 06, à 09:36, Ian Thomas a écrit :

> Have just checked the XML spec - and tags can't start with a number as
> a character, so unfortunately erix's version won't work.
It was just for clarity.

>
> Also, just thinking it through - tags which vary their names (i.e. we
> don't know whether the first child of  would be <1> or <2> or
> <99>, or whether any given element <1> would have children or not)
> make it harder for the XSL transform and also for creating a
> validating schema (if you wanted to do so).
This is the point why I was proposing nesting as a mean of sequence.
The order of the child will be maningful.

I think your proposition is harder to analyse from a xslt point of view 
:
>> 
>> 1,2,3,4,
>> 4,2,5,4,
>> 1,1,3,9,
>> 9,2,3,1
>> 

or
>> 
>>  
>>  
>>  
>>  
>> 

We've got to find a nested and sequencial structure in xml.

Cheers.
---
erixtekila
http://blog.v-i-a.net/

___
swfmill mailing list
swfmill@osflash.org
http://osflash.org/mailman/listinfo/swfmill_osflash.org


Re: [swfmill] Filter and blending mode support

2006-06-08 Thread Ian Thomas
Have just checked the XML spec - and tags can't start with a number as
a character, so unfortunately erix's version won't work.

Also, just thinking it through - tags which vary their names (i.e. we
don't know whether the first child of  would be <1> or <2> or
<99>, or whether any given element <1> would have children or not)
make it harder for the XSL transform and also for creating a
validating schema (if you wanted to do so).

Sorry, Erix, didn't want to pick on you! Just trying to put words on
why I was uncomfortable with your version... :-)

Cheers,
  Ian

On 6/8/06, Ian Thomas <[EMAIL PROTECTED]> wrote:
> 
>  
>  
>  
>  
> 
>
> (I'm afraid I don't like erix's use of numbers as tag names - in fact,
> I'm not convinced it's legal XML...)
>
> or possibly just a string of numbers:
> 
> 1,2,3,4,
> 4,2,5,4,
> 1,1,3,9,
> 9,2,3,1
> 
> ... and leave it up to the coder how to format it - but I think this
> version is too error-prone (very easy to miss off a comma, for
> example).
>
> Cheers,
>   Ian

___
swfmill mailing list
swfmill@osflash.org
http://osflash.org/mailman/listinfo/swfmill_osflash.org


Re: [swfmill] Filter and blending mode support

2006-06-08 Thread Ian Thomas

 
 
 
 


(I'm afraid I don't like erix's use of numbers as tag names - in fact,
I'm not convinced it's legal XML...)

or possibly just a string of numbers:

1,2,3,4,
4,2,5,4,
1,1,3,9,
9,2,3,1

... and leave it up to the coder how to format it - but I think this
version is too error-prone (very easy to miss off a comma, for
example).

Cheers,
  Ian

On 6/8/06, erixtekila <[EMAIL PROTECTED]> wrote:
> >
> > http://mirror1.cvsdude.com/trac/osflash/swfmill/attachment/ticket/14/
> > filter.swfml
>
> So the difference between gradient glow and glow is the presence of
> gradient child node ?
> Same for bevel ?
> Nice.
>
>
> > Please have a look and let me know what you think. Oh, and if anyone
> > has any great ideas on how to represent a 4x4 matrix as easy to
> > read/write xml (for the  filter) let me know.
> >
> <1>
> <1/>
> <2/>
> <3/>
> <4/>
> <1/>
> <2>
> <1/>
> <2/>
> <3/>
> <4/>
> <2/>
>
> Isn't it a 4x5 matrix instead ?
> http://livedocs.macromedia.com/flash/8/main/2079.html
>
> Can't see anything simpler… unfortunatly.
> ---
> erixtekila
> http://blog.v-i-a.net/
>
> ___
> swfmill mailing list
> swfmill@osflash.org
> http://osflash.org/mailman/listinfo/swfmill_osflash.org
>

___
swfmill mailing list
swfmill@osflash.org
http://osflash.org/mailman/listinfo/swfmill_osflash.org


Re: [swfmill] Filter and blending mode support

2006-06-07 Thread erixtekila
>
> http://mirror1.cvsdude.com/trac/osflash/swfmill/attachment/ticket/14/ 
> filter.swfml

So the difference between gradient glow and glow is the presence of  
gradient child node ?
Same for bevel ?
Nice.


> Please have a look and let me know what you think. Oh, and if anyone
> has any great ideas on how to represent a 4x4 matrix as easy to
> read/write xml (for the  filter) let me know.
>
<1>
<1/>
<2/>
<3/>
<4/>
<1/>
<2>
<1/>
<2/>
<3/>
<4/>
<2/>

Isn't it a 4x5 matrix instead ?
http://livedocs.macromedia.com/flash/8/main/2079.html

Can't see anything simpler… unfortunatly.
---
erixtekila
http://blog.v-i-a.net/

___
swfmill mailing list
swfmill@osflash.org
http://osflash.org/mailman/listinfo/swfmill_osflash.org


Re: [swfmill] Filter and blending mode support

2006-06-07 Thread Steve Webster
Okay folks, I've drawn up a draft of how filter and blending mode
support might look in swfmill-s syntax.

http://mirror1.cvsdude.com/trac/osflash/swfmill/attachment/ticket/14/filter.swfml

Please have a look and let me know what you think. Oh, and if anyone
has any great ideas on how to represent a 4x4 matrix as easy to
read/write xml (for the  filter) let me know.

'night all,

Steve

PS. I've yet to check some of the datatypes for existing swfmill-s
compatibility. For example, if swfmill-s doesn't currently support 3
digit RGB hex values (#rgb instead of #rrggbb) then this won't be
supported in the filter syntax. Having said that, anything here that
swfmill-s doesn't currently support might be worthy of its own ticket.

-- 
Steve Webster
http://dynamicflash.com

___
swfmill mailing list
swfmill@osflash.org
http://osflash.org/mailman/listinfo/swfmill_osflash.org


Re: [swfmill] Filter and blending mode support

2006-06-07 Thread Steve Webster
> Wow, there are so much combinaisons with those filters params !
> What about creating a  tag.
> Those could be collections of filters mode like :
>
> 
> 
> 
> 
> 
> 

Good start. I agree with Ian though, we don't need hasFilter="true"
since we can derive that from there being a  element.

> PS : did you manage to look at DefineFont3 swftag ?

Not yet. Is that one of the bugs listed on the Trac site? If so, point
me to it and I'll have a look when I get time.

Cheers,

Steve

-- 
Steve Webster
http://dynamicflash.com

___
swfmill mailing list
swfmill@osflash.org
http://osflash.org/mailman/listinfo/swfmill_osflash.org


Re: [swfmill] Filter and blending mode support

2006-06-07 Thread Ian Thomas
Do you need the hasFilter if the  tag is defined..?

Ian

On 6/7/06, erixtekila <[EMAIL PROTECTED]> wrote:
> > I'll go on now to work on swfmill-simple support for this. Any/all
> > suggestions for simple syntax for applying filters and blending modes
> > to the  element are welcome at this point.
> Wow, there are so much combinaisons with those filters params !
> What about creating a  tag.
> Those could be collections of filters mode like :
>
> 
> 
> 
> 
> 
> 
>
> HTH.
>
> PS : did you manage to look at DefineFont3 swftag ?
>
> Best
> ---
> erixtekila
> http://blog.v-i-a.net/
>
> ___
> swfmill mailing list
> swfmill@osflash.org
> http://osflash.org/mailman/listinfo/swfmill_osflash.org
>

___
swfmill mailing list
swfmill@osflash.org
http://osflash.org/mailman/listinfo/swfmill_osflash.org


Re: [swfmill] Filter and blending mode support

2006-06-07 Thread erixtekila
> I'll go on now to work on swfmill-simple support for this. Any/all
> suggestions for simple syntax for applying filters and blending modes
> to the  element are welcome at this point.
Wow, there are so much combinaisons with those filters params !
What about creating a  tag.
Those could be collections of filters mode like :








HTH.

PS : did you manage to look at DefineFont3 swftag ?

Best
---
erixtekila
http://blog.v-i-a.net/

___
swfmill mailing list
swfmill@osflash.org
http://osflash.org/mailman/listinfo/swfmill_osflash.org