| 1 | |
package org.webslinger.ext.image; |
| 2 | |
|
| 3 | |
import java.awt.Rectangle; |
| 4 | |
import java.io.IOException; |
| 5 | |
|
| 6 | |
public abstract class AbstractConstantSizingTransformerFactory extends AbstractSizingTransformerFactory { |
| 7 | |
private final Rectangle size; |
| 8 | |
|
| 9 | 0 | public AbstractConstantSizingTransformerFactory(Rectangle size) { |
| 10 | 0 | this.size = size; |
| 11 | 0 | } |
| 12 | |
|
| 13 | |
public AbstractConstantSizingTransformerFactory(int width, int height) { |
| 14 | 0 | this(new Rectangle(0, 0, width, height)); |
| 15 | 0 | } |
| 16 | |
|
| 17 | |
protected Rectangle getSize(ImageDescriptor image) throws IOException { |
| 18 | 0 | return size; |
| 19 | |
} |
| 20 | |
} |