aboutsummaryrefslogtreecommitdiffstats
path: root/theme-compiler/ivymodule
Commit message (Collapse)AuthorAgeFilesLines
* Updated to custom build of Smartsprites 0.2.10 which includes a fix for ↵Artur Signell2013-05-291-38/+0
| | | | | | SMARTSPRITES-36 (#9959) Change-Id: Ibf549acba14a8b884424a5e2c98f3a4aac5de84c
* Updated commons-io dependency to 2.2 (#11643)Artur Signell2013-04-231-1/+1
| | | | Change-Id: Ia134929a67328e2a759028b2ee5b64206dc78883
* Same version of commons-lang in SmartSprites and elsewhere (#9970)Henri Sara2012-12-101-1/+1
| | | | | | This should eliminate some duplicate JAR(s) in the Vaadin package. Change-Id: I0b984fde1fa3ae23139a62fd829e1d1560761abc
* Created separate build.xml files for each module (#9299)Artur Signell2012-09-091-0/+38
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
/*
 * Copyright 1999-2004 The Apache Software Foundation.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* $Id$ */
 
package org.apache.fop.pdf;

import java.io.OutputStream; 
import java.io.IOException;

/**
 * PDF Filter class.
 * This represents a PDF filter object.
 * Filter implementations should extend this class.
 *
 * @author Eric SCHAEFFER, Kelly A. Campbell
 */
public abstract class PDFFilter {
    /*
     * These are no longer needed, but are here as a reminder about what
     * filters pdf supports.
     * public static final int ASCII_HEX_DECODE = 1;
     * public static final int ASCII_85_DECODE = 2;
     * public static final int LZW_DECODE = 3;
     * public static final int RUN_LENGTH_DECODE = 4;
     * public static final int CCITT_FAX_DECODE = 5;
     * public static final int DCT_DECODE = 6;
     * public static final int FLATE_DECODE = 7;
     */

    /**
     * Marker to know if this filter has already been applied to the data
     */
    private boolean applied = false;

    /**
     * Check if this filter has been applied.
     *
     * @return true if this filter has been applied
     */
    public boolean isApplied() {
        return applied;
    }

    /**
     * Set the applied attribute to the given value. This attribute is
     * used to determine if this filter is just a placeholder for the
     * decodeparms and dictionary entries, or if the filter needs to
     * actually encode the data. For example if the raw data is copied
     * out of an image file in it's compressed format, then this
     * should be set to true and the filter options should be set to
     * those which the raw data was encoded with.
     *
     * @param b set the applied value to this
     */
    public void setApplied(boolean b) {
        applied = b;
    }

    /**
     * return a PDF string representation of the filter, e.g. /FlateDecode
     *
     * @return the filter PDF name
     */
    public abstract String getName();

    /**
     * Returns true if the filter is an ASCII filter that isn't necessary
     * when encryption is active.
     * @return boolean True if this filter is an ASCII filter
     */
    public boolean isASCIIFilter() {
        return false;
    }

    /**
     * return a parameter dictionary for this filter, or null
     *
     * @return the decode params for the filter
     */
    public abstract String getDecodeParms();

    /**
     * Applies a filter to an OutputStream.
     * @param out contents to be filtered
     * @return OutputStream filtered contents
     * @throws IOException In case of an I/O problem
     */
    public abstract OutputStream applyFilter(OutputStream out) throws IOException;

}