[Pixelle-commit] SF.net SVN: pixelle: [113] trunk/pixelle
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2008-06-29 00:25:02
|
Revision: 113
http://pixelle.svn.sourceforge.net/pixelle/?rev=113&view=rev
Author: dbrosius
Date: 2008-06-28 17:25:07 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
implement inequalities
Modified Paths:
--------------
trunk/pixelle/etc/Pixelle.g
trunk/pixelle/htdocs/index.html
Modified: trunk/pixelle/etc/Pixelle.g
===================================================================
--- trunk/pixelle/etc/Pixelle.g 2008-06-29 00:03:54 UTC (rev 112)
+++ trunk/pixelle/etc/Pixelle.g 2008-06-29 00:25:07 UTC (rev 113)
@@ -182,12 +182,54 @@
}
)* ;
-rel_expr :
- add_expr ( rel_op add_expr )* ;
+rel_expr
+@init
+ {
+ Label falseLabel = null;
+ Label continueLabel = null;
+ }
+ :
+ add_expr
+ ( r=rel_op add_expr
+ {
+ falseLabel = new Label();
+ continueLabel = new Label();
+ if ($r.text.equals("<=")) {
+ mv.visitInsn(Opcodes.DCMPG);
+ mv.visitJumpInsn(Opcodes.IFGT, falseLabel);
+ mv.visitInsn(Opcodes.DCONST_1);
+ mv.visitJumpInsn(Opcodes.GOTO, continueLabel);
+ mv.visitLabel(falseLabel);
+ mv.visitInsn(Opcodes.DCONST_0);
+ } else if ($r.text.equals(">=")) {
+ mv.visitInsn(Opcodes.DCMPG);
+ mv.visitJumpInsn(Opcodes.IFLT, falseLabel);
+ mv.visitInsn(Opcodes.DCONST_1);
+ mv.visitJumpInsn(Opcodes.GOTO, continueLabel);
+ mv.visitLabel(falseLabel);
+ mv.visitInsn(Opcodes.DCONST_0);
+ } else if ($r.text.equals("<")) {
+ mv.visitInsn(Opcodes.DCMPG);
+ mv.visitJumpInsn(Opcodes.IFGE, falseLabel);
+ mv.visitInsn(Opcodes.DCONST_1);
+ mv.visitJumpInsn(Opcodes.GOTO, continueLabel);
+ mv.visitLabel(falseLabel);
+ mv.visitInsn(Opcodes.DCONST_0);
+ } else {
+ mv.visitInsn(Opcodes.DCMPG);
+ mv.visitJumpInsn(Opcodes.IFLE, falseLabel);
+ mv.visitInsn(Opcodes.DCONST_1);
+ mv.visitJumpInsn(Opcodes.GOTO, continueLabel);
+ mv.visitLabel(falseLabel);
+ mv.visitInsn(Opcodes.DCONST_0);
+ }
+ mv.visitLabel(continueLabel);
+ }
+ )* ;
rel_op :
- ('<' '=')=>
- | ('>' '=')=>
+ ('<=')
+ | ('>=')
| '<'
| '>'
;
Modified: trunk/pixelle/htdocs/index.html
===================================================================
--- trunk/pixelle/htdocs/index.html 2008-06-29 00:03:54 UTC (rev 112)
+++ trunk/pixelle/htdocs/index.html 2008-06-29 00:25:07 UTC (rev 113)
@@ -108,11 +108,16 @@
p[x,y].s = <b>(p[x,y].r == p[x,y].g) || (p[x,y].r == p[x,y].b)</b>
Sets the selection to any pixels where the red component equals either
- the green or blue component
+ the green or blue component.
+ p[x,y].b = <b>(p[x,y].s || (p[x,y].r < p[x,y].g) ? 0 : 255
+
+ Sets the blue pixel to full blue if the pixel is selected or if the red component
+ is less than the green component, or else it sets it to black.
+
</pre></p>
- <p>Still to be done is expressions with inequalities, recognition of more image types,
+ <p>Still to be done is recognition of more image types,
saving output images, more options handling, a bunch of bugs, and a bunch of stuff I have
yet to think about.</p>
</div>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|