From 44ca154c4527e6c9e903cab220986fcf5c800a9e Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Thu, 27 Mar 2003 10:50:54 +0000 Subject: [PATCH] Image implementation can now indicate if it is DCT encoded (JPEGs). Image implementation just outputs its raw content to an OutputStream. Filtering is done by the XObject. Image implementation can now indicate which filter set to use (for encoding optimizations like for JPEGs) git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196162 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/pdf/PDFImage.java | 25 +++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/java/org/apache/fop/pdf/PDFImage.java b/src/java/org/apache/fop/pdf/PDFImage.java index b5afc2197..2c1bee189 100644 --- a/src/java/org/apache/fop/pdf/PDFImage.java +++ b/src/java/org/apache/fop/pdf/PDFImage.java @@ -51,6 +51,7 @@ package org.apache.fop.pdf; import java.io.IOException; +import java.io.OutputStream; /** * Interface for a PDF image. @@ -68,9 +69,11 @@ public interface PDFImage { /** * Setup the PDF image for the current document. - * Some image formats may need to access the document. + * Some image formats may need to access the document (for example to + * add an ICC profile to the document). * * @param doc the PDF parent document + * @todo Remove this and deletgate to the XObject */ void setup(PDFDocument doc); @@ -110,6 +113,13 @@ public interface PDFImage { */ boolean isPS(); + /** + * Check if this image is a DCT encoded image (for JPEG images). + * + * @return true if this is a DCT image + */ + boolean isDCT(); + /** * Check if this image has a transparent color transparency. * @@ -141,12 +151,12 @@ public interface PDFImage { // get the image bytes, and bytes properties /** - * Get the data stream containing the image contents. + * Writes the raw, unencoded contents of the image to a given output stream. * + * @param out OutputStream to write to * @throws IOException if there creating stream - * @return the PDFStream containing the image data */ - PDFStream getDataStream() throws IOException; + void outputContents(OutputStream out) throws IOException; /** * Get the ICC stream for this image. @@ -155,5 +165,12 @@ public interface PDFImage { */ PDFICCStream getICCStream(); + /** + * Returns a hint in form of a String (Possible values from PDFFilterList) + * indicating which filter setup should be used to encode the object. + * @return the filter setup hint + */ + String getFilterHint(); + } -- 2.39.5