Viagra Vs Cialis

Average Rating: 4 out of 5 based on 68 user reviews.

Mario (quasimondo) had done it a few weeks ago, viagra vs cialis but I wanted to make my own glass filter. Viagra vs cialis The common technic is very simple. Viagra vs cialis You can use the native BevelFilter to create gradients for use with the native DisplacementMapFilter. Viagra vs cialis 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 vs cialis 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 vs cialis 0, viagra vs cialis 0, viagra vs cialis 1, viagra vs cialis 0, viagra vs cialis 0x40, viagra vs cialis 0x40, viagra vs cialis 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 vs cialis form.height, viagra vs cialis true, viagra vs cialis 0x008080 );

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

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

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

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

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

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

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

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

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

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

		//-- blend source form bitmap
		if( formAlpha > 0 )
		{
			translate.tx = mapPoint.x;
			translate.ty = mapPoint.y;
			blendForm.alphaMultiplier = formAlpha;
			output.draw( form, viagra vs cialis translate, viagra vs cialis blendForm, viagra vs cialis 'multiply' );
		}
	}
}
To implement the glass filter, viagra vs cialis 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 vs cialis 512, viagra vs cialis true, viagra vs cialis 0xcccccc );
attachBitmap( output, viagra vs cialis 0 );

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

//-- modify it, viagra vs cialis 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 vs cialis new Point( _xmouse - form.width / 2, viagra vs cialis _ymouse - form.height / 2 ) );
}

onMouseMove();