[Pixelle-commit] SF.net SVN: pixelle: [134] trunk/pixelle/src/com/mebigfatguy/pixelle
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2008-07-04 18:48:31
|
Revision: 134
http://pixelle.svn.sourceforge.net/pixelle/?rev=134&view=rev
Author: dbrosius
Date: 2008-07-04 11:48:31 -0700 (Fri, 04 Jul 2008)
Log Message:
-----------
add support for IntRGB
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java
Added Paths:
-----------
trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalIntRGB.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java 2008-07-04 18:45:51 UTC (rev 133)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleEvalFactory.java 2008-07-04 18:48:31 UTC (rev 134)
@@ -24,6 +24,7 @@
import com.mebigfatguy.pixelle.eval.PixelleEval4ByteABGR;
import com.mebigfatguy.pixelle.eval.PixelleEvalByteGray;
import com.mebigfatguy.pixelle.eval.PixelleEvalIntARGB;
+import com.mebigfatguy.pixelle.eval.PixelleEvalIntRGB;
/**
* factory for creating pixel evaluation instances based on the type of image that is
@@ -85,6 +86,7 @@
break;
case BufferedImage.TYPE_INT_RGB:
+ return new PixelleEvalIntRGB(image, ioobOption, coobOption);
break;
}
Added: trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalIntRGB.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalIntRGB.java (rev 0)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalIntRGB.java 2008-07-04 18:48:31 UTC (rev 134)
@@ -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.eval;
+
+import com.mebigfatguy.pixelle.ColorOutOfBoundsOption;
+import com.mebigfatguy.pixelle.IndexOutOfBoundsOption;
+import com.mebigfatguy.pixelle.PixelleEval;
+import com.mebigfatguy.pixelle.PixelleImage;
+
+public class PixelleEvalIntRGB extends PixelleEval {
+
+ public PixelleEvalIntRGB(PixelleImage srcImage, IndexOutOfBoundsOption iOption, ColorOutOfBoundsOption cOption) {
+ super(srcImage, iOption, cOption);
+ }
+
+ @Override
+ public double getTransparencyValue(int x, int y) {
+ return 255.0;
+ }
+
+ @Override
+ public double getBlueValue(int x, int y) {
+ return (double)(buffer.getElem(y * width + x) & 0x00FF);
+ }
+
+ @Override
+ public double getGreenValue(int x, int y) {
+ return (double)((buffer.getElem(y * width + x) >> 8) & 0x00FF);
+ }
+
+ @Override
+ public double getRedValue(int x, int y) {
+ return (double)((buffer.getElem(y * width + x) >> 16) & 0x00FF);
+ }
+}
Property changes on: trunk/pixelle/src/com/mebigfatguy/pixelle/eval/PixelleEvalIntRGB.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.
|