pixelle-commit Mailing List for pixelle (Page 10)
Brought to you by:
dbrosius
You can subscribe to this list here.
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(129) |
Jul
(39) |
Aug
|
Sep
|
Oct
|
Nov
(63) |
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(1) |
Feb
(24) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(41) |
Aug
(1) |
Sep
(7) |
Oct
|
Nov
|
Dec
(5) |
| 2010 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
(2) |
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <dbr...@us...> - 2008-06-28 21:38:53
|
Revision: 97
http://pixelle.svn.sourceforge.net/pixelle/?rev=97&view=rev
Author: dbrosius
Date: 2008-06-28 14:39:01 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
move pixelle.properties to resources dir
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2008-06-28 21:37:18 UTC (rev 96)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2008-06-28 21:39:01 UTC (rev 97)
@@ -49,6 +49,7 @@
public static final String FITTOWINDOW_ITEM = "menu.view.fit_to_window";
public static final String TRANSFORM_MENU = "menu.transform.title";
public static final String OPTIONS_ITEM = "menu.transform.options";
+ public static final String TRANSFORM_NEW_ITEM = "menu.transform.newwindow";
public static final String TRANSFORM_ITEM = "menu.transform.transform";
public static final String RED_FORMULA = "formula.red";
public static final String GREEN_FORMULA = "formula.green";
@@ -68,7 +69,7 @@
public static final String WRAPPED_COLOR = "label.wrapped_color";
public static final String PICK_COLOR = "title.pick_color";
- private static ResourceBundle rb = ResourceBundle.getBundle("com/mebigfatguy/pixelle/pixelle");
+ private static ResourceBundle rb = ResourceBundle.getBundle("com/mebigfatguy/pixelle/resources/pixelle");
private PixelleBundle()
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-28 21:37:10
|
Revision: 96
http://pixelle.svn.sourceforge.net/pixelle/?rev=96&view=rev
Author: dbrosius
Date: 2008-06-28 14:37:18 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
move properties file to resource directory
Added Paths:
-----------
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
Removed Paths:
-------------
trunk/pixelle/src/com/mebigfatguy/pixelle/pixelle.properties
Deleted: trunk/pixelle/src/com/mebigfatguy/pixelle/pixelle.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/pixelle.properties 2008-06-28 21:36:40 UTC (rev 95)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/pixelle.properties 2008-06-28 21:37:18 UTC (rev 96)
@@ -1,68 +0,0 @@
-/*
- * pixelle - Graphics algorithmic editor
- * Copyright (C) 2008 Dave Brosius
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-ok = OK
-cancel = CANCEL
-reset = RESET
-
-pixelle.title = Pixelle
-
-menu.file.title = File
-menu.file.new = New
-menu.file.open = Open
-menu.file.close = Close
-menu.file.save = Save
-menu.file.saveas = Save As
-menu.file.pagesetup = Page Setup
-menu.file.print = Print
-menu.file.quit = Quit
-
-menu.view.title = View
-menu.view.one_eighth = 12.5%
-menu.view.one_fourth = 25%
-menu.view.one_half = 50%
-menu.view.full_size = 100%
-menu.view.double = 200%
-menu.view.four_times = 400%
-menu.view.eight_times = 800%
-menu.view.fit_to_window = Fit to Window
-
-menu.transform.title = Transform
-menu.transform.options = Options
-menu.transform.transform = Transform
-
-formula.red = p[x,y].r
-formula.green = p[x,y].g
-formula.blue = p[x,y].b
-formula.transparency = p[x,y].t
-formula.selection = p[x,y].s
-
-title.algorithms = Pixel Algorithms
-label.red = (Red)
-label.green = (Green)
-label.blue = (Blue)
-label.transparency = (Transparency)
-label.selection = (Selection)
-
-title.pixel_options = Pixel Options
-title.out_of_bounds_pixels = For out-of-bounds pixels use:
-label.color = Color
-label.border_color = Closest border color
-label.wrapped_color = Wrapped color
-title.pick_color = Pick a color for out of bounds indices
\ No newline at end of file
Copied: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties (from rev 95, trunk/pixelle/src/com/mebigfatguy/pixelle/pixelle.properties)
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2008-06-28 21:37:18 UTC (rev 96)
@@ -0,0 +1,68 @@
+/*
+ * pixelle - Graphics algorithmic editor
+ * Copyright (C) 2008 Dave Brosius
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+ok = OK
+cancel = CANCEL
+reset = RESET
+
+pixelle.title = Pixelle
+
+menu.file.title = File
+menu.file.new = New
+menu.file.open = Open
+menu.file.close = Close
+menu.file.save = Save
+menu.file.saveas = Save As
+menu.file.pagesetup = Page Setup
+menu.file.print = Print
+menu.file.quit = Quit
+
+menu.view.title = View
+menu.view.one_eighth = 12.5%
+menu.view.one_fourth = 25%
+menu.view.one_half = 50%
+menu.view.full_size = 100%
+menu.view.double = 200%
+menu.view.four_times = 400%
+menu.view.eight_times = 800%
+menu.view.fit_to_window = Fit to Window
+
+menu.transform.title = Transform
+menu.transform.options = Options
+menu.transform.transform = Transform
+
+formula.red = p[x,y].r
+formula.green = p[x,y].g
+formula.blue = p[x,y].b
+formula.transparency = p[x,y].t
+formula.selection = p[x,y].s
+
+title.algorithms = Pixel Algorithms
+label.red = (Red)
+label.green = (Green)
+label.blue = (Blue)
+label.transparency = (Transparency)
+label.selection = (Selection)
+
+title.pixel_options = Pixel Options
+title.out_of_bounds_pixels = For out-of-bounds pixels use:
+label.color = Color
+label.border_color = Closest border color
+label.wrapped_color = Wrapped color
+title.pick_color = Pick a color for out of bounds indices
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-28 21:36:31
|
Revision: 95
http://pixelle.svn.sourceforge.net/pixelle/?rev=95&view=rev
Author: dbrosius
Date: 2008-06-28 14:36:40 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
add checkbox icons
Added Paths:
-----------
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/checkbox_selected.png
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/checkbox_unselected.png
Added: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/checkbox_selected.png
===================================================================
(Binary files differ)
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/checkbox_selected.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/checkbox_unselected.png
===================================================================
(Binary files differ)
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/checkbox_unselected.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-28 01:10:31
|
Revision: 94
http://pixelle.svn.sourceforge.net/pixelle/?rev=94&view=rev
Author: dbrosius
Date: 2008-06-27 18:10:40 -0700 (Fri, 27 Jun 2008)
Log Message:
-----------
when creating a new window, also create a blank image
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-06-28 01:02:09 UTC (rev 93)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-06-28 01:10:40 UTC (rev 94)
@@ -87,6 +87,7 @@
PixelleImage image;
public PixelleFrame() {
+ image = new PixelleImage();
initComponents();
initListeners();
setTitle(rb.getString("pixelle.title"));
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2008-06-28 01:02:09 UTC (rev 93)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2008-06-28 01:10:40 UTC (rev 94)
@@ -37,6 +37,10 @@
private BufferedImage selection;
private Composite composite;
+ public PixelleImage() {
+ this(new BufferedImage(400, 400, BufferedImage.TYPE_3BYTE_BGR));
+ }
+
public PixelleImage(BufferedImage img) {
image = img;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-28 01:02:02
|
Revision: 93
http://pixelle.svn.sourceforge.net/pixelle/?rev=93&view=rev
Author: dbrosius
Date: 2008-06-27 18:02:09 -0700 (Fri, 27 Jun 2008)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleComponent.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleComponent.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleComponent.java 2008-06-28 01:00:29 UTC (rev 92)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleComponent.java 2008-06-28 01:02:09 UTC (rev 93)
@@ -18,12 +18,19 @@
*/
package com.mebigfatguy.pixelle;
-
+/**
+ * an enum that represents a part of a bitmap
+ */
public enum PixelleComponent {
+ /** the red component of a pixel */
RED('r', 0),
+ /** the green component of a pixel */
GREEN('g', 1),
+ /** the blue component of a pixel */
BLUE('b', 2),
+ /** the transparency component of a pixel */
TRANSPARENCY('t', 3),
+ /** the selection status of a pixel */
SELECTION('s', -1);
private char pixelSpec;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-28 01:00:20
|
Revision: 92
http://pixelle.svn.sourceforge.net/pixelle/?rev=92&view=rev
Author: dbrosius
Date: 2008-06-27 18:00:29 -0700 (Fri, 27 Jun 2008)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleExpr.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleExpr.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleExpr.java 2008-06-28 00:58:51 UTC (rev 91)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleExpr.java 2008-06-28 01:00:29 UTC (rev 92)
@@ -18,6 +18,10 @@
*/
package com.mebigfatguy.pixelle;
+/**
+ * an interface that dynamically generated classes must implement to evaluate
+ * pixel component values.
+ */
public interface PixelleExpr {
double eval(PixelleEval e, int x, int y);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-28 00:58:42
|
Revision: 91
http://pixelle.svn.sourceforge.net/pixelle/?rev=91&view=rev
Author: dbrosius
Date: 2008-06-27 17:58:51 -0700 (Fri, 27 Jun 2008)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-06-27 04:25:39 UTC (rev 90)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-06-28 00:58:51 UTC (rev 91)
@@ -34,16 +34,33 @@
import com.mebigfatguy.pixelle.antlr.PixelleParser;
import com.mebigfatguy.pixelle.eval.PixelleEval3ByteABGR;
+/**
+ * transforms one bitmap into another based on the algorithms defined by the user.
+ */
public class PixelleTransformer {
private PixelleImage srcImage;
private Map<PixelleComponent, String> algorithms = null;
+ /**
+ * constructions a transformer given a source bitmap and algorithms
+ * @param image the source image
+ * @param algos the algorithms for the color components
+ */
public PixelleTransformer(PixelleImage image, Map<PixelleComponent, String> algos) {
srcImage = image;
algorithms = algos;
}
+ /**
+ * transforms the image into a destination image based on the algorithms supplied.
+ * It does this by generating classes that implement the PixelleExpr interface, and
+ * dynamically loads them to create the new pixel values.
+ *
+ * @return the destination bitmap
+ * @throws PixelleTransformException if a failure occurs reading, writing or transforming
+ * a bitmap
+ */
public PixelleImage transform() throws PixelleTransformException {
String currentComponent = "";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-27 04:25:44
|
Revision: 90
http://pixelle.svn.sourceforge.net/pixelle/?rev=90&view=rev
Author: dbrosius
Date: 2008-06-26 21:25:39 -0700 (Thu, 26 Jun 2008)
Log Message:
-----------
fix up
Modified Paths:
--------------
trunk/pixelle/htdocs/index.html
Modified: trunk/pixelle/htdocs/index.html
===================================================================
--- trunk/pixelle/htdocs/index.html 2008-06-27 04:23:14 UTC (rev 89)
+++ trunk/pixelle/htdocs/index.html 2008-06-27 04:25:39 UTC (rev 90)
@@ -86,8 +86,6 @@
</pre></p>
- Ano
-
<p>Still to be done is expressions with inequalities, 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>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-27 04:23:05
|
Revision: 89
http://pixelle.svn.sourceforge.net/pixelle/?rev=89&view=rev
Author: dbrosius
Date: 2008-06-26 21:23:14 -0700 (Thu, 26 Jun 2008)
Log Message:
-----------
more docs
Modified Paths:
--------------
trunk/pixelle/htdocs/index.html
Added Paths:
-----------
trunk/pixelle/htdocs/algodlg.png
Added: trunk/pixelle/htdocs/algodlg.png
===================================================================
(Binary files differ)
Property changes on: trunk/pixelle/htdocs/algodlg.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/pixelle/htdocs/index.html
===================================================================
--- trunk/pixelle/htdocs/index.html 2008-06-27 04:07:38 UTC (rev 88)
+++ trunk/pixelle/htdocs/index.html 2008-06-27 04:23:14 UTC (rev 89)
@@ -27,9 +27,36 @@
tedious to edit a bitmap if you have specific ways you want to change it. This tools works
differently. It allows you to apply arbitrary expressions to the red, green, blue, transparent
and selection pieces of a bitmap. Each expression can take as input the value of any other
- value.
+ value.</p>
+
+ <p>At the heart of this program is the transform dialog, shown here:</p>
+ <img src="algodlg.png"/>
+ <p>It shows five input fields for specifying how to transform
+ the red, green, blue and transparent parts of the bitmap, as well as the selection
+ attribute of each pixel. The default values for these algorithms is the value that will
+ produce an exact copy of the source image. In this way you can just change one field, or
+ all fields, and get what you expect. Each algorithm may include the following items.</p>
+ <ul>
+ <li>p[x,y].r, p[x,y].g, p[x,y].b, p[x,y].t, p[x,y].s<br/>
+ The pixel value for the red, green, blue, transparency and selection at a
+ particular location.</li>
+ <li>x<br/>
+ The current x coordinate of the pixel location from left to right.</li>
+ <li>y<br/>
+ The current y coordinate of the pixel location from top to bottom.</li>
+ <li>width<br/>
+ The width in pixels of the image.</li>
+ <li>height<br/>
+ The height in pixels of the image.</li>
+ <li>abs(e)<br/>
+ The absolute value of an expression.
+ <li>min(e, f)<br/>
+ The minimum value of two expressions.
+ <li>min(e, f)<br/>
+ The maximum value of two expressions.
+ </ul>
- <p><pre>As of June 25, simple expressions should work. Some examples:
+ <p><pre>As of June 27, simple expressions should work. Some examples:
p[x,y].r = <b>(x + y) == 100 ? 255 : p[x,y].r</b>
@@ -61,8 +88,9 @@
Ano
- <p>Still to be done is expressions with inequalities, expressions with && and || clauses,
- and a bunch of other fixes.</p>
+ <p>Still to be done is expressions with inequalities, 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>
</body>
</html>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-27 04:07:37
|
Revision: 88
http://pixelle.svn.sourceforge.net/pixelle/?rev=88&view=rev
Author: dbrosius
Date: 2008-06-26 21:07:38 -0700 (Thu, 26 Jun 2008)
Log Message:
-----------
add more examples
Modified Paths:
--------------
trunk/pixelle/htdocs/index.html
Modified: trunk/pixelle/htdocs/index.html
===================================================================
--- trunk/pixelle/htdocs/index.html 2008-06-27 04:01:09 UTC (rev 87)
+++ trunk/pixelle/htdocs/index.html 2008-06-27 04:07:38 UTC (rev 88)
@@ -29,22 +29,38 @@
and selection pieces of a bitmap. Each expression can take as input the value of any other
value.
- <p><pre>As of June 25, simple expressions should work.
+ <p><pre>As of June 25, simple expressions should work. Some examples:
- An example would be p[x,y].r = <b>(x + y) == 100 ? 255 : p[x,y].r</b>
+ p[x,y].r = <b>(x + y) == 100 ? 255 : p[x,y].r</b>
This sets all red pixels to the same value as the input, except those pixels
that form a diagonal line where x + y == 100, and those pixes are converted to white.
- Another example would be p[x,y].r = <b>p[x,y].g</b>
+ p[x,y].r = <b>p[x,y].g</b>
This sets all the red pixels to the value of all the green pixels.
- One final example would be p[x,y].b = <b>p[y,x].b</b>
+ p[x,y].b = <b>p[y,x].b</b>
This rotates the blue component 90 degrees.
+
+ p[x,y].g = <b>(p[x,y].g*3 + p[x+1,y].g + p[x,y+1].g)/5</b>
+
+ This performs a simple convolution operation on the green pixels.
+
+ p[x,y].t = <b>((x == y) || (x == (width - y))) ? 0 : p[x,y].t</b>
+
+ Sets the transparency to fully transparent in an x shape.
+
+ 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
+
</pre></p>
+ Ano
+
<p>Still to be done is expressions with inequalities, expressions with && and || clauses,
and a bunch of other fixes.</p>
</div>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-27 04:01:12
|
Revision: 87
http://pixelle.svn.sourceforge.net/pixelle/?rev=87&view=rev
Author: dbrosius
Date: 2008-06-26 21:01:09 -0700 (Thu, 26 Jun 2008)
Log Message:
-----------
implement || clauses
Modified Paths:
--------------
trunk/pixelle/etc/Pixelle.g
Modified: trunk/pixelle/etc/Pixelle.g
===================================================================
--- trunk/pixelle/etc/Pixelle.g 2008-06-26 15:51:44 UTC (rev 86)
+++ trunk/pixelle/etc/Pixelle.g 2008-06-27 04:01:09 UTC (rev 87)
@@ -122,8 +122,36 @@
}
)* ;
-cond_or_expr :
- eq_expr ( '||' eq_expr )* ;
+cond_or_expr
+ @init
+ {
+ Label true1Label = null;
+ Label true2Label = null;
+ Label continueLabel = null;
+ }
+ :
+ eq_expr
+ ( '||' eq_expr
+ {
+ true1Label = new Label();
+ true2Label = new Label();
+ continueLabel = new Label();
+
+ mv.visitInsn(Opcodes.DCONST_0);
+ mv.visitInsn(Opcodes.DCMPG);
+ mv.visitJumpInsn(Opcodes.IFNE, true1Label);
+ mv.visitInsn(Opcodes.DCONST_0);
+ mv.visitInsn(Opcodes.DCMPG);
+ mv.visitJumpInsn(Opcodes.IFNE, true2Label);
+ mv.visitInsn(Opcodes.DCONST_0);
+ mv.visitJumpInsn(Opcodes.GOTO, continueLabel);
+ mv.visitLabel(true1Label);
+ mv.visitInsn(Opcodes.POP2);
+ mv.visitLabel(true2Label);
+ mv.visitInsn(Opcodes.DCONST_1);
+ mv.visitLabel(continueLabel);
+ }
+ )* ;
eq_expr
@init
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-26 15:51:35
|
Revision: 86
http://pixelle.svn.sourceforge.net/pixelle/?rev=86&view=rev
Author: dbrosius
Date: 2008-06-26 08:51:44 -0700 (Thu, 26 Jun 2008)
Log Message:
-----------
pop s/b pop2 for doubles
Modified Paths:
--------------
trunk/pixelle/etc/Pixelle.g
Modified: trunk/pixelle/etc/Pixelle.g
===================================================================
--- trunk/pixelle/etc/Pixelle.g 2008-06-26 03:59:04 UTC (rev 85)
+++ trunk/pixelle/etc/Pixelle.g 2008-06-26 15:51:44 UTC (rev 86)
@@ -115,7 +115,7 @@
mv.visitInsn(Opcodes.DCONST_1);
mv.visitJumpInsn(Opcodes.GOTO, continueLabel);
mv.visitLabel(false1Label);
- mv.visitInsn(Opcodes.POP);
+ mv.visitInsn(Opcodes.POP2);
mv.visitLabel(false2Label);
mv.visitInsn(Opcodes.DCONST_0);
mv.visitLabel(continueLabel);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-26 03:59:03
|
Revision: 85
http://pixelle.svn.sourceforge.net/pixelle/?rev=85&view=rev
Author: dbrosius
Date: 2008-06-25 20:59:04 -0700 (Wed, 25 Jun 2008)
Log Message:
-----------
fix 'dump' to work in unix
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-06-26 03:24:15 UTC (rev 84)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-06-26 03:59:04 UTC (rev 85)
@@ -19,6 +19,7 @@
package com.mebigfatguy.pixelle;
import java.awt.image.BufferedImage;
+import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.security.AccessController;
@@ -106,7 +107,8 @@
FileOutputStream fos = null;
try
{
- fos = new FileOutputStream("c:\\temp\\" + name);
+ File clsFile = new File(System.getProperty("java.io.tmpdir"), name);
+ fos = new FileOutputStream(clsFile);
fos.write(byteCode);
fos.flush();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-26 03:24:06
|
Revision: 84
http://pixelle.svn.sourceforge.net/pixelle/?rev=84&view=rev
Author: dbrosius
Date: 2008-06-25 20:24:15 -0700 (Wed, 25 Jun 2008)
Log Message:
-----------
on short circuit make sure to pop the extra conditional
Modified Paths:
--------------
trunk/pixelle/etc/Pixelle.g
Modified: trunk/pixelle/etc/Pixelle.g
===================================================================
--- trunk/pixelle/etc/Pixelle.g 2008-06-26 03:17:16 UTC (rev 83)
+++ trunk/pixelle/etc/Pixelle.g 2008-06-26 03:24:15 UTC (rev 84)
@@ -94,25 +94,29 @@
cond_and_expr
@init
{
- Label falseLabel = null;
+ Label false1Label = null;
+ Label false2Label = null;
Label continueLabel = null;
}
:
cond_or_expr
( '&&' cond_or_expr
{
- falseLabel = new Label();
+ false1Label = new Label();
+ false2Label = new Label();
continueLabel = new Label();
mv.visitInsn(Opcodes.DCONST_0);
mv.visitInsn(Opcodes.DCMPG);
- mv.visitJumpInsn(Opcodes.IFEQ, falseLabel);
+ mv.visitJumpInsn(Opcodes.IFEQ, false1Label);
mv.visitInsn(Opcodes.DCONST_0);
mv.visitInsn(Opcodes.DCMPG);
- mv.visitJumpInsn(Opcodes.IFEQ, falseLabel);
+ mv.visitJumpInsn(Opcodes.IFEQ, false2Label);
mv.visitInsn(Opcodes.DCONST_1);
mv.visitJumpInsn(Opcodes.GOTO, continueLabel);
- mv.visitLabel(falseLabel);
+ mv.visitLabel(false1Label);
+ mv.visitInsn(Opcodes.POP);
+ mv.visitLabel(false2Label);
mv.visitInsn(Opcodes.DCONST_0);
mv.visitLabel(continueLabel);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-26 03:17:08
|
Revision: 83
http://pixelle.svn.sourceforge.net/pixelle/?rev=83&view=rev
Author: dbrosius
Date: 2008-06-25 20:17:16 -0700 (Wed, 25 Jun 2008)
Log Message:
-----------
try putting in && expresssion -- problems
Modified Paths:
--------------
trunk/pixelle/etc/Pixelle.g
Modified: trunk/pixelle/etc/Pixelle.g
===================================================================
--- trunk/pixelle/etc/Pixelle.g 2008-06-26 02:31:33 UTC (rev 82)
+++ trunk/pixelle/etc/Pixelle.g 2008-06-26 03:17:16 UTC (rev 83)
@@ -71,7 +71,7 @@
Label continueLabel = null;
}
:
- cond_or_expr
+ cond_and_expr
( '?'
{
mv.visitInsn(Opcodes.DCONST_1); //TRUE
@@ -91,10 +91,34 @@
}
)? ;
+cond_and_expr
+ @init
+ {
+ Label falseLabel = null;
+ Label continueLabel = null;
+ }
+ :
+ cond_or_expr
+ ( '&&' cond_or_expr
+ {
+ falseLabel = new Label();
+ continueLabel = new Label();
+
+ mv.visitInsn(Opcodes.DCONST_0);
+ mv.visitInsn(Opcodes.DCMPG);
+ mv.visitJumpInsn(Opcodes.IFEQ, falseLabel);
+ mv.visitInsn(Opcodes.DCONST_0);
+ mv.visitInsn(Opcodes.DCMPG);
+ mv.visitJumpInsn(Opcodes.IFEQ, falseLabel);
+ mv.visitInsn(Opcodes.DCONST_1);
+ mv.visitJumpInsn(Opcodes.GOTO, continueLabel);
+ mv.visitLabel(falseLabel);
+ mv.visitInsn(Opcodes.DCONST_0);
+ mv.visitLabel(continueLabel);
+ }
+ )* ;
+
cond_or_expr :
- cond_and_expr ( '&&' cond_and_expr )* ;
-
-cond_and_expr :
eq_expr ( '||' eq_expr )* ;
eq_expr
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-26 02:31:24
|
Revision: 82
http://pixelle.svn.sourceforge.net/pixelle/?rev=82&view=rev
Author: dbrosius
Date: 2008-06-25 19:31:33 -0700 (Wed, 25 Jun 2008)
Log Message:
-----------
508 compliance
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java 2008-06-26 02:30:12 UTC (rev 81)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java 2008-06-26 02:31:33 UTC (rev 82)
@@ -114,6 +114,7 @@
p.add(lhs[i], BorderLayout.WEST);
p.add(editor[i], BorderLayout.CENTER);
p.add(labels[i], BorderLayout.EAST);
+ labels[i].setLabelFor(editor[i]);
p.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
cp.add(p);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-26 02:30:14
|
Revision: 81
http://pixelle.svn.sourceforge.net/pixelle/?rev=81&view=rev
Author: dbrosius
Date: 2008-06-25 19:30:12 -0700 (Wed, 25 Jun 2008)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2008-06-26 02:28:34 UTC (rev 80)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2008-06-26 02:30:12 UTC (rev 81)
@@ -27,6 +27,10 @@
import java.awt.image.DataBuffer;
import java.awt.image.IndexColorModel;
+/**
+ * a representation of an image to manipulate. Encapsulates two BufferedImages, one
+ * to represent the real image, and the second to represent selection.
+ */
public class PixelleImage {
private BufferedImage image;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-26 02:28:26
|
Revision: 80
http://pixelle.svn.sourceforge.net/pixelle/?rev=80&view=rev
Author: dbrosius
Date: 2008-06-25 19:28:34 -0700 (Wed, 25 Jun 2008)
Log Message:
-----------
add reset button
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java
trunk/pixelle/src/com/mebigfatguy/pixelle/pixelle.properties
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2008-06-25 05:11:27 UTC (rev 79)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2008-06-26 02:28:34 UTC (rev 80)
@@ -27,6 +27,7 @@
public static final String OK = "ok";
public static final String CANCEL = "cancel";
+ public static final String RESET = "reset";
public static final String TITLE = "pixelle.title";
public static final String FILE_MENU = "menu.file.title";
public static final String NEW_ITEM = "menu.file.new";
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java 2008-06-25 05:11:27 UTC (rev 79)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleExpressionDialog.java 2008-06-26 02:28:34 UTC (rev 80)
@@ -59,11 +59,11 @@
private final JTextField editor[] =
{
- new JTextField(PixelleBundle.getString(PixelleBundle.RED_FORMULA), 80),
- new JTextField(PixelleBundle.getString(PixelleBundle.GREEN_FORMULA), 80),
- new JTextField(PixelleBundle.getString(PixelleBundle.BLUE_FORMULA), 80),
- new JTextField(PixelleBundle.getString(PixelleBundle.TRANSPARENCY_FORMULA), 80),
- new JTextField(PixelleBundle.getString(PixelleBundle.SELECTION_FORMULA), 80)
+ new JTextField(PixelleBundle.getString(PixelleBundle.RED_FORMULA), 50),
+ new JTextField(PixelleBundle.getString(PixelleBundle.GREEN_FORMULA), 50),
+ new JTextField(PixelleBundle.getString(PixelleBundle.BLUE_FORMULA), 50),
+ new JTextField(PixelleBundle.getString(PixelleBundle.TRANSPARENCY_FORMULA), 50),
+ new JTextField(PixelleBundle.getString(PixelleBundle.SELECTION_FORMULA), 50)
};
private final JLabel labels[] =
@@ -77,6 +77,7 @@
JButton ok;
JButton cancel;
+ JButton reset;
boolean clickedOK = false;
public PixelleExpressionDialog(PixelleFrame owner) {
@@ -119,15 +120,18 @@
ok = new JButton(PixelleBundle.getString(PixelleBundle.OK));
cancel = new JButton(PixelleBundle.getString(PixelleBundle.CANCEL));
- GuiUtils.sizeUniformly(GuiUtils.Sizing.Both, new JComponent[] {ok, cancel});
+ reset = new JButton(PixelleBundle.getString(PixelleBundle.RESET));
+ GuiUtils.sizeUniformly(GuiUtils.Sizing.Both, new JComponent[] {ok, cancel, reset});
JPanel p = new JPanel();
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
+ p.add(Box.createHorizontalStrut(10));
+ p.add(reset);
p.add(Box.createHorizontalGlue());
p.add(ok);
p.add(Box.createHorizontalStrut(10));
p.add(cancel);
- p.add(Box.createHorizontalGlue());
+ p.add(Box.createHorizontalStrut(10));
p.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
cp.add(p);
pack();
@@ -147,6 +151,15 @@
}
});
+ reset.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent ae) {
+ editor[0].setText(PixelleBundle.getString(PixelleBundle.RED_FORMULA));
+ editor[1].setText(PixelleBundle.getString(PixelleBundle.GREEN_FORMULA));
+ editor[2].setText(PixelleBundle.getString(PixelleBundle.BLUE_FORMULA));
+ editor[3].setText(PixelleBundle.getString(PixelleBundle.TRANSPARENCY_FORMULA));
+ editor[4].setText(PixelleBundle.getString(PixelleBundle.SELECTION_FORMULA));
+ }
+ });
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
}
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/pixelle.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/pixelle.properties 2008-06-25 05:11:27 UTC (rev 79)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/pixelle.properties 2008-06-26 02:28:34 UTC (rev 80)
@@ -19,6 +19,7 @@
ok = OK
cancel = CANCEL
+reset = RESET
pixelle.title = Pixelle
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-25 05:11:18
|
Revision: 79
http://pixelle.svn.sourceforge.net/pixelle/?rev=79&view=rev
Author: dbrosius
Date: 2008-06-24 22:11:27 -0700 (Tue, 24 Jun 2008)
Log Message:
-----------
fix doc
Modified Paths:
--------------
trunk/pixelle/htdocs/index.html
Modified: trunk/pixelle/htdocs/index.html
===================================================================
--- trunk/pixelle/htdocs/index.html 2008-06-25 05:09:58 UTC (rev 78)
+++ trunk/pixelle/htdocs/index.html 2008-06-25 05:11:27 UTC (rev 79)
@@ -34,7 +34,7 @@
An example would be p[x,y].r = <b>(x + y) == 100 ? 255 : p[x,y].r</b>
This sets all red pixels to the same value as the input, except those pixels
- that form a diagonal line where x + y == 100, and those pixes are converted to black.
+ that form a diagonal line where x + y == 100, and those pixes are converted to white.
Another example would be p[x,y].r = <b>p[x,y].g</b>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-25 05:09:49
|
Revision: 78
http://pixelle.svn.sourceforge.net/pixelle/?rev=78&view=rev
Author: dbrosius
Date: 2008-06-24 22:09:58 -0700 (Tue, 24 Jun 2008)
Log Message:
-----------
more simple doc
Modified Paths:
--------------
trunk/pixelle/htdocs/index.html
Modified: trunk/pixelle/htdocs/index.html
===================================================================
--- trunk/pixelle/htdocs/index.html 2008-06-25 04:50:42 UTC (rev 77)
+++ trunk/pixelle/htdocs/index.html 2008-06-25 05:09:58 UTC (rev 78)
@@ -19,6 +19,34 @@
<p>Thanks for your interest in Pixelle.</p>
<p>This project has just been started, check back soon for more information.</p>
+
+ <p>The web start link should work, give it a try.</p>
+
+ <p>There are many image editing projects out there, and many are very good. But most of
+ these follow the point and click transformation style, and in some instances it can be
+ tedious to edit a bitmap if you have specific ways you want to change it. This tools works
+ differently. It allows you to apply arbitrary expressions to the red, green, blue, transparent
+ and selection pieces of a bitmap. Each expression can take as input the value of any other
+ value.
+
+ <p><pre>As of June 25, simple expressions should work.
+
+ An example would be p[x,y].r = <b>(x + y) == 100 ? 255 : p[x,y].r</b>
+
+ This sets all red pixels to the same value as the input, except those pixels
+ that form a diagonal line where x + y == 100, and those pixes are converted to black.
+
+ Another example would be p[x,y].r = <b>p[x,y].g</b>
+
+ This sets all the red pixels to the value of all the green pixels.
+
+ One final example would be p[x,y].b = <b>p[y,x].b</b>
+
+ This rotates the blue component 90 degrees.
+ </pre></p>
+
+ <p>Still to be done is expressions with inequalities, expressions with && and || clauses,
+ and a bunch of other fixes.</p>
</div>
</body>
</html>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-25 04:50:33
|
Revision: 77
http://pixelle.svn.sourceforge.net/pixelle/?rev=77&view=rev
Author: dbrosius
Date: 2008-06-24 21:50:42 -0700 (Tue, 24 Jun 2008)
Log Message:
-----------
fix javadoc
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/OutOfBoundsOption.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/OutOfBoundsOption.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/OutOfBoundsOption.java 2008-06-25 04:49:04 UTC (rev 76)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/OutOfBoundsOption.java 2008-06-25 04:50:42 UTC (rev 77)
@@ -46,7 +46,7 @@
/**
* sets the color that is used for when the enum is 'SpecifiedColor'
*
- * @param the specified color
+ * @param clr the specified color
*/
public void setColor(Color clr) {
color = clr;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-25 04:48:56
|
Revision: 76
http://pixelle.svn.sourceforge.net/pixelle/?rev=76&view=rev
Author: dbrosius
Date: 2008-06-24 21:49:04 -0700 (Tue, 24 Jun 2008)
Log Message:
-----------
add equalities (==, !=)
Modified Paths:
--------------
trunk/pixelle/etc/Pixelle.g
Modified: trunk/pixelle/etc/Pixelle.g
===================================================================
--- trunk/pixelle/etc/Pixelle.g 2008-06-25 04:09:03 UTC (rev 75)
+++ trunk/pixelle/etc/Pixelle.g 2008-06-25 04:49:04 UTC (rev 76)
@@ -57,7 +57,8 @@
expr
{
mv.visitInsn(Opcodes.DRETURN);
- mv.visitMaxs(0,0);cw.visitEnd();
+ mv.visitMaxs(0,0);
+ cw.visitEnd();
} ;
expr :
@@ -73,9 +74,9 @@
cond_or_expr
( '?'
{
+ mv.visitInsn(Opcodes.DCONST_1); //TRUE
+ mv.visitInsn(Opcodes.DCMPG);
falseLabel = new Label();
- mv.visitLdcInsn(Double.valueOf(0));
- mv.visitInsn(Opcodes.DCMPG);
mv.visitJumpInsn(Opcodes.IFNE, falseLabel);
}
expr ':'
@@ -96,8 +97,34 @@
cond_and_expr :
eq_expr ( '||' eq_expr )* ;
-eq_expr :
- rel_expr ( op=('==' | '!=') rel_expr {} )* ;
+eq_expr
+@init
+ {
+ Label cmpSucceedLabel = null;
+ Label continueLabel = null;
+ }
+ :
+ rel_expr
+ ( op=('==' | '!=') rel_expr
+ {
+ mv.visitInsn(Opcodes.DCMPG);
+ cmpSucceedLabel = new Label();
+ if ("==".equals($op.text))
+ {
+ mv.visitJumpInsn(Opcodes.IFEQ, cmpSucceedLabel);
+ }
+ else
+ {
+ mv.visitJumpInsn(Opcodes.IFNE, cmpSucceedLabel);
+ }
+ mv.visitInsn(Opcodes.DCONST_0); //FALSE
+ continueLabel = new Label();
+ mv.visitJumpInsn(Opcodes.GOTO, continueLabel);
+ mv.visitLabel(cmpSucceedLabel);
+ mv.visitInsn(Opcodes.DCONST_1); //TRUE
+ mv.visitLabel(continueLabel);
+ }
+ )* ;
rel_expr :
add_expr ( rel_op add_expr )* ;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-25 04:08:59
|
Revision: 75
http://pixelle.svn.sourceforge.net/pixelle/?rev=75&view=rev
Author: dbrosius
Date: 2008-06-24 21:09:03 -0700 (Tue, 24 Jun 2008)
Log Message:
-----------
add trinaries -- w/o (in)equalities at present
Modified Paths:
--------------
trunk/pixelle/etc/Pixelle.g
Modified: trunk/pixelle/etc/Pixelle.g
===================================================================
--- trunk/pixelle/etc/Pixelle.g 2008-06-25 03:12:54 UTC (rev 74)
+++ trunk/pixelle/etc/Pixelle.g 2008-06-25 04:09:03 UTC (rev 75)
@@ -21,6 +21,7 @@
@header {
package com.mebigfatguy.pixelle.antlr;
import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.Label;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
}
@@ -62,8 +63,32 @@
expr :
cond_expr ;
-cond_expr :
- cond_or_expr ( '?' expr ':' expr )? ;
+cond_expr
+ @init
+ {
+ Label falseLabel = null;
+ Label continueLabel = null;
+ }
+ :
+ cond_or_expr
+ ( '?'
+ {
+ falseLabel = new Label();
+ mv.visitLdcInsn(Double.valueOf(0));
+ mv.visitInsn(Opcodes.DCMPG);
+ mv.visitJumpInsn(Opcodes.IFNE, falseLabel);
+ }
+ expr ':'
+ {
+ continueLabel = new Label();
+ mv.visitJumpInsn(Opcodes.GOTO, continueLabel);
+ mv.visitLabel(falseLabel);
+ }
+ expr
+ {
+ mv.visitLabel(continueLabel);
+ }
+ )? ;
cond_or_expr :
cond_and_expr ( '&&' cond_and_expr )* ;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-25 03:12:44
|
Revision: 74
http://pixelle.svn.sourceforge.net/pixelle/?rev=74&view=rev
Author: dbrosius
Date: 2008-06-24 20:12:54 -0700 (Tue, 24 Jun 2008)
Log Message:
-----------
better? formatting
Modified Paths:
--------------
trunk/pixelle/etc/Pixelle.g
Modified: trunk/pixelle/etc/Pixelle.g
===================================================================
--- trunk/pixelle/etc/Pixelle.g 2008-06-25 03:08:13 UTC (rev 73)
+++ trunk/pixelle/etc/Pixelle.g 2008-06-25 03:12:54 UTC (rev 74)
@@ -53,7 +53,11 @@
}
pixelle :
- expr {mv.visitInsn(Opcodes.DRETURN);mv.visitMaxs(0,0);cw.visitEnd();} ;
+ expr
+ {
+ mv.visitInsn(Opcodes.DRETURN);
+ mv.visitMaxs(0,0);cw.visitEnd();
+ } ;
expr :
cond_expr ;
@@ -81,23 +85,79 @@
;
add_expr :
- mul_expr (op=('+' | '-') mul_expr {mv.visitInsn("+".equals($op.text)?Opcodes.DADD:Opcodes.DSUB);})* ;
+ mul_expr
+ (op=('+' | '-') mul_expr
+ {
+ mv.visitInsn("+".equals($op.text)?Opcodes.DADD:Opcodes.DSUB);
+ }
+ )* ;
mul_expr :
- factor (op=('*' | '/') factor {mv.visitInsn("*".equals($op.text)?Opcodes.DMUL:Opcodes.DDIV);})* ;
+ factor
+ (op=('*' | '/') factor
+ {
+ mv.visitInsn("*".equals($op.text)?Opcodes.DMUL:Opcodes.DDIV);
+ }
+ )* ;
factor
: NUMBER
- {mv.visitLdcInsn(Double.valueOf($NUMBER.text));}
+ {
+ mv.visitLdcInsn(Double.valueOf($NUMBER.text));
+ }
| '(' expr ')'
- | 'p' {mv.visitVarInsn(Opcodes.ALOAD, 1);} '[' expr { mv.visitInsn(Opcodes.D2I); } ',' expr { mv.visitInsn(Opcodes.D2I); } ']' '.' spec=('r'|'g'|'b'|'t'|'s') {String s = $spec.text; mv.visitLdcInsn(Character.valueOf(s.charAt(0))); mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "com/mebigfatguy/pixelle/PixelleEval", "getValue", "(IIC)D" );}
- | 'x' {mv.visitVarInsn(Opcodes.ILOAD, 2); mv.visitInsn(Opcodes.I2D);}
- | 'y' {mv.visitVarInsn(Opcodes.ILOAD, 3); mv.visitInsn(Opcodes.I2D);}
- | 'width' {mv.visitVarInsn(Opcodes.ALOAD, 1); mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "com/mebigfatguy/pixelle/PixelleEval", "getWidth", "()I" ); mv.visitInsn(Opcodes.I2D);}
- | 'height' {mv.visitVarInsn(Opcodes.ALOAD, 1); mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "com/mebigfatguy/pixelle/PixelleEval", "getHeight", "()I" ); mv.visitInsn(Opcodes.I2D);}
- | 'abs' '(' expr ')' {mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "abs", "(D)D");}
- | 'max' '(' expr ',' expr ')' {mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "max", "(DD)D");}
- | 'min' '(' expr ',' expr ')' {mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "min", "(DD)D");} ;
+ | 'p'
+ {
+ mv.visitVarInsn(Opcodes.ALOAD, 1);
+ }
+ '[' expr
+ {
+ mv.visitInsn(Opcodes.D2I);
+ }
+ ',' expr
+ {
+ mv.visitInsn(Opcodes.D2I);
+ }
+ ']' '.' spec=('r'|'g'|'b'|'t'|'s')
+ {
+ String s = $spec.text;
+ mv.visitLdcInsn(Character.valueOf(s.charAt(0)));
+ mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "com/mebigfatguy/pixelle/PixelleEval", "getValue", "(IIC)D" );
+ }
+ | 'x'
+ {
+ mv.visitVarInsn(Opcodes.ILOAD, 2);
+ mv.visitInsn(Opcodes.I2D);
+ }
+ | 'y'
+ {
+ mv.visitVarInsn(Opcodes.ILOAD, 3);
+ mv.visitInsn(Opcodes.I2D);
+ }
+ | 'width'
+ {
+ mv.visitVarInsn(Opcodes.ALOAD, 1);
+ mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "com/mebigfatguy/pixelle/PixelleEval", "getWidth", "()I" );
+ mv.visitInsn(Opcodes.I2D);
+ }
+ | 'height'
+ {
+ mv.visitVarInsn(Opcodes.ALOAD, 1);
+ mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "com/mebigfatguy/pixelle/PixelleEval", "getHeight", "()I" );
+ mv.visitInsn(Opcodes.I2D);
+ }
+ | 'abs' '(' expr ')'
+ {
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "abs", "(D)D");
+ }
+ | 'max' '(' expr ',' expr ')'
+ {
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "max", "(DD)D");
+ }
+ | 'min' '(' expr ',' expr ')'
+ {
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "min", "(DD)D");
+ } ;
NUMBER : '0'..'9'+ ( '.' ('0'..'9'+))?;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-25 03:08:04
|
Revision: 73
http://pixelle.svn.sourceforge.net/pixelle/?rev=73&view=rev
Author: dbrosius
Date: 2008-06-24 20:08:13 -0700 (Tue, 24 Jun 2008)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java 2008-06-25 02:51:52 UTC (rev 72)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java 2008-06-25 03:08:13 UTC (rev 73)
@@ -21,6 +21,10 @@
import java.awt.Color;
import java.awt.image.DataBuffer;
+/**
+ * an abstract class for evaluation pixels in arbitrary images by enforcing a
+ * template pattern that derived classes implement per image format.
+ */
public abstract class PixelleEval {
protected PixelleImage srcImage;
@@ -30,6 +34,12 @@
protected OutOfBoundsOption oobOption;
private int selectionByte;
+ /**
+ * create an evaluator for a specific image and options
+ *
+ * @param image the image to evaluate
+ * @param option the out of bounds pixels option to use
+ */
public PixelleEval(PixelleImage image, OutOfBoundsOption option) {
srcImage = image;
buffer = image.getBuffer();
@@ -38,11 +48,49 @@
oobOption = option;
}
+ /**
+ * template method to get the red value at a specific x and y
+ *
+ * @param x the x coordinate
+ * @param y the y coordinate
+ * @return the pixel red value at the given coordinate
+ */
public abstract double getRedValue(int x, int y);
+
+ /**
+ * template method to get the green value at a specific x and y
+ *
+ * @param x the x coordinate
+ * @param y the y coordinate
+ * @return the pixel green value at the given coordinate
+ */
public abstract double getGreenValue(int x, int y);
+
+ /**
+ * template method to get the blue value at a specific x and y
+ *
+ * @param x the x coordinate
+ * @param y the y coordinate
+ * @return the pixel blue value at the given coordinate
+ */
public abstract double getBlueValue(int x, int y);
+
+ /**
+ * template method to get the transparency value at a specific x and y
+ *
+ * @param x the x coordinate
+ * @param y the y coordinate
+ * @return the pixel transparency value at the given coordinate
+ */
public abstract double getTransparencyValue(int x, int y);
+ /**
+ * retrieves the value at a specific index for a specific color, transparency or selection
+ *
+ * @param x the x coordinate
+ * @param y the y coordinate
+ * @return the pixel value at the given coordinate for the pixel specification
+ */
public double getValue(int x, int y, char pixelSpec) {
/* in the future, allow customization of out of bounds indices */
@@ -103,14 +151,31 @@
}
}
+ /**
+ * gets the width of the source image
+ *
+ * @return the width of the image
+ */
public int getWidth() {
return width;
}
+ /**
+ * gets the height of the source image
+ *
+ * @return the height of the image
+ */
public int getHeight() {
return height;
}
+ /**
+ * gets the selection value at specific index
+ *
+ * @param x the x coordinate
+ * @param y the y coordinate
+ * @return the selection value either 0 or 1
+ */
private double getSelectionValue(int x, int y) {
if ((x & 0x07) == 0) {
selectionByte = srcImage.getSelectionByte(x >> 3, y);
@@ -120,6 +185,12 @@
return ((selectionByte & bitOffset) == 0) ? 0 : 1;
}
+ /**
+ * sets the selection value at a specific index
+ * @param x the x coordinate
+ * @param y the y coordinate
+ * @param value the selection value to use where 0 is off
+ */
protected void setSelectionValue(int x, int y, double value) {
if ((x & 0x07) == 0) {
selectionByte = 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|