Permalink
Browse files

updated filters

  • Loading branch information...
1 parent 2048812 commit 6659f05ab7e0ab4b9fd0479baf3d5f386f509e94 @dhai dhai committed May 8, 2012
@@ -10,17 +10,6 @@
<dep id="flash.geom:Matrix3D" />
<dep id="flash.geom:Point" />
</script>
- <script name="D:\Projects\Onyx-VJ\Onyx-VJ-Public\Onyx.Public.Plugins\build\temp\OnyxPublicCPUFilters20123306173313.as" mod="1336339993470" size="800" optimizedsize="288">
- <def id="OnyxPublicCPUFilters20123306173313" />
- <pre id="flash.display:Sprite" />
- <dep id="onyx.filter.cpu:CPUNoiseFilter" />
- <dep id="onyx.filter.cpu:CPUMirrorFilter" />
- <dep id="AS3" />
- <dep id="onyx.filter.cpu:CPUColorFilter" />
- <dep id="onyx.filter.cpu:CPUGammaFilter" />
- <dep id="onyx.filter.cpu:CPUHaloFilter" />
- <dep id="onyx.filter.cpu:CPURepeaterFilter" />
- </script>
<script name="D:\Projects\Onyx-VJ\Onyx-VJ-Public\Onyx.Public.Plugins\src\onyx\filter\cpu\CPUGammaFilter.as" mod="1336338039945" size="1816" optimizedsize="1139">
<def id="onyx.filter.cpu:CPUGammaFilter" />
<pre id="onyx.core:IPluginFilterCPU" />
@@ -56,7 +45,31 @@
<dep id="onyx.core:IChannelCPU" />
<dep id="onyx.plugin:PluginStatus" />
</script>
- <script name="D:\Projects\Onyx-VJ\Onyx-VJ-Public\Onyx.Public.Plugins\src\onyx\filter\cpu\CPUHaloFilter.as" mod="1336338064174" size="2039" optimizedsize="1204">
+ <script name="D:\Projects\Onyx-VJ\Onyx-VJ-Public\Onyx.Public.Plugins\src\onyx\filter\cpu\CPUHalftoneFilter.as" mod="1336499478756" size="5708" optimizedsize="3293">
+ <def id="onyx.filter.cpu:CPUHalftoneFilter" />
+ <pre id="onyx.core:IPluginFilterCPU" />
+ <pre id="onyx.plugin:PluginFilterCPU" />
+ <pre id="Object" />
+ <dep id="flash.display:BitmapDataChannel" />
+ <dep id="onyx.core:IDisplayContextCPU" />
+ <dep id="flash.display:BitmapData" />
+ <dep id="onyx.core:IPluginBlendCPU" />
+ <dep id="flash.geom:Rectangle" />
+ <dep id="onyx.core:Onyx" />
+ <dep id="Math" />
+ <dep id="onyx.display:DisplaySurface" />
+ <dep id="onyx.core:parameter" />
+ <dep id="onyx.display:CONST_IDENTITY" />
+ <dep id="onyx.core:IChannelCPU" />
+ <dep id="flash.geom:Point" />
+ <dep id="onyx.plugin:PluginStatus" />
+ <dep id="flash.filters:BitmapFilterQuality" />
+ <dep id="AS3" />
+ <dep id="flash.geom:Matrix" />
+ <dep id="flash.filters:BlurFilter" />
+ <dep id="flash.geom:ColorTransform" />
+ </script>
+ <script name="D:\Projects\Onyx-VJ\Onyx-VJ-Public\Onyx.Public.Plugins\src\onyx\filter\cpu\CPUHaloFilter.as" mod="1336499284853" size="2131" optimizedsize="1238">
<def id="onyx.filter.cpu:CPUHaloFilter" />
<pre id="onyx.core:IPluginFilterCPU" />
<pre id="onyx.plugin:PluginFilterCPU" />
@@ -90,6 +103,18 @@
<dep id="onyx.parameter:IParameter" />
<dep id="flash.geom:ColorTransform" />
</script>
+ <script name="D:\Projects\Onyx-VJ\Onyx-VJ-Public\Onyx.Public.Plugins\build\temp\OnyxPublicCPUFilters20125108135149.as" mod="1336499509722" size="835" optimizedsize="288">
+ <def id="OnyxPublicCPUFilters20125108135149" />
+ <pre id="flash.display:Sprite" />
+ <dep id="onyx.filter.cpu:CPUHalftoneFilter" />
+ <dep id="onyx.filter.cpu:CPUNoiseFilter" />
+ <dep id="onyx.filter.cpu:CPUMirrorFilter" />
+ <dep id="AS3" />
+ <dep id="onyx.filter.cpu:CPUColorFilter" />
+ <dep id="onyx.filter.cpu:CPUGammaFilter" />
+ <dep id="onyx.filter.cpu:CPUHaloFilter" />
+ <dep id="onyx.filter.cpu:CPURepeaterFilter" />
+ </script>
<script name="D:\Projects\Onyx-VJ\Onyx-VJ-Public\Onyx.Public.Plugins\src\onyx\filter\cpu\CPURepeaterFilter.as" mod="1336338071663" size="1909" optimizedsize="1138">
<def id="onyx.filter.cpu:CPURepeaterFilter" />
<pre id="onyx.core:IPluginFilterCPU" />
@@ -114,12 +139,14 @@
<ext id="onyx.core:IPluginBlendCPU" />
<ext id="flash.filters:BlurFilter" />
<ext id="flash.geom:ColorTransform" />
+ <ext id="flash.filters:BitmapFilterQuality" />
<ext id="flash.geom:Point" />
<ext id="onyx.parameter:IParameter" />
<ext id="onyx.plugin:PluginFilterCPU" />
<ext id="onyx.display:CONST_IDENTITY" />
<ext id="Math" />
<ext id="flash.display:BitmapData" />
+ <ext id="flash.display:BitmapDataChannel" />
<ext id="onyx.core:parameter" />
<ext id="flash.geom:Rectangle" />
<ext id="onyx.core:Onyx" />
@@ -22,8 +22,8 @@
<dep id="onyx.core:IChannelGPU" />
<dep id="onyx.plugin:PluginStatus" />
</script>
- <script name="D:\Projects\Onyx-VJ\Onyx-VJ-Public\Onyx.Public.Plugins\build\temp\OnyxPublicGPUFilters20123306173314.as" mod="1336339994719" size="667" optimizedsize="288">
- <def id="OnyxPublicGPUFilters20123306173314" />
+ <script name="D:\Projects\Onyx-VJ\Onyx-VJ-Public\Onyx.Public.Plugins\build\temp\OnyxPublicGPUFilters20125108135150.as" mod="1336499511015" size="667" optimizedsize="288">
+ <def id="OnyxPublicGPUFilters20125108135150" />
<pre id="flash.display:Sprite" />
<dep id="onyx.filter.gpu:GPUTestFilter" />
<dep id="AS3" />
@@ -21,7 +21,8 @@ package onyx.filter.cpu {
version = '1.0'
)]
- [Parameter(type='int', id='amount', target='amount', reset='20', clamp='1,100')]
+ [Parameter(type='int', id='amount', target='tone/size', reset='20', clamp='10,100')]
+ [Parameter(type='colorTransform', id='blendAmount', target='blendAmount', channels='rgba')]
final public class CPUHalftoneFilter extends PluginFilterCPU implements IPluginFilterCPU {
@@ -37,46 +38,56 @@ package onyx.filter.cpu {
private var matrix_:Matrix;
private var smooth:Smooth;
- private var tone:HalftoneColor;
+
+ parameter const tone:HalftoneColor = new HalftoneColor();
+
private var buffer:DisplaySurface;
+
/**
* @parameter
*/
- private var blend:IPluginBlendCPU = Onyx.CreateInstance('Onyx.Display.Blend.Overlay::CPU') as IPluginBlendCPU;
- /**
- * @public
- */
- public function initialize(owner:IChannelCPU, channel:IDisplayContextCPU):PluginStatus {
- this.context = channel;
- this.owner = owner;
- smooth = new Smooth();
- smooth.strength = 2;
- tone = new HalftoneColor();
- tone.size = amount;
- matrix_ = new Matrix( 1, 0, 0, 1, 0, 0);
- return PluginStatus.OK;
- }
+ private var blend:IPluginBlendCPU = Onyx.CreateInstance('Onyx.Display.Blend.Overlay::CPU') as IPluginBlendCPU;
+
+ // blend amount?
+ parameter var blendAmount:ColorTransform = new ColorTransform();
/**
* @public
- */
- override public function validate():void {
+ */
+ public function initialize(owner:IChannelCPU, context:IDisplayContextCPU):PluginStatus {
+
+ this.context = context;
+ this.owner = owner;
+
+ smooth = new Smooth();
+ smooth.strength = 2;
+
+ tone.size = amount;
+ matrix_ = new Matrix( 1, 0, 0, 1, 0, 0);
+
buffer = new DisplaySurface( context.width, context.height, true, 0x00);
- super.validate();
+ return PluginStatus.OK;
}
/**
* @public
*/
public function render(context:IDisplayContextCPU):Boolean {
- smooth.applyEffect(context.surface);
- tone.size = amount;
- tone.applyEffect(context.surface);
- context.copyPixels(context.surface);
- blend.render(context.target, context.surface, buffer);
- return true;
+ // copy the previous over
+ buffer.copyPixels(context.surface, context.rect, CONST_IDENTITY);
+
+ // apply everything to the buffer
+ smooth.applyEffect(buffer);
+
+ // apply the effect
+ tone.applyEffect(buffer);
+
+ // target, base, blend, amount
+
+ // swap buffer
+ return blend.render(context.target, context.surface, buffer, blendAmount);
}
/**
* @public
@@ -86,12 +97,16 @@ package onyx.filter.cpu {
// dispose
super.dispose();
+ // dispose
+ buffer.dispose();
+
}
}
}
import flash.display.BitmapData;
import flash.display.BitmapDataChannel;
import flash.geom.Rectangle;
+
/**
* @author YOSHIDA, Akio (Aquioux)
*/
@@ -111,6 +126,11 @@ class HalftoneColor
blockPixels_ = _size * _size;
}
+
+ public function get size():uint {
+ return _size;
+ }
+
private var _size:uint = 16;
private var width_:Number;
private var height_:Number;
@@ -45,7 +45,7 @@ package onyx.filter.cpu {
public function initialize(owner:IChannelCPU, context:IDisplayContextCPU):PluginStatus {
if (!blend || blend.initialize(context) !== PluginStatus.OK) {
- return new PluginStatus('Error Initializing HaloFilter');
+ return new PluginStatus('Error Initializing blend');
}
this.owner = owner;
@@ -75,10 +75,19 @@ package onyx.filter.cpu {
*/
public function render(context:IDisplayContextCPU):Boolean {
+ // context.surface is the previous render
buffer.applyFilter(context.surface, context.rect, CONST_IDENTITY, filter);
- blend.render(context.target, context.surface, buffer);
- return true;
+ // render the blend mode
+ // where to render, base, blend
+ return blend.render(context.target, context.surface, buffer);
+ }
+
+ override public function dispose():void {
+
+ super.dispose();
+ buffer.dispose();
+
}
}
}
@@ -96,7 +96,7 @@ package onyx.patch.cpu {
* @private
*/
private function handleConnection(event:NetStatusEvent):void {
- Console.Log(Console.MESSAGE, 'RTMPatch: ' + event.info.code);
+ Console.Log(CONSOLE::MESSAGE, 'RTMPatch: ' + event.info.code);
switch (event.info.code) {
case 'NetConnection.Connect.Success':
@@ -119,7 +119,7 @@ package onyx.patch.cpu {
*/
public function onMetaData(info:Object):void {
- Console.Log(Console.MESSAGE, 'RTMPatch: ' + info.width, info.height);
+ Console.Log(CONSOLE::MESSAGE, 'RTMPatch: ' + info.width, info.height);
invalid = true;
@@ -169,7 +169,7 @@ package onyx.patch.cpu {
try {
context.draw(video, renderMatrix, null, null, null, smoothing);
} catch (e:Error) {
- Console.Log(Console.ERROR, e.message);
+ Console.Log(CONSOLE::ERROR, e.message);
}
}
return true;

0 comments on commit 6659f05

Please sign in to comment.