[Pixelle-commit] SF.net SVN: pixelle:[219] trunk/pixelle/src/com/mebigfatguy/pixelle
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2008-11-22 03:55:36
|
Revision: 219
http://pixelle.svn.sourceforge.net/pixelle/?rev=219&view=rev
Author: dbrosius
Date: 2008-11-22 03:55:26 +0000 (Sat, 22 Nov 2008)
Log Message:
-----------
respect output size from transform dialog
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-11-22 01:59:03 UTC (rev 218)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleFrame.java 2008-11-22 03:55:26 UTC (rev 219)
@@ -103,7 +103,7 @@
boolean doNewWindow;
public PixelleFrame() throws PixelleTransformException {
- this(new PixelleTransformer(new PixelleImage(), PixelleTransformer.getSampleTransform(), ImageType.RGB).transform(), false);
+ this(new PixelleTransformer(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 2008-11-22 01:59:03 UTC (rev 218)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-11-22 03:55:26 UTC (rev 219)
@@ -18,6 +18,7 @@
*/
package com.mebigfatguy.pixelle;
+import java.awt.Point;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
@@ -44,16 +45,19 @@
private final PixelleImage srcImage;
private Map<PixelleComponent, String> algorithms = null;
private final ImageType outputImageType;
+ private final Point dimension;
/**
* constructions a transformer given a source bitmap and algorithms
* @param image the source image
* @param algos the algorithms for the color components
+ * @param newDimension TODO
*/
- public PixelleTransformer(PixelleImage image, Map<PixelleComponent, String> algos, ImageType imageType) {
+ public PixelleTransformer(PixelleImage image, Map<PixelleComponent, String> algos, ImageType imageType, Point newDimension) {
srcImage = image;
algorithms = algos;
outputImageType = imageType;
+ dimension = newDimension;
}
/**
@@ -85,15 +89,14 @@
String currentAlgorithm = "";
try {
- /** eventually allow for gui to set width/height */
PixelleImage destImage;
PixelleEval destPE;
if (outputImageType == ImageType.RGB) {
- destImage = new PixelleImage(new BufferedImage(srcImage.getWidth(), srcImage.getHeight(), BufferedImage.TYPE_4BYTE_ABGR));
+ destImage = new PixelleImage(new BufferedImage(dimension.x, dimension.y, BufferedImage.TYPE_4BYTE_ABGR));
destPE = new PixelleEval4ByteABGR(destImage, PixelleEvalFactory.getIndexOutOfBoundsOption(), PixelleEvalFactory.getColorOutOfBoundsOption());
} else {
- destImage = new PixelleImage(new BufferedImage(srcImage.getWidth(), srcImage.getHeight(), BufferedImage.TYPE_BYTE_GRAY));
+ 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);
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java 2008-11-22 01:59:03 UTC (rev 218)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/TransformAction.java 2008-11-22 03:55:26 UTC (rev 219)
@@ -52,7 +52,7 @@
d.setVisible(true);
if (d.isOK()) {
ImageType imageType = d.getImageType();
- PixelleTransformer transformer = new PixelleTransformer(frame.getImage(), d.getAlgorithms(imageType), imageType);
+ PixelleTransformer transformer = new PixelleTransformer(frame.getImage(), d.getAlgorithms(imageType), imageType, d.getOutputSize());
PixelleImage dstImage = transformer.transform();
if (dstImage != null) {
if (frame.createNewWindow()) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|