Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Using Acrobat on a CD
Sprite Works
Checking an open database - Valentina
Check For Previous Open
Iconizer
open control pannel
TCP UDP Xtra
Go Loop
Useful string functions
Set Linked Property of a Flash member
MediaMacros Xtras Mall
 

 

 

Behavior Fast Blur Algorithm

Added on 8/23/2005

 

Compatibilities:
behavior D8 D8_5 D9

This item has not yet been rated

Author: Chunick (website)

This imaging algorithm is a fast blur. It will not work in real time, but it's quick, nonetheless.

-- Fast Blur Imaging Code
-- ©2005 by Josh Chunick (josh@chunick.com)
-- This code is free to use in commercial applications
-- or however you want. If you use this code you
-- must keep the comments, including this message,
-- intact. Feel free to add any changes or make
-- improvements.

-- anImage is an image object
-- hBlur is the amount of blurring as an integer or float
-- vBlur is the amount of blurring as an integer or float

on fastBlur (anImage, hBlur, vBlur)
  newImage = anImage.duplicate()
  theWidth = newImage.width - 1
  theHeight = newImage.height - 1
  
  -- draw each pixel in the new image
  repeat with y1 = 0 to theHeight
    
    repeat with x1 = 0 to theWidth
      
      interplY1 = max(min(y1 - vBlur, y1 - 1), 1)
      interplX1 = max(min(x1 - hBlur, x1 - 1), 1)
      interplY2 = min(max(y1 + vBlur, y1 + 1), theHeight)
      interplX2 = min(max(x1 + hBlur, x1 + 1), theWidth)
      newImage.copyPixels(anImage, rect(x1,y1,x1 + 1,y1 + 1), rect(interplX1,interplY1,interplX2,interplY2))
      
    end repeat
  end repeat
  
  return newImage
  
end

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail