[Pixelle-commit] SF.net SVN: pixelle:[236] trunk/pixelle/src/com/mebigfatguy/pixelle
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2009-02-16 08:57:22
|
Revision: 236
http://pixelle.svn.sourceforge.net/pixelle/?rev=236&view=rev
Author: dbrosius
Date: 2009-02-16 08:57:19 +0000 (Mon, 16 Feb 2009)
Log Message:
-----------
push PixelleImage[] src down to the transform action
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2009-02-16 08:55:57 UTC (rev 235)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2009-02-16 08:57:19 UTC (rev 236)
@@ -103,7 +103,7 @@
boolean doNewWindow;
public PixelleFrame() throws PixelleTransformException {
- this(new PixelleTransformer(new PixelleImage(), PixelleTransformer.getSampleTransform(), ImageType.RGB, new Point(400, 400)).transform(), false);
+ this(new PixelleTransformer(new PixelleImage[] {new PixelleImage()}, PixelleTransformer.getSampleTransform(), ImageType.RGB, new Point(400, 400)).transform(), false);
}
public PixelleFrame(PixelleImage srcImage) {
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2009-02-16 08:55:57 UTC (rev 235)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2009-02-16 08:57:19 UTC (rev 236)
@@ -42,7 +42,7 @@
*/
public class PixelleTransformer {
- private final PixelleImage srcImage;
+ private final PixelleImage[] srcImages;
private Map<PixelleComponent, String> algorithms = null;
private final ImageType outputImageType;
private final Point dimension;
@@ -53,8 +53,8 @@
* @param algos the algorithms for the color components
* @param newDimension the desired dimension of the output image
*/
- public PixelleTransformer(PixelleImage image, Map<PixelleComponent, String> algos, ImageType imageType, Point newDimension) {
- srcImage = image;
+ public PixelleTransformer(PixelleImage[] images, Map<PixelleComponent, String> algos, ImageType imageType, Point newDimension) {
+ srcImages = images;
algorithms = algos;
outputImageType = imageType;
dimension = newDimension;
@@ -99,10 +99,12 @@
destImage = new PixelleImage(new BufferedImage(dimension.x, dimension.y, BufferedImage.TYPE_BYTE_GRAY));
destPE = new PixelleEvalByteGray(destImage, PixelleEvalFactory.getIndexOutOfBoundsOption(), PixelleEvalFactory.getColorOutOfBoundsOption());
}
- PixelleEval srcPE = PixelleEvalFactory.create(srcImage);
- PixelleEval[] sources = new PixelleEval[1];
- sources[0] = srcPE;
+ PixelleEval[] sourceEvals = new PixelleEval[srcImages.length];
+ for (int i = 0; i < srcImages.length; i++) {
+ PixelleEval srcPE = PixelleEvalFactory.create(srcImages[i]);
+ sourceEvals[i] = srcPE;
+ }
PixelleClassLoader pcl = AccessController.doPrivileged(new PrivilegedAction<PixelleClassLoader>() {
public PixelleClassLoader run() {
@@ -138,7 +140,7 @@
char pixelSpec = entry.getKey().getPixelSpec();
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
- double value = expr.eval(sources, x, y);
+ double value = expr.eval(sourceEvals, x, y);
destPE.setValue(x, y, pixelSpec, value);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|