<commit_before>////////////////////////////////////////////////////////////////////////////////
//
//  ADOBE SYSTEMS INCORPORATED
//  Copyright 2003-2008 Adobe Systems Incorporated
//  All Rights Reserved.
//
//  NOTICE: Adobe permits you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////

package spark.filters {  

import flash.display.Shader;
import flash.display.ShaderInput;
import flash.display.ShaderParameter;
import flash.display.ShaderParameterType;
import flash.display.ShaderPrecision;
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.events.IEventDispatcher;
import flash.filters.BitmapFilter;
import flash.filters.ShaderFilter;
import flash.utils.Proxy;
import flash.utils.flash_proxy;

import mx.filters.BaseFilter;
import mx.filters.IBitmapFilter;

use namespace flash_proxy;

/**
 * The Flex ShaderFilter class abstracts away many of the details of using
 * the Flash ShaderFilter, Shader, and ShaderData classes to apply a
 * Pixel Bender shader as a filter.
 *
 * <p>The ShaderFilter class must be initialized with either an instance of a Shader 
 * object or Class representative of a Shader (such as from an Embed). The ShaderFilter 
 * class then serves as a proxy to the underlying Shader, providing a convenience 
 * mechanism for accessing both scalar and multi-dimensional shader input parameters 
 * directly as simple named properties.</p>
 *
 * <p>To set a simple scalar shader input parameter, such as of type FLOAT or INT, you can 
 * refer to the property directly, for example, <code>myFilter.radius</code>.</p>
 *
 * <p>To set or animate an individual component of a multidimensional shader input parameter, such as 
 * FLOAT2, you can use a property suffix convention to access the individual value directly.  
 * The following code shows two ways to set the first and second components of the FLOAT2
 * property <code>center</code>:
 * <code><pre>
 *     // 'center' is an input parameter of type FLOAT2.
 *     shader.center = [10,20];
 * </pre></code>
 * <code><pre>
 *     // Use property suffix convention to access the first and second component of 'center'. 
 *     shader.center_x = 10;
 *     shader.center_y = 20;
 * </pre></code></p>
 *
 * <p>The full set of supported property suffixes that you can use are as follows: </p>
 *
 * <ul>
 * <li>For shader input parameters of type BOOL2, BOOL3, BOOL4, FLOAT2, FLOAT3, FLOAT4, INT2, 
 * INT3, or INT4, you can use "r g b a", "x y z w", or "s t p q"  
 * to access the 1st, 2nd, 3rd and 4th component, respectively.</li>
 *
 * <li>For shader input parameters of type MATRIX2x2, MATRIX3x3, or MATRIX4x4, you can use 
 * "a b c d e f g h i j k l m n o p" to access the 
 * 1st - 16th component of a given matrix, respectively.</li>
 * </ul>
 *
 * <p>As properties on the ShaderFilter change (such as during animation), the
 * ShaderFilter automatically reapplies itself to the filters array of the visual
 * component it is applied to.</p>
 * 
 *  @mxml 
 *  <p>The <code>&lt;ShaderFilter&gt;</code> tag inherits all of the tag 
 *  attributes of its superclass and adds the following tag attributes:</p>
 *
 *  <pre>
 *  &lt;ShaderFilter
 *    <strong>Properties</strong>
 *    bottomExtension="0"
 *    leftExtension="0"
 *    precisionHint="full"
 *    rightExtension="0"
 *    shader="[]"
 *    topExtension="0"
 *  /&gt;
 *  </pre>
 *
 * @see spark.effects.AnimateFilter 
 *
 * @example Simple ShaderFilter example:
 * <listing version="3.0"><commit_msg>Transferred from the Adobe Open Source Subversion Repository<commit_after>////////////////////////////////////////////////////////////////////////////////
//
//  ADOBE SYSTEMS INCORPORATED
//  Copyright 2003-2008 Adobe Systems Incorporated
//  All Rights Reserved.
//
//  NOTICE: Adobe permits you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////

package spark.filters {  

import flash.display.Shader;
import flash.display.ShaderInput;
import flash.display.ShaderParameter;
import flash.display.ShaderParameterType;
import flash.display.ShaderPrecision;
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.events.IEventDispatcher;
import flash.filters.BitmapFilter;
import flash.filters.ShaderFilter;
import flash.utils.Proxy;
import flash.utils.flash_proxy;

import mx.filters.BaseFilter;
import mx.filters.IBitmapFilter;

use namespace flash_proxy;

/**
 * The Flex ShaderFilter class abstracts away many of the details of using
 * the Flash ShaderFilter, Shader, and ShaderData classes to apply a
 * Pixel Bender shader as a filter.
 *
 * <p>The ShaderFilter class must be initialized with either an instance of a Shader 
 * object or Class representative of a Shader (such as from an Embed). The ShaderFilter 
 * class then serves as a proxy to the underlying Shader, providing a convenience 
 * mechanism for accessing both scalar and multi-dimensional shader input parameters 
 * directly as simple named properties.</p>
 *
 * <p>To set a simple scalar shader input parameter, such as of type FLOAT or INT, you can 
 * refer to the property directly, for example, <code>myFilter.radius</code>.</p>
 *
 * <p>To set or animate an individual component of a multidimensional shader input parameter, such as 
 * FLOAT2, you can use a property suffix convention to access the individual value directly.  
 * The following code shows two ways to set the first and second components of the FLOAT2
 * property <code>center</code>:
 * <code><pre>
 *     // 'center' is an input parameter of type FLOAT2.
 *     shader.center = [10,20];
 * </pre></code>
 * <code><pre>
 *     // Use property suffix convention to access the first and second component of 'center'. 
 *     shader.center_x = 10;
 *     shader.center_y = 20;
 * </pre></code></p>
 *
 * <p>The full set of supported property suffixes that you can use are as follows: </p>
 *
 * <ul>
 * <li>For shader input parameters of type BOOL2, BOOL3, BOOL4, FLOAT2, FLOAT3, FLOAT4, INT2, 
 * INT3, or INT4, you can use "r g b a", "x y z w", or "s t p q"  
 * to access the 1st, 2nd, 3rd and 4th component, respectively.</li>
 *
 * <li>For shader input parameters of type MATRIX2x2, MATRIX3x3, or MATRIX4x4, you can use 
 * "a b c d e f g h i j k l m n o p" to access the 
 * 1st - 16th component of a given matrix, respectively.</li>
 * </ul>
 *
 * <p>As properties on the ShaderFilter change (such as during animation), the
 * ShaderFilter automatically reapplies itself to the filters array of the visual
 * component it is applied to.</p>
 * 
 *  @mxml 
 *  <p>The <code>&lt;ShaderFilter&gt;</code> tag inherits all of the tag 
 *  attributes of its superclass and adds the following tag attributes:</p>
 *
 *  <pre>
 *  &lt;s:ShaderFilter
 *    <strong>Properties</strong>
 *    bottomExtension="0"
 *    leftExtension="0"
 *    precisionHint="full"
 *    rightExtension="0"
 *    shader="[]"
 *    topExtension="0"
 *  /&gt;
 *  </pre>
 *
 * @see spark.effects.AnimateFilter 
 *
 * @example Simple ShaderFilter example:
 * <listing version="3.0">
{'fraction_non_alphanumeric': 0.13788853895659317, 'fraction_numerical': 0.012871422702998767, 'mean_word_length': 3.094170403587444, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 0, '>': 77, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6437772', 'n_tokens_mistral': 2189, 'n_tokens_neox': 2063, 'n_words': 840}