java/copy-image-resizer/src/cz/frantovo/copyImageResizer/SingleImageResizer.java
author František Kučera <franta-hg@frantovo.cz>
Mon, 17 Nov 2014 21:59:20 +0100
changeset 17 505031965440
parent 15 93fa6ce675e5
permissions -rw-r--r--
preparation for later support of NativeSingleImageResizer
franta-hg@6
     1
/**
franta-hg@6
     2
 * copy-image-resizer
franta-hg@6
     3
 * Copyright © 2014 František Kučera (frantovo.cz)
franta-hg@6
     4
 *
franta-hg@6
     5
 * This program is free software: you can redistribute it and/or modify
franta-hg@6
     6
 * it under the terms of the GNU General Public License as published by
franta-hg@6
     7
 * the Free Software Foundation, either version 3 of the License, or
franta-hg@6
     8
 * (at your option) any later version.
franta-hg@6
     9
 *
franta-hg@6
    10
 * This program is distributed in the hope that it will be useful,
franta-hg@6
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
franta-hg@6
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
franta-hg@6
    13
 * GNU General Public License for more details.
franta-hg@6
    14
 *
franta-hg@6
    15
 * You should have received a copy of the GNU General Public License
franta-hg@6
    16
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
franta-hg@6
    17
 */
franta-hg@6
    18
package cz.frantovo.copyImageResizer;
franta-hg@6
    19
franta-hg@15
    20
import java.io.InputStream;
franta-hg@6
    21
import java.io.OutputStream;
franta-hg@6
    22
franta-hg@6
    23
/**
franta-hg@6
    24
 *
franta-hg@6
    25
 * @author Ing. František Kučera (frantovo.cz)
franta-hg@6
    26
 */
franta-hg@17
    27
public interface SingleImageResizer {
franta-hg@7
    28
franta-hg@15
    29
	/**
franta-hg@15
    30
	 *
franta-hg@15
    31
	 * @param input
franta-hg@15
    32
	 * @param output
franta-hg@15
    33
	 * @param size
franta-hg@15
    34
	 * @param outputFormat
franta-hg@15
    35
	 * @return whether image was resized → if false, you should just copy the image after calling
franta-hg@15
    36
	 * this method. Image is resized if larger than requested size or if {@linkplain SizeSpecification#isResizeSmaller()
franta-hg@15
    37
	 * }.
franta-hg@15
    38
	 * @throws ResizeException
franta-hg@15
    39
	 */
franta-hg@17
    40
	public boolean resize(InputStream input, OutputStream output, SizeSpecification size, JavaSingleImageResizer.ImageFormat outputFormat) throws ResizeException;
franta-hg@6
    41
}