001    /*
002     * Apache License
003     * Version 2.0, January 2004
004     * http://www.apache.org/licenses/
005     *
006     * Copyright 2008 by chenillekit.org
007     *
008     * Licensed under the Apache License, Version 2.0 (the "License");
009     * you may not use this file except in compliance with the License.
010     * You may obtain a copy of the License at
011     *
012     * http://www.apache.org/licenses/LICENSE-2.0
013     */
014    
015    package org.chenillekit.image.services;
016    
017    import java.awt.image.BufferedImage;
018    import java.io.OutputStream;
019    
020    import org.apache.tapestry5.ioc.Resource;
021    
022    /**
023     * some image based helpers.
024     *
025     * @version $Id: ImageService.java 594 2009-12-05 15:17:26Z mlusetti $
026     */
027    public interface ImageService
028    {
029        /**
030         * reduce the quality of an image.
031         *
032         * @param image   the original image
033         * @param quality quality
034         * @param output  data stream of the quality reduced image
035         */
036        void reduceImageQuality(BufferedImage image, float quality, OutputStream output);
037    
038        /**
039         * scale image object to a new size.
040         *
041         * @param imageResource image resource to scale
042         * @param height        scale to height
043         *
044         * @return scaled image
045         */
046        BufferedImage scaleImage(Resource imageResource, int height);
047    }