1//////////////////////////////////////////////////////////////////////////////// 2// 3// ADOBE SYSTEMS INCORPORATED 4// Copyright 2008 Adobe Systems Incorporated 5// All Rights Reserved. 6// 7// NOTICE: Adobe permits you to use, modify, and distribute this file 8// in accordance with the terms of the license agreement accompanying it. 9// 10//////////////////////////////////////////////////////////////////////////////// 11 12package mx.filters 13{ 14import flash.events.IEventDispatcher; 15import flash.filters.BitmapFilterQuality; 16 17/** 18 * Base class for some Spark filters. 19 * 20 * @langversion 3.0 21 * @playerversion Flash 10 22 * @playerversion AIR 1.5 23 * @productversion Flex 4 24 */ 25public class BaseDimensionFilter extends BaseFilter 26{ 27 28 /** 29 * Constructor. 30 * 31 * @langversion 3.0 32 * @playerversion Flash 10 33 * @playerversion AIR 1.5 34 * @productversion Flex 4 35 */ 36 public function BaseDimensionFilter() 37 { 38 super(); 39 } 40 41 //---------------------------------- 42 // blurX 43 //---------------------------------- 44 45 private var _blurX:Number = 4.0; 46 47 [Inspectable(minValue="0.0", maxValue="255.0")] 48 49 /** 50 * The amount of horizontal blur. Valid values are 0 to 255. A blur of 1 51 * or less means that the original image is copied as is. The default 52 * value is 4. Values that are a power of 2 (such as 2, 4, 8, 16, and 32) 53 * are optimized to render more quickly than other values. 54 * 55 * @langversion 3.0 56 * @playerversion Flash 10 57 * @playerversion AIR 1.5 58 * @productversion Flex 4 59 */ 60 public function get blurX():Number 61 { 62 return _blurX; 63 } 64 65 /** 66 * @private 67 */ 68 public function set blurX(value:Number):void 69 { 70 if (value != _blurX) 71 { 72 _blurX = value; 73 notifyFilterChanged(); 74 } 75 } 76 77 //---------------------------------- 78 // blurY 79 //---------------------------------- 80 81 private var _blurY:Number = 4.0; 82 83 [Inspectable(minValue="0.0", maxValue="255.0")] 84 85 /** 86 * The amount of vertical blur. Valid values are 0 to 255. A blur of 1 87 * or less means that the original image is copied as is. The default 88 * value is 4. Values that are a power of 2 (such as 2, 4, 8, 16, and 32) 89 * are optimized to render more quickly than other values. 90 * 91 * @langversion 3.0 92 * @playerversion Flash 10 93 * @playerversion AIR 1.5 94 * @productversion Flex 4 95 */ 96 public function get blurY():Number 97 { 98 return _blurY; 99 } 100 101 /** 102 * @private 103 */ 104 public function set blurY(value:Number):void 105 { 106 if (value != _blurY) 107 { 108 _blurY = value; 109 notifyFilterChanged(); 110 } 111 } 112 113 //---------------------------------- 114 // knockout 115 //---------------------------------- 116 117 private var _knockout:Boolean = false; 118 119 /** 120 * Specifies whether the object has a knockout effect. A knockout effect 121 * makes the object's fill transparent and reveals the background color 122 * of the document. The value true specifies a knockout effect; the 123 * default value is false (no knockout effect). 124 * 125 * @langversion 3.0 126 * @playerversion Flash 10 127 * @playerversion AIR 1.5 128 * @productversion Flex 4 129 */ 130 public function get knockout():Boolean 131 { 132 return _knockout; 133 } 134 135 /** 136 * @private 137 */ 138 public function set knockout(value:Boolean):void 139 { 140 if (value != _knockout) 141 { 142 _knockout = value; 143 notifyFilterChanged(); 144 } 145 } 146 147 //---------------------------------- 148 // quality 149 //---------------------------------- 150 151 private var _quality:int = BitmapFilterQuality.LOW; 152 153 [Inspectable(minValue="1", maxValue="15")] 154 155 /** 156 * The number of times to apply the filter. The default value is 157 * BitmapFilterQuality.LOW, which is equivalent to applying the filter 158 * once. The value BitmapFilterQuality.MEDIUM applies the filter twice; 159 * the value BitmapFilterQuality.HIGH applies it three times. Filters 160 * with lower values are rendered more quickly. 161 * 162 * For most applications, a quality value of low, medium, or high is 163 * sufficient. Although you can use additional numeric values up to 15 164 * to achieve different effects, higher values are rendered more slowly. 165 * Instead of increasing the value of quality, you can often get a similar 166 * effect, and with faster rendering, by simply increasing the values of 167 * the blurX and blurY properties. 168 * 169 * @langversion 3.0 170 * @playerversion Flash 10 171 * @playerversion AIR 1.5 172 * @productversion Flex 4 173 */ 174 public function get quality():int 175 { 176 return _quality; 177 } 178 179 /** 180 * @private 181 */ 182 public function set quality(value:int):void 183 { 184 if (value != _quality) 185 { 186 _quality = value; 187 notifyFilterChanged(); 188 } 189 } 190 191 //---------------------------------- 192 // strength 193 //---------------------------------- 194 195 private var _strength:Number = 1; 196 197 [Inspectable(minValue="0.0", maxValue="255.0")] 198 199 /** 200 * The strength of the imprint or spread. The higher the value, the more 201 * color is imprinted and the stronger the contrast between the glow and 202 * the background. Valid values are 0 to 255. A value of 0 means that the 203 * filter is not applied. The default value is 1. 204 * 205 * @langversion 3.0 206 * @playerversion Flash 10 207 * @playerversion AIR 1.5 208 * @productversion Flex 4 209 */ 210 public function get strength():Number 211 { 212 return _strength; 213 } 214 215 /** 216 * @private 217 */ 218 public function set strength(value:Number):void 219 { 220 if (value != _strength) 221 { 222 _strength = value; 223 notifyFilterChanged(); 224 } 225 } 226} 227}