Viagra London

Average Rating: 4.5 out of 5 based on 176 user reviews.

Mario (quasimondo) had done it a few weeks ago, viagra london but I wanted to make my own glass filter. Viagra london The common technic is very simple. Viagra london You can use the native BevelFilter to create gradients for use with the native DisplacementMapFilter. Viagra london This Assembly seems to refract the light from the enviroment and its fast. Here are the sources:

import flash.display.BitmapData;
import flash.filters.BevelFilter;
import flash.filters.DisplacementMapFilter;
import flash.filters.DropShadowFilter;
import flash.geom.ColorTransform;
import flash.geom.Matrix;
import flash.geom.Point;
import flash.geom.Rectangle;

class de.popforge.filter.Glass
{
	//-- properties
	public var distance: Number;
	public var edgeSmooth: Number;
	public var formAlpha: Number;
	public var displace: Number;

	//-- sources
	private var form: BitmapData;
	private var back: BitmapData;

	//-- geom
	private var origin: Point;
	private var bounds: Rectangle;
	private var identity: Matrix;
	private var translate: Matrix;

	//-- ColorTransform
	private var grayMaker: ColorTransform;
	private var blendForm: ColorTransform;

	//-- Gradient Filters
	private var hDist: BevelFilter;
	private var vDist: BevelFilter;

	//-- effect helpers
	private var d0: BitmapData;
	private var d1: BitmapData;
	private var dd: BitmapData;
	private var grayForm: BitmapData;

	//-- displacement
	private var displacement: DisplacementMapFilter;

	//-- constructor
	public function Glass( form: BitmapData, viagra london back: BitmapData )
	{
		this.form = form;
		this.back = back;

		init();
	}

	private function init(): Void
	{
		//-- default values
		distance = 3;
		edgeSmooth = 3;
		formAlpha = 0;
		displace = 64;

		//-- transform an image to be gray
		grayMaker = new ColorTransform( 0, viagra london 0, viagra london 0, viagra london 1, viagra london 0, viagra london 0x40, viagra london 0x40, viagra london 0 );
		blendForm = new ColorTransform();

		//-- some default geom properties
		origin = new Point();
		bounds = form.rectangle;
		identity = new Matrix();
		translate = new Matrix();

		//-- form as gray color
		grayForm = new BitmapData( form.width, viagra london form.height, viagra london true, viagra london 0x008080 );

		//-- displacement image sources
		d0 = new BitmapData( form.width, viagra london form.height, viagra london true, viagra london 0x008080 );
		d1 = new BitmapData( form.width, viagra london form.height, viagra london true, viagra london 0x008080 );
		dd = new BitmapData( form.width, viagra london form.height, viagra london false, viagra london 0x008080 );

		//-- use bevelfilter to apply displacement gradient (x, viagra london y)
		hDist = new BevelFilter( distance, viagra london 180, viagra london 0x008000, viagra london 100, viagra london 0, viagra london 100, viagra london edgeSmooth, viagra london edgeSmooth, viagra london 1, viagra london 3, viagra london 'inner' );
		vDist = new BevelFilter( distance, viagra london 270, viagra london 0x000080, viagra london 100, viagra london 0, viagra london 100, viagra london edgeSmooth, viagra london edgeSmooth, viagra london 1, viagra london 3, viagra london 'inner' );

		//-- displacementMapFilter
		displacement = new DisplacementMapFilter( dd, viagra london origin, viagra london 2, viagra london 4, viagra london -displace, viagra london -displace, viagra london 'ignore' );

		//-- init displacement gradient source
		onFormChanged();
	}

	public function onFormChanged(): Void
	{
		//-- copy form and apply gray 'color'
		grayForm.copyPixels( form, viagra london bounds, viagra london origin );
		grayForm.colorTransform( bounds, viagra london grayMaker );

		//-- apply displacement gradients
		d0.applyFilter( grayForm, viagra london bounds, viagra london origin, viagra london hDist );
		d1.applyFilter( grayForm, viagra london bounds, viagra london origin, viagra london vDist );

		//-- merge gradients
		dd.draw( d0, viagra london identity, viagra london null, viagra london null, viagra london null, viagra london true );
		dd.draw( d1, viagra london identity, viagra london null, viagra london 'add', viagra london null, viagra london true );
	}

	public function update( output: BitmapData, viagra london mapPoint: Point ): Void
	{
		//-- translate mapPoint
		displacement.mapPoint = mapPoint;

		//-- copy background to output
		output.copyPixels( back, viagra london back.rectangle, viagra london origin );

		//-- apply displacement
		output.applyFilter( output, viagra london back.rectangle, viagra london origin, viagra london displacement );

		//-- blend source form bitmap
		if( formAlpha > 0 )
		{
			translate.tx = mapPoint.x;
			translate.ty = mapPoint.y;
			blendForm.alphaMultiplier = formAlpha;
			output.draw( form, viagra london translate, viagra london blendForm, viagra london 'multiply' );
		}
	}
}
To implement the glass filter, viagra london just write a few rows code in the first frame:
import flash.display.*;
import flash.filters.*;
import flash.geom.*;
import de.popforge.filter.Glass;

//-- get glass form and background as bitmaps from the library
var form: BitmapData = BitmapData.loadBitmap( 'form' );
var back: BitmapData = BitmapData.loadBitmap( 'back' );

//-- create an output bitmap
var output: BitmapData = new BitmapData( 512, viagra london 512, viagra london true, viagra london 0xcccccc );
attachBitmap( output, viagra london 0 );

//-- create a glass instance
var glass: Glass = new Glass( form, viagra london back );

//-- modify it, viagra london that a little bit from the glass source image will appear
//-- more public properties can be found in the class
glass.formAlpha = .5;

//-- update filter after mouse is moved
onMouseMove = function()
{
	glass.update( output, viagra london new Point( _xmouse - form.width / 2, viagra london _ymouse - form.height / 2 ) );
}

onMouseMove();