001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.commons.imaging;
018
019import org.apache.commons.imaging.common.BufferedImageFactory;
020
021/**
022 * Imaging parameters.
023 *
024 * <p>Contains parameters that are common to all formats. Implementations must include
025 * the specific parameters for each image format.</p>
026 *
027 * @since 1.0-alpha3
028 */
029public class ImagingParameters {
030
031    /**
032     * Whether to throw an exception when any issue occurs during reading
033     * or writing a file format. Default is {@code false}.
034     */
035    private boolean strict = false;
036
037    /**
038     * An optional file name, used for the description of input streams
039     * where a file name would be hard (or not possible) to be identified.
040     * Default is {@code null}.
041     */
042    private String fileName = null;
043
044    /**
045     * Factory to create {@code BufferedImage}s. Default is {@code null}.
046     */
047    private BufferedImageFactory bufferedImageFactory = null;
048
049    /**
050     * <p>Parameter key. Used in write operations to indicate the desired pixel
051     * density (DPI), and/or aspect ratio.</p>
052     */
053    private PixelDensity pixelDensity;
054
055    // getters and setters
056
057    public boolean isStrict() {
058        return strict;
059    }
060
061    public void setStrict(boolean strict) {
062        this.strict = strict;
063    }
064
065    public String getFileName() {
066        return fileName;
067    }
068
069    public void setFileName(String fileName) {
070        this.fileName = fileName;
071    }
072
073    public BufferedImageFactory getBufferedImageFactory() {
074        return bufferedImageFactory;
075    }
076
077    public void setBufferedImageFactory(BufferedImageFactory bufferedImageFactory) {
078        this.bufferedImageFactory = bufferedImageFactory;
079    }
080
081    public PixelDensity getPixelDensity() {
082        return pixelDensity;
083    }
084
085    public void setPixelDensity(PixelDensity pixelDensity) {
086        this.pixelDensity = pixelDensity;
087    }
088}