1 package org.newdawn.slick.opengl; 2 3 import javax.annotation.Nullable; 4 import java.io.IOException; 5 import java.io.InputStream; 6 import java.nio.ByteBuffer; 7 8 /** 9 * An image data source that can load images from a stream 10 * 11 * @author kevin 12 */ 13 public interface LoadableImageData extends ImageData { 14 /** 15 * Configure the edging that can be used to make texture edges 16 * loop more cleanly 17 * 18 * @param edging True if we should edge 19 */ 20 public void configureEdging(boolean edging); 21 22 /** 23 * Load a image from the specified stream 24 * 25 * @param fis The stream from which we'll load the TGA 26 * @throws IOException Indicates a failure to read the TGA 27 * @return The byte buffer containing texture data 28 */ 29 public ByteBuffer loadImage(InputStream fis) throws IOException; 30 31 /** 32 * Load a image from the specified stream 33 * 34 * @param fis The stream from which we'll load the TGA 35 * @param flipped True if we loading in flipped mode (used for cursors) 36 * @param transparent The colour to interpret as transparent or null if none 37 * @return The byte buffer containing texture data 38 * @throws IOException Indicates a failure to read the TGA 39 */ 40 public ByteBuffer loadImage(InputStream fis, boolean flipped, @Nullable int[] transparent) 41 throws IOException; 42 43 /** 44 * Load a image from the specified stream 45 * 46 * @param fis The stream from which we'll load the TGA 47 * @param flipped True if we loading in flipped mode (used for cursors) 48 * @param forceAlpha Force the output to have an alpha channel 49 * @param transparent The colour to interpret as transparent or null if none 50 * @return The byte buffer containing texture data 51 * @throws IOException Indicates a failure to read the TGA 52 */ 53 public ByteBuffer loadImage(InputStream fis, boolean flipped, boolean forceAlpha, @Nullable int[] transparent) 54 throws IOException; 55 }