pixelle-commit Mailing List for pixelle (Page 9)
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-29 04:49:37
|
Revision: 122
http://pixelle.svn.sourceforge.net/pixelle/?rev=122&view=rev
Author: dbrosius
Date: 2008-06-28 21:49:45 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
add color out off bounds options
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OptionsAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java
trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval3ByteBGR.java
trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval4ByteABGR.java
trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalByteGray.java
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
Added Paths:
-----------
trunk/pixelle/src/com/mebigfatguy/pixelle/IndexOutOfBoundsOption.java
Removed Paths:
-------------
trunk/pixelle/src/com/mebigfatguy/pixelle/OutOfBoundsOption.java
Copied: trunk/pixelle/src/com/mebigfatguy/pixelle/IndexOutOfBoundsOption.java (from rev 97, trunk/pixelle/src/com/mebigfatguy/pixelle/OutOfBoundsOption.java)
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/IndexOutOfBoundsOption.java (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/IndexOutOfBoundsOption.java 2008-06-29 04:49:45 UTC (rev 122)
@@ -0,0 +1,54 @@
+/*
+ * 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
+ */
+package com.mebigfatguy.pixelle;
+
+import java.awt.Color;
+
+/**
+ * an enum that represents what to do when an index specified is outside the coordinates
+ * of the source bitmap.
+ */
+public enum IndexOutOfBoundsOption {
+ /** use the specified color */
+ SpecifiedColor,
+ /** use the closest border color */
+ BorderColor,
+ /** calculate a new index using the modulus function of the width or height */
+ WrapColor;
+
+ private Color color = Color.WHITE;
+
+ /**
+ * retrieves the color that is used for when the enum is 'SpecifiedColor'
+ *
+ * @return the specified color
+ */
+ public Color getColor() {
+ return color;
+ }
+
+ /**
+ * sets the color that is used for when the enum is 'SpecifiedColor'
+ *
+ * @param clr the specified color
+ */
+ public void setColor(Color clr) {
+ color = clr;
+ }
+}
Deleted: trunk/pixelle/src/com/mebigfatguy/pixelle/OutOfBoundsOption.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/OutOfBoundsOption.java 2008-06-29 04:02:52 UTC (rev 121)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/OutOfBoundsOption.java 2008-06-29 04:49:45 UTC (rev 122)
@@ -1,54 +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
- */
-package com.mebigfatguy.pixelle;
-
-import java.awt.Color;
-
-/**
- * an enum that represents what to do when an index specified is outside the coordinates
- * of the source bitmap.
- */
-public enum OutOfBoundsOption {
- /** use the specified color */
- SpecifiedColor,
- /** use the closest border color */
- BorderColor,
- /** calculate a new index using the modulus function of the width or height */
- WrapColor;
-
- private Color color = Color.WHITE;
-
- /**
- * retrieves the color that is used for when the enum is 'SpecifiedColor'
- *
- * @return the specified color
- */
- public Color getColor() {
- return color;
- }
-
- /**
- * sets the color that is used for when the enum is 'SpecifiedColor'
- *
- * @param clr the specified color
- */
- public void setColor(Color clr) {
- color = clr;
- }
-}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2008-06-29 04:02:52 UTC (rev 121)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleBundle.java 2008-06-29 04:49:45 UTC (rev 122)
@@ -63,11 +63,15 @@
public static final String TRANSPARENCY_LABEL = "label.transparency";
public static final String SELECTION_LABEL = "label.selection";
public static final String PIXEL_OPTIONS = "title.pixel_options";
- public static final String OUT_OF_BOUNDS_PIXELS = "title.out_of_bounds_pixels";
+ public static final String INDEX_OUT_OF_BOUNDS_PIXELS = "title.index_out_of_bounds_pixels";
public static final String STATIC_COLOR = "label.color";
public static final String BORDER_COLOR = "label.border_color";
public static final String WRAPPED_COLOR = "label.wrapped_color";
public static final String PICK_COLOR = "title.pick_color";
+ public static final String COLOR_OUT_OF_BOUNDS_PIXELS = "title.color_out_of_bounds_pixels";
+ public static final String CLIP_COLOR = "label.clip_color";
+ public static final String ROLL_COLOR = "label.roll_color";
+ public static final String WAVE_COLOR = "label.wave_color";
private static ResourceBundle rb = ResourceBundle.getBundle("com/mebigfatguy/pixelle/resources/pixelle");
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java 2008-06-29 04:02:52 UTC (rev 121)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEval.java 2008-06-29 04:49:45 UTC (rev 122)
@@ -31,7 +31,7 @@
protected DataBuffer buffer;
protected int width;
protected int height;
- protected OutOfBoundsOption oobOption;
+ protected IndexOutOfBoundsOption oobOption;
private int selectionByte;
/**
@@ -40,7 +40,7 @@
* @param image the image to evaluate
* @param option the out of bounds pixels option to use
*/
- public PixelleEval(PixelleImage image, OutOfBoundsOption option) {
+ public PixelleEval(PixelleImage image, IndexOutOfBoundsOption option) {
srcImage = image;
buffer = image.getBuffer();
width = image.getWidth();
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java 2008-06-29 04:02:52 UTC (rev 121)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java 2008-06-29 04:49:45 UTC (rev 122)
@@ -26,27 +26,36 @@
public class PixelleEvalFactory {
- private static OutOfBoundsOption oobOption = OutOfBoundsOption.BorderColor;
+ private static IndexOutOfBoundsOption ioobOption = IndexOutOfBoundsOption.BorderColor;
+ private static ColorOutOfBoundsOption coobOption = ColorOutOfBoundsOption.Clip;
private PixelleEvalFactory() {
}
- public static OutOfBoundsOption getOutOfBoundsOption() {
- return oobOption;
+ public static IndexOutOfBoundsOption getIndexOutOfBoundsOption() {
+ return ioobOption;
}
- public static void setOutOfBoundsOption(OutOfBoundsOption option) {
- oobOption = option;
+ public static void setIndexOutOfBoundsOption(IndexOutOfBoundsOption option) {
+ ioobOption = option;
}
+ public static ColorOutOfBoundsOption getColorOutOfBoundsOption() {
+ return coobOption;
+ }
+
+ public static void setColorOutOfBoundsOption(ColorOutOfBoundsOption option) {
+ coobOption = option;
+ }
+
public static PixelleEval create(PixelleImage image) {
switch (image.getType()) {
case BufferedImage.TYPE_3BYTE_BGR:
- return new PixelleEval3ByteBGR(image, oobOption);
+ return new PixelleEval3ByteBGR(image, ioobOption);
case BufferedImage.TYPE_4BYTE_ABGR:
- return new PixelleEval4ByteABGR(image, oobOption);
+ return new PixelleEval4ByteABGR(image, ioobOption);
case BufferedImage.TYPE_BYTE_BINARY:
break;
@@ -55,7 +64,7 @@
break;
case BufferedImage.TYPE_BYTE_GRAY:
- return new PixelleEvalByteGray(image, oobOption);
+ return new PixelleEvalByteGray(image, ioobOption);
case BufferedImage.TYPE_INT_ARGB:
break;
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-06-29 04:02:52 UTC (rev 121)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-06-29 04:49:45 UTC (rev 122)
@@ -86,7 +86,7 @@
PixelleImage destImage = new PixelleImage(new BufferedImage(srcImage.getWidth(), srcImage.getHeight(), BufferedImage.TYPE_4BYTE_ABGR));
PixelleEval srcPE = PixelleEvalFactory.create(srcImage);
- PixelleEval4ByteABGR destPE = new PixelleEval4ByteABGR(destImage, OutOfBoundsOption.BorderColor);
+ PixelleEval4ByteABGR destPE = new PixelleEval4ByteABGR(destImage, IndexOutOfBoundsOption.BorderColor);
PixelleClassLoader pcl = AccessController.doPrivileged(new PrivilegedAction<PixelleClassLoader>() {
public PixelleClassLoader run() {
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OptionsAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OptionsAction.java 2008-06-29 04:02:52 UTC (rev 121)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OptionsAction.java 2008-06-29 04:49:45 UTC (rev 122)
@@ -39,12 +39,15 @@
}
public void actionPerformed(ActionEvent e) {
- PixelleOptionsDialog d = new PixelleOptionsDialog(frame, PixelleEvalFactory.getOutOfBoundsOption());
+ PixelleOptionsDialog d = new PixelleOptionsDialog(frame,
+ PixelleEvalFactory.getIndexOutOfBoundsOption(),
+ PixelleEvalFactory.getColorOutOfBoundsOption());
d.setLocationRelativeTo(frame);
d.setModal(true);
d.setVisible(true);
if (d.isOK()) {
- PixelleEvalFactory.setOutOfBoundsOption(d.getOutOfBoundsOption());
+ PixelleEvalFactory.setIndexOutOfBoundsOption(d.getIndexOutOfBoundsOption());
+ PixelleEvalFactory.setColorOutOfBoundsOption(d.getColorOutOfBoundsOption());
}
}
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java 2008-06-29 04:02:52 UTC (rev 121)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/dialogs/PixelleOptionsDialog.java 2008-06-29 04:49:45 UTC (rev 122)
@@ -36,7 +36,8 @@
import javax.swing.JDialog;
import javax.swing.JPanel;
-import com.mebigfatguy.pixelle.OutOfBoundsOption;
+import com.mebigfatguy.pixelle.ColorOutOfBoundsOption;
+import com.mebigfatguy.pixelle.IndexOutOfBoundsOption;
import com.mebigfatguy.pixelle.PixelleBundle;
import com.mebigfatguy.pixelle.PixelleFrame;
import com.mebigfatguy.pixelle.utils.GuiUtils;
@@ -49,46 +50,102 @@
private JCheckBox borderColorBox = new JCheckBox(PixelleBundle.getString(PixelleBundle.BORDER_COLOR));
private JCheckBox wrappedColorBox = new JCheckBox(PixelleBundle.getString(PixelleBundle.WRAPPED_COLOR));
private ColorButton colorButton = new ColorButton(Color.WHITE);
+
+ private JCheckBox clipBox = new JCheckBox(PixelleBundle.getString(PixelleBundle.CLIP_COLOR));
+ private JCheckBox rollBox = new JCheckBox(PixelleBundle.getString(PixelleBundle.ROLL_COLOR));
+ private JCheckBox waveBox = new JCheckBox(PixelleBundle.getString(PixelleBundle.WAVE_COLOR));
+
private JButton ok = new JButton(PixelleBundle.getString(PixelleBundle.OK));
private JButton cancel = new JButton(PixelleBundle.getString(PixelleBundle.CANCEL));
private boolean okClicked = false;
private Color color;
- private OutOfBoundsOption oobOption;
+ private IndexOutOfBoundsOption ioobOption;
+ private ColorOutOfBoundsOption coobOption;
- public PixelleOptionsDialog(PixelleFrame owner, OutOfBoundsOption option) {
+ public PixelleOptionsDialog(PixelleFrame owner, IndexOutOfBoundsOption ioption, ColorOutOfBoundsOption coption) {
super(owner, PixelleBundle.getString(PixelleBundle.PIXEL_OPTIONS));
- oobOption = option;
- color = oobOption.getColor();
+ ioobOption = ioption;
+ color = ioobOption.getColor();
+ coobOption = coption;
initComponents();
initListeners();
pack();
}
public boolean isOK() {
+ if (clipBox.isSelected())
+ coobOption = ColorOutOfBoundsOption.Clip;
+ else if (rollBox.isSelected())
+ coobOption = ColorOutOfBoundsOption.Roll;
+ else
+ coobOption = ColorOutOfBoundsOption.Wave;
+
if (colorBox.isSelected()) {
- oobOption = OutOfBoundsOption.SpecifiedColor;
- oobOption.setColor(color);
+ ioobOption = IndexOutOfBoundsOption.SpecifiedColor;
+ ioobOption.setColor(color);
}
else if (borderColorBox.isSelected())
- oobOption = OutOfBoundsOption.BorderColor;
+ ioobOption = IndexOutOfBoundsOption.BorderColor;
else
- oobOption = OutOfBoundsOption.WrapColor;
+ ioobOption = IndexOutOfBoundsOption.WrapColor;
return okClicked;
}
- public OutOfBoundsOption getOutOfBoundsOption() {
- return oobOption;
+ public IndexOutOfBoundsOption getIndexOutOfBoundsOption() {
+ return ioobOption;
}
+ public ColorOutOfBoundsOption getColorOutOfBoundsOption() {
+ return coobOption;
+ }
+
private void initComponents() {
Container cp = getContentPane();
cp.setLayout(new BoxLayout(cp, BoxLayout.Y_AXIS));
+ cp.add(Box.createVerticalStrut(5));
+
{
JPanel p = new JPanel();
p.setLayout(new GridLayout(3, 1));
- p.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), PixelleBundle.getString(PixelleBundle.OUT_OF_BOUNDS_PIXELS)));
+ p.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), PixelleBundle.getString(PixelleBundle.COLOR_OUT_OF_BOUNDS_PIXELS)));
+
+ GuiUtils.sizeUniformly(GuiUtils.Sizing.Height, clipBox, rollBox, waveBox);
+ p.add(clipBox);
+ p.add(rollBox);
+ p.add(waveBox);
+
+ ButtonGroup g = new ButtonGroup();
+ g.add(clipBox);
+ g.add(rollBox);
+ g.add(waveBox);
+
+ switch (coobOption) {
+ case Clip:
+ clipBox.setSelected(true);
+ break;
+
+ case Roll:
+ rollBox.setSelected(true);
+ break;
+
+ case Wave:
+ waveBox.setSelected(true);
+ break;
+ }
+
+ cp.add(p);
+ }
+
+ cp.add(Box.createVerticalStrut(5));
+ cp.add(Box.createVerticalGlue());
+
+ {
+ JPanel p = new JPanel();
+ p.setLayout(new GridLayout(3, 1));
+ p.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), PixelleBundle.getString(PixelleBundle.INDEX_OUT_OF_BOUNDS_PIXELS)));
+
GuiUtils.sizeUniformly(GuiUtils.Sizing.Height, colorBox, colorButton, borderColorBox, wrappedColorBox);
colorButton.setColor(color);
@@ -109,7 +166,7 @@
g.add(borderColorBox);
g.add(wrappedColorBox);
- switch (oobOption) {
+ switch (ioobOption) {
case SpecifiedColor:
colorBox.setSelected(true);
break;
@@ -126,12 +183,13 @@
cp.add(p);
}
+ cp.add(Box.createVerticalStrut(5));
cp.add(Box.createVerticalGlue());
{
JPanel p = new JPanel();
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
- p.setBorder(BorderFactory.createEmptyBorder(4, 10, 4, 10));
+ p.setBorder(BorderFactory.createEmptyBorder(4, 40, 4, 40));
p.add(Box.createHorizontalGlue());
GuiUtils.sizeUniformly(GuiUtils.Sizing.Both, ok, cancel);
@@ -141,6 +199,8 @@
p.add(Box.createHorizontalGlue());
cp.add(p);
}
+
+ cp.add(Box.createVerticalStrut(5));
}
private void initListeners() {
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval3ByteBGR.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval3ByteBGR.java 2008-06-29 04:02:52 UTC (rev 121)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval3ByteBGR.java 2008-06-29 04:49:45 UTC (rev 122)
@@ -18,13 +18,13 @@
*/
package com.mebigfatguy.pixelle.eval;
-import com.mebigfatguy.pixelle.OutOfBoundsOption;
+import com.mebigfatguy.pixelle.IndexOutOfBoundsOption;
import com.mebigfatguy.pixelle.PixelleEval;
import com.mebigfatguy.pixelle.PixelleImage;
public class PixelleEval3ByteBGR extends PixelleEval {
- public PixelleEval3ByteBGR(PixelleImage srcImage, OutOfBoundsOption option) {
+ public PixelleEval3ByteBGR(PixelleImage srcImage, IndexOutOfBoundsOption option) {
super(srcImage, option);
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval4ByteABGR.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval4ByteABGR.java 2008-06-29 04:02:52 UTC (rev 121)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval4ByteABGR.java 2008-06-29 04:49:45 UTC (rev 122)
@@ -18,13 +18,13 @@
*/
package com.mebigfatguy.pixelle.eval;
-import com.mebigfatguy.pixelle.OutOfBoundsOption;
+import com.mebigfatguy.pixelle.IndexOutOfBoundsOption;
import com.mebigfatguy.pixelle.PixelleEval;
import com.mebigfatguy.pixelle.PixelleImage;
public class PixelleEval4ByteABGR extends PixelleEval {
- public PixelleEval4ByteABGR(PixelleImage srcImage, OutOfBoundsOption option) {
+ public PixelleEval4ByteABGR(PixelleImage srcImage, IndexOutOfBoundsOption option) {
super(srcImage, option);
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalByteGray.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalByteGray.java 2008-06-29 04:02:52 UTC (rev 121)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalByteGray.java 2008-06-29 04:49:45 UTC (rev 122)
@@ -18,13 +18,13 @@
*/
package com.mebigfatguy.pixelle.eval;
-import com.mebigfatguy.pixelle.OutOfBoundsOption;
+import com.mebigfatguy.pixelle.IndexOutOfBoundsOption;
import com.mebigfatguy.pixelle.PixelleEval;
import com.mebigfatguy.pixelle.PixelleImage;
public class PixelleEvalByteGray extends PixelleEval {
- public PixelleEvalByteGray(PixelleImage srcImage, OutOfBoundsOption option) {
+ public PixelleEvalByteGray(PixelleImage srcImage, IndexOutOfBoundsOption option) {
super(srcImage, option);
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2008-06-29 04:02:52 UTC (rev 121)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2008-06-29 04:49:45 UTC (rev 122)
@@ -1,21 +1,19 @@
-/*
- * 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
- */
+# * 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
@@ -45,7 +43,7 @@
menu.transform.title = Transform
menu.transform.options = Options
-menu.transform.newwindow = Transform in new window
+menu.transform.newwindow = Transform creates new Window
menu.transform.transform = Transform
formula.red = p[x,y].r
@@ -62,8 +60,14 @@
label.selection = (Selection)
title.pixel_options = Pixel Options
-title.out_of_bounds_pixels = For out-of-bounds pixels use:
+title.index_out_of_bounds_pixels = For index-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
+title.pick_color = Pick a color for out of bounds indices
+
+title.color_out_of_bounds_pixels = For color-out-of-bounds pixels use\:
+label.clip_color = Color Clipping
+label.roll_color = Color Rolling
+label.wave_color = Color Waving
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-29 04:02:44
|
Revision: 121
http://pixelle.svn.sourceforge.net/pixelle/?rev=121&view=rev
Author: dbrosius
Date: 2008-06-28 21:02:52 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
an enum that represents what to do when the color is out of the 0 - 255 range
Added Paths:
-----------
trunk/pixelle/src/com/mebigfatguy/pixelle/ColorOutOfBoundsOption.java
Added: trunk/pixelle/src/com/mebigfatguy/pixelle/ColorOutOfBoundsOption.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/ColorOutOfBoundsOption.java (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/ColorOutOfBoundsOption.java 2008-06-29 04:02:52 UTC (rev 121)
@@ -0,0 +1,28 @@
+/*
+ * 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
+ */
+package com.mebigfatguy.pixelle;
+
+/**
+ * an enum that represents what to do when a color specified is outside the color space of 0 - 255
+ */
+public enum ColorOutOfBoundsOption {
+ Clip,
+ Roll,
+ Wave;
+}
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/ColorOutOfBoundsOption.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-29 03:54:44
|
Revision: 120
http://pixelle.svn.sourceforge.net/pixelle/?rev=120&view=rev
Author: dbrosius
Date: 2008-06-28 20:54:54 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
oi
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-29 03:50:22 UTC (rev 119)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-06-29 03:54:54 UTC (rev 120)
@@ -30,7 +30,6 @@
import org.antlr.runtime.ANTLRStringStream;
import org.antlr.runtime.CharStream;
import org.antlr.runtime.CommonTokenStream;
-import org.antlr.runtime.RecognitionException;
import com.mebigfatguy.pixelle.antlr.PixelleLexer;
import com.mebigfatguy.pixelle.antlr.PixelleParser;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-29 03:50:13
|
Revision: 119
http://pixelle.svn.sourceforge.net/pixelle/?rev=119&view=rev
Author: dbrosius
Date: 2008-06-28 20:50:22 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
try to handle parse errors better
Modified Paths:
--------------
trunk/pixelle/etc/Pixelle.g
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
Modified: trunk/pixelle/etc/Pixelle.g
===================================================================
--- trunk/pixelle/etc/Pixelle.g 2008-06-29 00:58:13 UTC (rev 118)
+++ trunk/pixelle/etc/Pixelle.g 2008-06-29 03:50:22 UTC (rev 119)
@@ -53,6 +53,12 @@
}
}
+@rulecatch {
+ catch ( RecognitionException ex ) {
+ throw ex;
+ }
+}
+
pixelle :
expr
{
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-06-29 00:58:13 UTC (rev 118)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-06-29 03:50:22 UTC (rev 119)
@@ -30,6 +30,7 @@
import org.antlr.runtime.ANTLRStringStream;
import org.antlr.runtime.CharStream;
import org.antlr.runtime.CommonTokenStream;
+import org.antlr.runtime.RecognitionException;
import com.mebigfatguy.pixelle.antlr.PixelleLexer;
import com.mebigfatguy.pixelle.antlr.PixelleParser;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-29 00:58:05
|
Revision: 118
http://pixelle.svn.sourceforge.net/pixelle/?rev=118&view=rev
Author: dbrosius
Date: 2008-06-28 17:58:13 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
give a 'pleasing' sample on new
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/Pixelle.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/NewFileAction.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/Pixelle.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/Pixelle.java 2008-06-29 00:44:52 UTC (rev 117)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/Pixelle.java 2008-06-29 00:58:13 UTC (rev 118)
@@ -20,6 +20,8 @@
import java.awt.Rectangle;
+import javax.swing.JOptionPane;
+
import com.mebigfatguy.pixelle.utils.GuiUtils;
/**
@@ -34,9 +36,14 @@
* @param args command line arguments
*/
public static void main(String[] args) {
- PixelleFrame pf = new PixelleFrame();
- Rectangle bounds = GuiUtils.getScreenBounds();
- pf.setBounds(bounds);
- pf.setVisible(true);
+ try {
+ PixelleFrame pf = new PixelleFrame();
+ Rectangle bounds = GuiUtils.getScreenBounds();
+ pf.setBounds(bounds);
+ pf.setVisible(true);
+ } catch (PixelleTransformException pte) {
+ JOptionPane.showMessageDialog(null, pte.getMessage());
+ pte.printStackTrace();
+ }
}
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-06-29 00:44:52 UTC (rev 117)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-06-29 00:58:13 UTC (rev 118)
@@ -87,8 +87,8 @@
transient PixelleImage image;
boolean doNewWindow;
- public PixelleFrame() {
- this(new PixelleImage(), false);
+ public PixelleFrame() throws PixelleTransformException {
+ this(new PixelleTransformer(new PixelleImage(), PixelleTransformer.getSampleTransform()).transform());
}
public PixelleFrame(PixelleImage srcImage) {
@@ -109,7 +109,7 @@
JMenuBar mb = new JMenuBar();
fileMenu = new JMenu(PixelleBundle.getString(PixelleBundle.FILE_MENU));
- newItem = new JMenuItem(new NewFileAction());
+ newItem = new JMenuItem(new NewFileAction(this));
fileMenu.add(newItem);
openItem = new JMenuItem(new OpenFileAction(this));
fileMenu.add(openItem);
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-06-29 00:44:52 UTC (rev 117)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-06-29 00:58:13 UTC (rev 118)
@@ -24,6 +24,7 @@
import java.io.IOException;
import java.security.AccessController;
import java.security.PrivilegedAction;
+import java.util.HashMap;
import java.util.Map;
import org.antlr.runtime.ANTLRStringStream;
@@ -53,6 +54,20 @@
}
/**
+ * builds a sample set of algorithms that creates a 'pleasing' image
+ *
+ * @return a set of transformation algorithms
+ */
+ public static Map<PixelleComponent, String> getSampleTransform() {
+ Map<PixelleComponent, String> algorithms = new HashMap<PixelleComponent, String>();
+ algorithms.put(PixelleComponent.RED, "x");
+ algorithms.put(PixelleComponent.GREEN, "y");
+ algorithms.put(PixelleComponent.BLUE, "abs((width/2) - x)");
+ algorithms.put(PixelleComponent.TRANSPARENCY, "((x < 10) || (x >= (width - 10)) || (y < 10) || (y >= (height - 10))) ? 180 : 255");
+ algorithms.put(PixelleComponent.SELECTION, "0");
+ return algorithms;
+ }
+ /**
* 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.
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/NewFileAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/NewFileAction.java 2008-06-29 00:44:52 UTC (rev 117)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/NewFileAction.java 2008-06-29 00:58:13 UTC (rev 118)
@@ -21,24 +21,33 @@
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
+import javax.swing.JOptionPane;
import com.mebigfatguy.pixelle.FrameMgr;
import com.mebigfatguy.pixelle.PixelleBundle;
import com.mebigfatguy.pixelle.PixelleFrame;
+import com.mebigfatguy.pixelle.PixelleTransformException;
import com.mebigfatguy.pixelle.utils.GuiUtils;
public class NewFileAction extends AbstractAction {
- private static final long serialVersionUID = 7977411917585137527L;
-
- public NewFileAction() {
+ private static final long serialVersionUID = 2300557759679077906L;
+ PixelleFrame frame;
+
+ public NewFileAction(PixelleFrame pf) {
super(PixelleBundle.getString(PixelleBundle.NEW_ITEM));
+ frame = pf;
}
public void actionPerformed(ActionEvent e) {
- PixelleFrame pf = new PixelleFrame();
- pf.setBounds(GuiUtils.getScreenBounds());
- pf.setVisible(true);
- FrameMgr.getInstance().add(pf);
+ try {
+ PixelleFrame pf = new PixelleFrame();
+ pf.setBounds(GuiUtils.getScreenBounds());
+ pf.setVisible(true);
+ FrameMgr.getInstance().add(pf);
+ } catch (PixelleTransformException pte) {
+ JOptionPane.showMessageDialog(frame, pte.getMessage());
+ pte.printStackTrace();
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-29 00:44:42
|
Revision: 117
http://pixelle.svn.sourceforge.net/pixelle/?rev=117&view=rev
Author: dbrosius
Date: 2008-06-28 17:44:52 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
Se fix
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-06-29 00:43:42 UTC (rev 116)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-06-29 00:44:52 UTC (rev 117)
@@ -84,7 +84,7 @@
JScrollPane scroll;
ImagePanel panel;
- PixelleImage image;
+ transient PixelleImage image;
boolean doNewWindow;
public PixelleFrame() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-29 00:43:33
|
Revision: 116
http://pixelle.svn.sourceforge.net/pixelle/?rev=116&view=rev
Author: dbrosius
Date: 2008-06-28 17:43:42 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
UwF fix
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-06-29 00:41:48 UTC (rev 115)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-06-29 00:43:42 UTC (rev 116)
@@ -256,7 +256,7 @@
public class ImagePanel extends JPanel {
private static final long serialVersionUID = -1572146409734928935L;
- private ZoomLevel zoom;
+ private ZoomLevel zoom = ZoomLevel.FitToWindow;
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-29 00:41:38
|
Revision: 115
http://pixelle.svn.sourceforge.net/pixelle/?rev=115&view=rev
Author: dbrosius
Date: 2008-06-28 17:41:48 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
pcoa fix
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-29 00:30:39 UTC (rev 114)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2008-06-29 00:41:48 UTC (rev 115)
@@ -61,11 +61,11 @@
return image.getType();
}
- public int getWidth() {
+ public final int getWidth() {
return image.getWidth();
}
- public int getHeight() {
+ public final int getHeight() {
return image.getHeight();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-29 00:30:31
|
Revision: 114
http://pixelle.svn.sourceforge.net/pixelle/?rev=114&view=rev
Author: dbrosius
Date: 2008-06-28 17:30:39 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
update date
Modified Paths:
--------------
trunk/pixelle/htdocs/index.html
Modified: trunk/pixelle/htdocs/index.html
===================================================================
--- trunk/pixelle/htdocs/index.html 2008-06-29 00:25:07 UTC (rev 113)
+++ trunk/pixelle/htdocs/index.html 2008-06-29 00:30:39 UTC (rev 114)
@@ -82,7 +82,7 @@
The number e, the base of the natural logarithms</li>
</ul>
- <p><pre>As of June 27, simple expressions should work. Some examples:
+ <p><pre>As of June 28, simple expressions should work. Some examples:
p[x,y].r = <b>(x + y) == 100 ? 255 : p[x,y].r</b>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|
|
From: <dbr...@us...> - 2008-06-29 00:03:46
|
Revision: 112
http://pixelle.svn.sourceforge.net/pixelle/?rev=112&view=rev
Author: dbrosius
Date: 2008-06-28 17:03:54 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
add pi() and e()
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-28 23:57:09 UTC (rev 111)
+++ trunk/pixelle/etc/Pixelle.g 2008-06-29 00:03:54 UTC (rev 112)
@@ -306,6 +306,14 @@
{
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "exp", "(D)D");
}
+ | 'e' '(' ')'
+ {
+ mv.visitLdcInsn(Math.E);
+ }
+ | 'pi' '(' ')'
+ {
+ mv.visitLdcInsn(Math.PI);
+ }
| 'random'
{
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "random", "()D");
Modified: trunk/pixelle/htdocs/index.html
===================================================================
--- trunk/pixelle/htdocs/index.html 2008-06-28 23:57:09 UTC (rev 111)
+++ trunk/pixelle/htdocs/index.html 2008-06-29 00:03:54 UTC (rev 112)
@@ -76,6 +76,10 @@
The euler number (e) raised to an expression's power.</li>
<li>random(e)<br/>
A random number between 0 and 1</li>
+ <li>pi()<br/>
+ The number pi, the ratio of the circumference of a circle to its diameter</li>
+ <li>e()<br/>
+ The number e, the base of the natural logarithms</li>
</ul>
<p><pre>As of June 27, simple expressions should work. Some examples:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-28 23:57:08
|
Revision: 111
http://pixelle.svn.sourceforge.net/pixelle/?rev=111&view=rev
Author: dbrosius
Date: 2008-06-28 16:57:09 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
add most of the java.lang.Math functions
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-28 23:18:02 UTC (rev 110)
+++ trunk/pixelle/etc/Pixelle.g 2008-06-28 23:57:09 UTC (rev 111)
@@ -265,6 +265,50 @@
| 'min' '(' expr ',' expr ')'
{
mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "min", "(DD)D");
+ }
+ | 'pow' '(' expr ',' expr ')'
+ {
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "pow", "(DD)D");
+ }
+ | 'sqrt' '(' expr ')'
+ {
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "sqrt", "(D)D");
+ }
+ | 'sin' '(' expr ')'
+ {
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "sin", "(D)D");
+ }
+ | 'cos' '(' expr ')'
+ {
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "cos", "(D)D");
+ }
+ | 'tan' '(' expr ')'
+ {
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "tan", "(D)D");
+ }
+ | 'asin' '(' expr ')'
+ {
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "asin", "(D)D");
+ }
+ | 'acos' '(' expr ')'
+ {
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "acos", "(D)D");
+ }
+ | 'atan' '(' expr ')'
+ {
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "atan", "(D)D");
+ }
+ | 'log' '(' expr ')'
+ {
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "log", "(D)D");
+ }
+ | 'exp' '(' expr ')'
+ {
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "exp", "(D)D");
+ }
+ | 'random'
+ {
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/Math", "random", "()D");
} ;
NUMBER : '0'..'9'+ ( '.' ('0'..'9'+))?;
Modified: trunk/pixelle/htdocs/index.html
===================================================================
--- trunk/pixelle/htdocs/index.html 2008-06-28 23:18:02 UTC (rev 110)
+++ trunk/pixelle/htdocs/index.html 2008-06-28 23:57:09 UTC (rev 111)
@@ -49,11 +49,33 @@
<li>height<br/>
The height in pixels of the image.</li>
<li>abs(e)<br/>
- The absolute value of an expression.
+ The absolute value of an expression.</li>
<li>min(e, f)<br/>
- The minimum value of two expressions.
+ The minimum value of two expressions.</li>
<li>min(e, f)<br/>
- The maximum value of two expressions.
+ The maximum value of two expressions.</li>
+ <li>pow(e, f)<br/>
+ One expression raised to the second expression's power</li>
+ <li>sqrt(e)<br/>
+ The square root of an expression</li>
+ <li>sin(e)<br/>
+ The sine of an expression</li>
+ <li>cos(e)<br/>
+ The cosine of an expression</li>
+ <li>tan(e)<br/>
+ The tangent of an expression</li>
+ <li>asin(e)<br/>
+ The arc sine of an expression</li>
+ <li>acos(e)<br/>
+ The arc cosine of an expression</li>
+ <li>atan(e)<br/>
+ The arc tangent of an expression</li>
+ <li>log(e)<br/>
+ The log of an expression</li>
+ <li>exp(e)<br/>
+ The euler number (e) raised to an expression's power.</li>
+ <li>random(e)<br/>
+ A random number between 0 and 1</li>
</ul>
<p><pre>As of June 27, simple expressions should work. Some examples:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-28 23:17:58
|
Revision: 110
http://pixelle.svn.sourceforge.net/pixelle/?rev=110&view=rev
Author: dbrosius
Date: 2008-06-28 16:18:02 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
finally! fix up in frame redraw (fit to window)
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-06-28 22:59:46 UTC (rev 109)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-06-28 23:18:02 UTC (rev 110)
@@ -26,7 +26,6 @@
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.IOException;
-import java.util.ResourceBundle;
import javax.imageio.ImageIO;
import javax.swing.ButtonGroup;
@@ -180,8 +179,6 @@
setJMenuBar(mb);
- FrameMgr.getInstance().add(this);
-
Container cp = getContentPane();
cp.setLayout(new BorderLayout());
@@ -191,6 +188,8 @@
setBounds(GuiUtils.getScreenBounds());
setZoom(ZoomLevel.FitToWindow);
+ FrameMgr.getInstance().add(this);
+
}
public boolean createNewWindow() {
@@ -248,53 +247,48 @@
}
public final void setZoom(final ZoomLevel zoom) {
- if (image == null)
- return;
-
- double zoomFactor = zoom.getZoom();
- final int h = (int)(image.getHeight() * zoomFactor);
- final int w = (int)(image.getWidth() * zoomFactor);
- SwingUtilities.invokeLater(new Runnable() {
- public void run() {
- int width = w;
- int height = h;
- if ((h == 0) || (w == 0)) {
- Container cp = PixelleFrame.this.getContentPane();
- height = cp.getHeight();
- width = cp.getWidth();
- int imageH = image.getHeight();
- int imageW = image.getWidth();
- double divH = (double)height / (double)imageH;
- double divW = (double)width / (double)imageW;
- double div = Math.min(divH, divW);
- height = (int)(div * imageH);
- width = (int)(div * imageW);
- }
- panel.setSize(width, height);
- panel.setImageDim(new Dimension(width, height));
- invalidate();
- validate();
- repaint();
- }
- });
+ panel.setZoom(zoom);
+ panel.invalidate();
+ panel.validate();
+ panel.repaint();
}
public class ImagePanel extends JPanel {
private static final long serialVersionUID = -1572146409734928935L;
- Dimension dim = new Dimension(10, 10);
+ private ZoomLevel zoom;
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
+
if (image != null) {
+ Dimension dim = getDimension();
image.draw(g, 0, 0, dim.width, dim.height);
}
}
-
- public void setImageDim(Dimension d) {
- dim = d;
+
+ public void setZoom(ZoomLevel zoomLevel) {
+ zoom = zoomLevel;
}
+ private Dimension getDimension() {
+ if (zoom == ZoomLevel.FitToWindow) {
+ Container cp = PixelleFrame.this.getContentPane();
+ int cHeight = cp.getHeight();
+ int cWidth = cp.getWidth();
+ int iHeight = image.getHeight();
+ int iWidth = image.getWidth();
+ double divH = (double)cHeight / (double)iHeight;
+ double divW = (double)cWidth / (double)iWidth;
+ double div = Math.min(divH, divW);
+ return new Dimension((int)(div * iHeight), (int)(div * iWidth));
+ }
+ else {
+ double zoomFactor = zoom.getZoom();
+ return new Dimension((int)(image.getHeight() * zoomFactor), (int)(image.getWidth() * zoomFactor));
+ }
+ }
+
@Override
public Dimension getPreferredSize() {
return getSize();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-28 22:59:45
|
Revision: 109
http://pixelle.svn.sourceforge.net/pixelle/?rev=109&view=rev
Author: dbrosius
Date: 2008-06-28 15:59:46 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
futzing
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-06-28 22:46:49 UTC (rev 108)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-06-28 22:59:46 UTC (rev 109)
@@ -234,6 +234,7 @@
setZoom(ZoomLevel.FitToWindow);
scroll = new JScrollPane(panel);
cp.add(scroll, BorderLayout.CENTER);
+ doNewWindow = true;
transformNewWindowItem.setSelected(true);
invalidate();
validate();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-28 22:46:43
|
Revision: 108
http://pixelle.svn.sourceforge.net/pixelle/?rev=108&view=rev
Author: dbrosius
Date: 2008-06-28 15:46:49 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
cleanup
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 22:30:06 UTC (rev 107)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-06-28 22:46:49 UTC (rev 108)
@@ -79,38 +79,30 @@
JCheckBoxMenuItem fitToWindowItem;
JMenu transformMenu;
- JMenuItem optionsItem;
JCheckBoxMenuItem transformNewWindowItem;
+ JMenuItem optionsItem;
JMenuItem transformItem;
- ResourceBundle rb = ResourceBundle.getBundle("com.mebigfatguy.pixelle.pixelle");
JScrollPane scroll;
- ImagePanel panel = new ImagePanel();
+ ImagePanel panel;
PixelleImage image;
boolean doNewWindow;
public PixelleFrame() {
- image = new PixelleImage();
- doNewWindow = false;
- initComponents();
- initListeners();
-
- setTitle(rb.getString("pixelle.title"));
+ this(new PixelleImage(), false);
}
public PixelleFrame(PixelleImage srcImage) {
+ this(srcImage, true);
+ }
+
+ private PixelleFrame(PixelleImage srcImage, boolean transformInNewWindow) {
image = srcImage;
- doNewWindow = true;
+ doNewWindow = transformInNewWindow;
initComponents();
initListeners();
- setTitle(rb.getString("pixelle.title"));
- Container cp = getContentPane();
- cp.removeAll();
- setZoom(ZoomLevel.FitToWindow);
- scroll = new JScrollPane(panel);
- cp.add(scroll, BorderLayout.CENTER);
- setBounds(GuiUtils.getScreenBounds());
+ setTitle(PixelleBundle.getString(PixelleBundle.TITLE));
FrameMgr.getInstance().add(this);
}
@@ -141,7 +133,7 @@
mb.add(fileMenu);
- viewMenu = new JMenu(rb.getString(PixelleBundle.VIEW_MENU));
+ viewMenu = new JMenu(PixelleBundle.getString(PixelleBundle.VIEW_MENU));
oneEighthItem = new JCheckBoxMenuItem(new ZoomAction(this, ZoomLevel.OneEighth));
viewMenu.add(oneEighthItem);
oneFourthItem = new JCheckBoxMenuItem(new ZoomAction(this, ZoomLevel.OneFourth));
@@ -174,12 +166,12 @@
mb.add(viewMenu);
- transformMenu = new JMenu(rb.getString(PixelleBundle.TRANSFORM_MENU));
- optionsItem = new JMenuItem(new OptionsAction(this));
- transformMenu.add(optionsItem);
+ transformMenu = new JMenu(PixelleBundle.getString(PixelleBundle.TRANSFORM_MENU));
transformNewWindowItem = new JCheckBoxMenuItem(new TransformNewWindowAction(this));
transformNewWindowItem.setSelected(doNewWindow);
transformMenu.add(transformNewWindowItem);
+ optionsItem = new JMenuItem(new OptionsAction(this));
+ transformMenu.add(optionsItem);
transformMenu.addSeparator();
transformItem = new JMenuItem(new TransformAction(this));
transformMenu.add(transformItem);
@@ -192,6 +184,13 @@
Container cp = getContentPane();
cp.setLayout(new BorderLayout());
+
+ panel = new ImagePanel();
+ scroll = new JScrollPane(panel);
+ cp.add(scroll, BorderLayout.CENTER);
+ setBounds(GuiUtils.getScreenBounds());
+
+ setZoom(ZoomLevel.FitToWindow);
}
public boolean createNewWindow() {
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2008-06-28 22:30:06 UTC (rev 107)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleImage.java 2008-06-28 22:46:49 UTC (rev 108)
@@ -39,6 +39,9 @@
public PixelleImage() {
this(new BufferedImage(400, 400, BufferedImage.TYPE_3BYTE_BGR));
+ Graphics g = image.getGraphics();
+ g.setColor(Color.RED);
+ g.fillRect(0, 0, 400, 400);
}
public PixelleImage(BufferedImage 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 22:29:59
|
Revision: 107
http://pixelle.svn.sourceforge.net/pixelle/?rev=107&view=rev
Author: dbrosius
Date: 2008-06-28 15:30:06 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
fix 4ByteABGR
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-28 22:29:17 UTC (rev 106)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-06-28 22:30:06 UTC (rev 107)
@@ -32,7 +32,7 @@
import com.mebigfatguy.pixelle.antlr.PixelleLexer;
import com.mebigfatguy.pixelle.antlr.PixelleParser;
-import com.mebigfatguy.pixelle.eval.PixelleEval3ByteABGR;
+import com.mebigfatguy.pixelle.eval.PixelleEval4ByteABGR;
/**
* transforms one bitmap into another based on the algorithms defined by the user.
@@ -71,7 +71,7 @@
PixelleImage destImage = new PixelleImage(new BufferedImage(srcImage.getWidth(), srcImage.getHeight(), BufferedImage.TYPE_4BYTE_ABGR));
PixelleEval srcPE = PixelleEvalFactory.create(srcImage);
- PixelleEval3ByteABGR destPE = new PixelleEval3ByteABGR(destImage, OutOfBoundsOption.BorderColor);
+ PixelleEval4ByteABGR destPE = new PixelleEval4ByteABGR(destImage, OutOfBoundsOption.BorderColor);
PixelleClassLoader pcl = AccessController.doPrivileged(new PrivilegedAction<PixelleClassLoader>() {
public PixelleClassLoader run() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-28 22:29:16
|
Revision: 106
http://pixelle.svn.sourceforge.net/pixelle/?rev=106&view=rev
Author: dbrosius
Date: 2008-06-28 15:29:17 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
support 4ByteABGR
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java
Removed Paths:
-------------
trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval3ByteABGR.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java 2008-06-28 22:28:37 UTC (rev 105)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java 2008-06-28 22:29:17 UTC (rev 106)
@@ -21,6 +21,7 @@
import java.awt.image.BufferedImage;
import com.mebigfatguy.pixelle.eval.PixelleEval3ByteBGR;
+import com.mebigfatguy.pixelle.eval.PixelleEval4ByteABGR;
import com.mebigfatguy.pixelle.eval.PixelleEvalByteGray;
public class PixelleEvalFactory {
@@ -45,7 +46,7 @@
return new PixelleEval3ByteBGR(image, oobOption);
case BufferedImage.TYPE_4BYTE_ABGR:
- break;
+ return new PixelleEval4ByteABGR(image, oobOption);
case BufferedImage.TYPE_BYTE_BINARY:
break;
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-06-28 22:28:37 UTC (rev 105)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-06-28 22:29:17 UTC (rev 106)
@@ -194,6 +194,10 @@
cp.setLayout(new BorderLayout());
}
+ public boolean createNewWindow() {
+ return doNewWindow;
+ }
+
public void toggleNewWindowOption() {
doNewWindow = !doNewWindow;
transformNewWindowItem.setSelected(doNewWindow);
@@ -213,6 +217,13 @@
return image;
}
+ public void setImage(PixelleImage img) {
+ image = img;
+ panel.invalidate();
+ panel.revalidate();
+ panel.repaint();
+ }
+
public void openFile(File f) {
setTitle(f.getName());
try {
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java 2008-06-28 22:28:37 UTC (rev 105)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java 2008-06-28 22:29:17 UTC (rev 106)
@@ -50,11 +50,15 @@
PixelleTransformer transformer = new PixelleTransformer(frame.getImage(), d.getAlgorithms());
PixelleImage dstImage = transformer.transform();
if (dstImage != null) {
- PixelleFrame f = new PixelleFrame(dstImage);
- f.setVisible(true);
+ if (frame.createNewWindow()) {
+ PixelleFrame f = new PixelleFrame(dstImage);
+ f.setVisible(true);
+ } else
+ frame.setImage(dstImage);
}
}
} catch (PixelleTransformException pe) {
+ pe.printStackTrace();
JOptionPane.showMessageDialog(frame, pe.getMessage());
}
}
Deleted: trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval3ByteABGR.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval3ByteABGR.java 2008-06-28 22:28:37 UTC (rev 105)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval3ByteABGR.java 2008-06-28 22:29:17 UTC (rev 106)
@@ -1,81 +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
- */
-package com.mebigfatguy.pixelle.eval;
-
-import com.mebigfatguy.pixelle.OutOfBoundsOption;
-import com.mebigfatguy.pixelle.PixelleEval;
-import com.mebigfatguy.pixelle.PixelleImage;
-
-public class PixelleEval3ByteABGR extends PixelleEval {
-
- public PixelleEval3ByteABGR(PixelleImage srcImage, OutOfBoundsOption option) {
- super(srcImage, option);
- }
-
- @Override
- public double getTransparencyValue(int x, int y) {
- return (double)buffer.getElem(y * width * 4 + x * 4);
- }
-
- @Override
- public double getBlueValue(int x, int y) {
- return (double)buffer.getElem(y * width * 4 + x * 4 + 1);
- }
-
- @Override
- public double getGreenValue(int x, int y) {
- return (double)buffer.getElem(y * width * 4 + x * 4 + 2);
- }
-
- @Override
- public double getRedValue(int x, int y) {
- return (double)buffer.getElem(y * width * 4 + x * 4 + 3);
- }
-
- public void setValue(int x, int y, char pixelSpec, double value) {
-
- if (value < 0.0)
- value = 0.0;
- else if (value > 255.0)
- value = 255.0;
-
- switch (pixelSpec) {
- case 't':
- buffer.setElem(y * width * 4 + x * 4, (int)(value + 0.49));
- break;
-
- case 'b':
- buffer.setElem(y * width * 4 + x * 4 + 1, (int)(value + 0.49));
- break;
-
- case 'g':
- buffer.setElem(y * width * 4 + x * 4 + 2, (int)(value + 0.49));
- break;
-
- case 'r':
- buffer.setElem(y * width * 4 + x * 4 + 3, (int)(value + 0.49));
- break;
-
- case 's':
- setSelectionValue(x, y, value);
- break;
- }
- }
-
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-28 22:28:28
|
Revision: 105
http://pixelle.svn.sourceforge.net/pixelle/?rev=105&view=rev
Author: dbrosius
Date: 2008-06-28 15:28:37 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
fix class name after move
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval4ByteABGR.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval4ByteABGR.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval4ByteABGR.java 2008-06-28 22:27:39 UTC (rev 104)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval4ByteABGR.java 2008-06-28 22:28:37 UTC (rev 105)
@@ -22,9 +22,9 @@
import com.mebigfatguy.pixelle.PixelleEval;
import com.mebigfatguy.pixelle.PixelleImage;
-public class PixelleEval3ByteABGR extends PixelleEval {
+public class PixelleEval4ByteABGR extends PixelleEval {
- public PixelleEval3ByteABGR(PixelleImage srcImage, OutOfBoundsOption option) {
+ public PixelleEval4ByteABGR(PixelleImage srcImage, OutOfBoundsOption option) {
super(srcImage, option);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-28 22:27:33
|
Revision: 104
http://pixelle.svn.sourceforge.net/pixelle/?rev=104&view=rev
Author: dbrosius
Date: 2008-06-28 15:27:39 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
rename to 4ByteABGR
Added Paths:
-----------
trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval4ByteABGR.java
Copied: trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval4ByteABGR.java (from rev 97, trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval3ByteABGR.java)
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval4ByteABGR.java (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEval4ByteABGR.java 2008-06-28 22:27:39 UTC (rev 104)
@@ -0,0 +1,81 @@
+/*
+ * 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
+ */
+package com.mebigfatguy.pixelle.eval;
+
+import com.mebigfatguy.pixelle.OutOfBoundsOption;
+import com.mebigfatguy.pixelle.PixelleEval;
+import com.mebigfatguy.pixelle.PixelleImage;
+
+public class PixelleEval3ByteABGR extends PixelleEval {
+
+ public PixelleEval3ByteABGR(PixelleImage srcImage, OutOfBoundsOption option) {
+ super(srcImage, option);
+ }
+
+ @Override
+ public double getTransparencyValue(int x, int y) {
+ return (double)buffer.getElem(y * width * 4 + x * 4);
+ }
+
+ @Override
+ public double getBlueValue(int x, int y) {
+ return (double)buffer.getElem(y * width * 4 + x * 4 + 1);
+ }
+
+ @Override
+ public double getGreenValue(int x, int y) {
+ return (double)buffer.getElem(y * width * 4 + x * 4 + 2);
+ }
+
+ @Override
+ public double getRedValue(int x, int y) {
+ return (double)buffer.getElem(y * width * 4 + x * 4 + 3);
+ }
+
+ public void setValue(int x, int y, char pixelSpec, double value) {
+
+ if (value < 0.0)
+ value = 0.0;
+ else if (value > 255.0)
+ value = 255.0;
+
+ switch (pixelSpec) {
+ case 't':
+ buffer.setElem(y * width * 4 + x * 4, (int)(value + 0.49));
+ break;
+
+ case 'b':
+ buffer.setElem(y * width * 4 + x * 4 + 1, (int)(value + 0.49));
+ break;
+
+ case 'g':
+ buffer.setElem(y * width * 4 + x * 4 + 2, (int)(value + 0.49));
+ break;
+
+ case 'r':
+ buffer.setElem(y * width * 4 + x * 4 + 3, (int)(value + 0.49));
+ break;
+
+ case 's':
+ setSelectionValue(x, y, value);
+ break;
+ }
+ }
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dbr...@us...> - 2008-06-28 22:12:06
|
Revision: 103
http://pixelle.svn.sourceforge.net/pixelle/?rev=103&view=rev
Author: dbrosius
Date: 2008-06-28 15:12:06 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
fix item (eyeyahyah)
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformNewWindowAction.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-06-28 21:54:18 UTC (rev 102)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-06-28 22:12:06 UTC (rev 103)
@@ -87,9 +87,11 @@
JScrollPane scroll;
ImagePanel panel = new ImagePanel();
PixelleImage image;
+ boolean doNewWindow;
public PixelleFrame() {
image = new PixelleImage();
+ doNewWindow = false;
initComponents();
initListeners();
@@ -98,6 +100,7 @@
public PixelleFrame(PixelleImage srcImage) {
image = srcImage;
+ doNewWindow = true;
initComponents();
initListeners();
@@ -175,7 +178,7 @@
optionsItem = new JMenuItem(new OptionsAction(this));
transformMenu.add(optionsItem);
transformNewWindowItem = new JCheckBoxMenuItem(new TransformNewWindowAction(this));
- transformNewWindowItem.setSelected(true);
+ transformNewWindowItem.setSelected(doNewWindow);
transformMenu.add(transformNewWindowItem);
transformMenu.addSeparator();
transformItem = new JMenuItem(new TransformAction(this));
@@ -191,6 +194,11 @@
cp.setLayout(new BorderLayout());
}
+ public void toggleNewWindowOption() {
+ doNewWindow = !doNewWindow;
+ transformNewWindowItem.setSelected(doNewWindow);
+ }
+
private void initListeners() {
addWindowListener(new WindowAdapter() {
@Override
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformNewWindowAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformNewWindowAction.java 2008-06-28 21:54:18 UTC (rev 102)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformNewWindowAction.java 2008-06-28 22:12:06 UTC (rev 103)
@@ -21,7 +21,6 @@
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
-import javax.swing.JCheckBoxMenuItem;
import com.mebigfatguy.pixelle.PixelleBundle;
import com.mebigfatguy.pixelle.PixelleFrame;
@@ -37,9 +36,6 @@
}
public void actionPerformed(ActionEvent e) {
- JCheckBoxMenuItem item = (JCheckBoxMenuItem)e.getSource();
- boolean select = !item.isSelected();
- item.setSelected(select);
+ frame.toggleNewWindowOption();
}
-
}
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:54:10
|
Revision: 102
http://pixelle.svn.sourceforge.net/pixelle/?rev=102&view=rev
Author: dbrosius
Date: 2008-06-28 14:54:18 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
scratch that
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformNewWindowAction.java
trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformNewWindowAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformNewWindowAction.java 2008-06-28 21:51:16 UTC (rev 101)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformNewWindowAction.java 2008-06-28 21:54:18 UTC (rev 102)
@@ -21,7 +21,6 @@
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
-import javax.swing.ImageIcon;
import javax.swing.JCheckBoxMenuItem;
import com.mebigfatguy.pixelle.PixelleBundle;
@@ -29,14 +28,11 @@
public class TransformNewWindowAction extends AbstractAction {
private static final long serialVersionUID = -906223935291758331L;
- private static final String CHECKBOX_UNSELECTED_URL = "/com/mebigfatguy/pixelle/resources/checkboxunselected.png";
- private static final String CHECKBOX_SELECTED_URL = "/com/mebigfatguy/pixelle/resources/checkbox_selected.png";
PixelleFrame frame;
public TransformNewWindowAction(PixelleFrame pf) {
- super(PixelleBundle.getString(PixelleBundle.TRANSFORM_NEW_ITEM),
- new ImageIcon(TransformNewWindowAction.class.getResource(CHECKBOX_SELECTED_URL)));
+ super(PixelleBundle.getString(PixelleBundle.TRANSFORM_NEW_ITEM));
frame = pf;
}
@@ -44,8 +40,6 @@
JCheckBoxMenuItem item = (JCheckBoxMenuItem)e.getSource();
boolean select = !item.isSelected();
item.setSelected(select);
- item.setIcon(new ImageIcon(select ? TransformNewWindowAction.class.getResource(CHECKBOX_SELECTED_URL)
- : TransformNewWindowAction.class.getResource(CHECKBOX_UNSELECTED_URL)));
}
}
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2008-06-28 21:51:16 UTC (rev 101)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/resources/pixelle.properties 2008-06-28 21:54:18 UTC (rev 102)
@@ -45,6 +45,7 @@
menu.transform.title = Transform
menu.transform.options = Options
+menu.transform.newwindow = Transform in new window
menu.transform.transform = Transform
formula.red = p[x,y].r
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:51:15
|
Revision: 101
http://pixelle.svn.sourceforge.net/pixelle/?rev=101&view=rev
Author: dbrosius
Date: 2008-06-28 14:51:16 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
add run target
Modified Paths:
--------------
trunk/pixelle/build.xml
Modified: trunk/pixelle/build.xml
===================================================================
--- trunk/pixelle/build.xml 2008-06-28 21:46:45 UTC (rev 100)
+++ trunk/pixelle/build.xml 2008-06-28 21:51:16 UTC (rev 101)
@@ -187,4 +187,21 @@
<param name="pixelle.version" value="${pixelle.version}-SNAPSHOT"/>
</antcall>
</target>
+
+ <target name="run">
+ <java classname="com.mebigfatguy.pixelle.Pixelle"
+ fork="true"
+ failonerror="true"
+ maxmemory="768m">
+ <classpath>
+ <pathelement location="${classes.dir}"/>
+ <pathelement location="${lib.dir}/antlr-2.7.7.jar"/>
+ <pathelement location="${lib.dir}/antlr-3.1b1.jar"/>
+ <pathelement location="${lib.dir}/antlr-runtime-3.1b1.jar"/>
+ <pathelement location="${lib.dir}/asm-3.1.jar"/>
+ <pathelement location="${lib.dir}/stringtemplate-3.1.jar"/>
+ </classpath>
+ </java>
+
+ </target>
</project>
\ 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:46:36
|
Revision: 100
http://pixelle.svn.sourceforge.net/pixelle/?rev=100&view=rev
Author: dbrosius
Date: 2008-06-28 14:46:45 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
new item
Added Paths:
-----------
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformNewWindowAction.java
Added: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformNewWindowAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformNewWindowAction.java (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformNewWindowAction.java 2008-06-28 21:46:45 UTC (rev 100)
@@ -0,0 +1,51 @@
+/*
+ * 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
+ */
+package com.mebigfatguy.pixelle.actions;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.ImageIcon;
+import javax.swing.JCheckBoxMenuItem;
+
+import com.mebigfatguy.pixelle.PixelleBundle;
+import com.mebigfatguy.pixelle.PixelleFrame;
+
+public class TransformNewWindowAction extends AbstractAction {
+ private static final long serialVersionUID = -906223935291758331L;
+ private static final String CHECKBOX_UNSELECTED_URL = "/com/mebigfatguy/pixelle/resources/checkboxunselected.png";
+ private static final String CHECKBOX_SELECTED_URL = "/com/mebigfatguy/pixelle/resources/checkbox_selected.png";
+
+ PixelleFrame frame;
+
+ public TransformNewWindowAction(PixelleFrame pf) {
+ super(PixelleBundle.getString(PixelleBundle.TRANSFORM_NEW_ITEM),
+ new ImageIcon(TransformNewWindowAction.class.getResource(CHECKBOX_SELECTED_URL)));
+ frame = pf;
+ }
+
+ public void actionPerformed(ActionEvent e) {
+ JCheckBoxMenuItem item = (JCheckBoxMenuItem)e.getSource();
+ boolean select = !item.isSelected();
+ item.setSelected(select);
+ item.setIcon(new ImageIcon(select ? TransformNewWindowAction.class.getResource(CHECKBOX_SELECTED_URL)
+ : TransformNewWindowAction.class.getResource(CHECKBOX_UNSELECTED_URL)));
+ }
+
+}
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformNewWindowAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
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:45:20
|
Revision: 99
http://pixelle.svn.sourceforge.net/pixelle/?rev=99&view=rev
Author: dbrosius
Date: 2008-06-28 14:45:21 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
add checkbox
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-06-28 21:41:26 UTC (rev 98)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-06-28 21:45:21 UTC (rev 99)
@@ -50,13 +50,14 @@
import com.mebigfatguy.pixelle.actions.SaveFileAction;
import com.mebigfatguy.pixelle.actions.SaveFileAsAction;
import com.mebigfatguy.pixelle.actions.TransformAction;
+import com.mebigfatguy.pixelle.actions.TransformNewWindowAction;
import com.mebigfatguy.pixelle.actions.ZoomAction;
import com.mebigfatguy.pixelle.utils.GuiUtils;
import com.mebigfatguy.pixelle.utils.ZoomLevel;
public class PixelleFrame extends JFrame {
- private static final long serialVersionUID = 6867461092986841877L;
-
+ private static final long serialVersionUID = 3252160042874627103L;
+
JMenu fileMenu;
JMenuItem newItem;
JMenuItem openItem;
@@ -79,6 +80,7 @@
JMenu transformMenu;
JMenuItem optionsItem;
+ JCheckBoxMenuItem transformNewWindowItem;
JMenuItem transformItem;
ResourceBundle rb = ResourceBundle.getBundle("com.mebigfatguy.pixelle.pixelle");
@@ -90,12 +92,16 @@
image = new PixelleImage();
initComponents();
initListeners();
+
setTitle(rb.getString("pixelle.title"));
}
public PixelleFrame(PixelleImage srcImage) {
- this();
image = srcImage;
+ initComponents();
+ initListeners();
+
+ setTitle(rb.getString("pixelle.title"));
Container cp = getContentPane();
cp.removeAll();
setZoom(ZoomLevel.FitToWindow);
@@ -168,6 +174,10 @@
transformMenu = new JMenu(rb.getString(PixelleBundle.TRANSFORM_MENU));
optionsItem = new JMenuItem(new OptionsAction(this));
transformMenu.add(optionsItem);
+ transformNewWindowItem = new JCheckBoxMenuItem(new TransformNewWindowAction(this));
+ transformNewWindowItem.setSelected(true);
+ transformMenu.add(transformNewWindowItem);
+ transformMenu.addSeparator();
transformItem = new JMenuItem(new TransformAction(this));
transformMenu.add(transformItem);
@@ -206,6 +216,7 @@
setZoom(ZoomLevel.FitToWindow);
scroll = new JScrollPane(panel);
cp.add(scroll, BorderLayout.CENTER);
+ transformNewWindowItem.setSelected(true);
invalidate();
validate();
repaint();
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:41:17
|
Revision: 98
http://pixelle.svn.sourceforge.net/pixelle/?rev=98&view=rev
Author: dbrosius
Date: 2008-06-28 14:41:26 -0700 (Sat, 28 Jun 2008)
Log Message:
-----------
copy png files to output dirs
Modified Paths:
--------------
trunk/pixelle/build.xml
Modified: trunk/pixelle/build.xml
===================================================================
--- trunk/pixelle/build.xml 2008-06-28 21:39:01 UTC (rev 97)
+++ trunk/pixelle/build.xml 2008-06-28 21:41:26 UTC (rev 98)
@@ -76,6 +76,7 @@
<copy todir="${classes.dir}">
<fileset dir="${src.dir}">
<include name="**/*.properties"/>
+ <include name="**/*.png"/>
</fileset>
</copy>
<copy todir="${jnlp.dir}">
@@ -109,6 +110,7 @@
<fileset dir="${classes.dir}">
<include name="**/*.class"/>
<include name="**/*.properties"/>
+ <include name="**/*.png"/>
</fileset>
<fileset dir="${basedir}">
<include name="license.txt"/>
@@ -130,6 +132,7 @@
<fileset dir="${basedir}">
<include name="**/*.java"/>
<include name="**/*.properties"/>
+ <include name="**/*.png"/>
<include name="**/*.g"/>
<include name="lib/*.jar"/>
</fileset>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|