aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop
diff options
context:
space:
mode:
authorAdrian Cumiskey <acumiskey@apache.org>2008-06-04 14:27:42 +0000
committerAdrian Cumiskey <acumiskey@apache.org>2008-06-04 14:27:42 +0000
commit9a5c592c3adc9e66d3681f4cb63664eab9b83ea7 (patch)
treef23f8225038fea6cf3fb27a09b92adceb63335f8 /src/java/org/apache/fop
parenta812cf1529e6bce8cdca92674f9baf3b8d8934d1 (diff)
downloadxmlgraphics-fop-9a5c592c3adc9e66d3681f4cb63664eab9b83ea7.tar.gz
xmlgraphics-fop-9a5c592c3adc9e66d3681f4cb63664eab9b83ea7.zip
Unused.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@663121 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop')
-rw-r--r--src/java/org/apache/fop/render/afp/modca/AbstractResourceGroupContainer.java64
1 files changed, 0 insertions, 64 deletions
diff --git a/src/java/org/apache/fop/render/afp/modca/AbstractResourceGroupContainer.java b/src/java/org/apache/fop/render/afp/modca/AbstractResourceGroupContainer.java
index b8c1b10c1..71cc4698b 100644
--- a/src/java/org/apache/fop/render/afp/modca/AbstractResourceGroupContainer.java
+++ b/src/java/org/apache/fop/render/afp/modca/AbstractResourceGroupContainer.java
@@ -101,70 +101,6 @@ public abstract class AbstractResourceGroupContainer extends AbstractPageObject
}
return resourceGroup;
}
-
- /**
- * Converts a byte array containing 24 bit RGB image data to a grayscale
- * image.
- *
- * @param io
- * the target image object
- * @param raw
- * the buffer containing the RGB image data
- * @param width
- * the width of the image in pixels
- * @param height
- * the height of the image in pixels
- * @param bitsPerPixel
- * the number of bits to use per pixel
- *
- * TODO: move this method somewhere appropriate in commons
- */
- private static void convertToGrayScaleImage(ImageObject io, byte[] raw, int width,
- int height, int bitsPerPixel) {
- int pixelsPerByte = 8 / bitsPerPixel;
- int bytewidth = (width / pixelsPerByte);
- if ((width % pixelsPerByte) != 0) {
- bytewidth++;
- }
- byte[] bw = new byte[height * bytewidth];
- byte ib;
- for (int y = 0; y < height; y++) {
- ib = 0;
- int i = 3 * y * width;
- for (int x = 0; x < width; x++, i += 3) {
-
- // see http://www.jguru.com/faq/view.jsp?EID=221919
- double greyVal = 0.212671d * ((int) raw[i] & 0xff) + 0.715160d
- * ((int) raw[i + 1] & 0xff) + 0.072169d
- * ((int) raw[i + 2] & 0xff);
- switch (bitsPerPixel) {
- case 1:
- if (greyVal < 128) {
- ib |= (byte) (1 << (7 - (x % 8)));
- }
- break;
- case 4:
- greyVal /= 16;
- ib |= (byte) ((byte) greyVal << ((1 - (x % 2)) * 4));
- break;
- case 8:
- ib = (byte) greyVal;
- break;
- default:
- throw new UnsupportedOperationException(
- "Unsupported bits per pixel: " + bitsPerPixel);
- }
-
- if ((x % pixelsPerByte) == (pixelsPerByte - 1)
- || ((x + 1) == width)) {
- bw[(y * bytewidth) + (x / pixelsPerByte)] = ib;
- ib = 0;
- }
- }
- }
- io.setImageIDESize((byte) bitsPerPixel);
- io.setImageData(bw);
- }
/**
* Creates and returns a new data object