prev | index | next

Flash8 - Convolution2
8
12
589 bytes
947 bytes
2005-10-13 00:00:00
2005-10-13 20:26:16
Oldes (oliva.david@seznam.cz)


To test and demonstrate the ConvolutionFilter

(swf8-convolution2.rswf)
background 255.255.255
es: emptySprite
foto: place es
include %includes/txt_info.rswf
doAction [
    foto.loadMovie("images/noparking.jpg")

    d: 5 dir: 0.5
    changeConv: func[][
        info: reform ["divisor:" matrix/5]
        d: d + dir
        if d > 7 [dir: -0.5] else if d = 5 [dir: 0.5]
        ;conv.bias: d
        matrix: [
            -2 dir 0
            dir d dir
            0 dir -2
        ]
        conv: make flash.filters.ConvolutionFilter[
            3   ;matrixX
            3   ;matrixY
            matrix
            3   ;divisor
            0   ;bias
            false   ;preserveAlpha
            false   ;clamp (Indicates whether the image should be clamped)
            #000000 ;color
            0   ;alpha
        ]
        foto.filters: [conv]
    ]
    changeConv()
    setInterval(changeConv 200)
]

showFrame end