@Override public BufferedImage getImage() { if (!open) { throw new RuntimeException("Cannot get image from closed device"); } // TODO scale to dimension if not equal return ImageUtilities.createBufferedImageForDisplay(capture.getNextFrame()); }
/** * Reads an {@link MBFImage} from the given file. * * @param input * The file to read the {@link MBFImage} from. * @return An {@link MBFImage} * @throws IOException * if the file cannot be read */ public static MBFImage readMBF(final File input) throws IOException { return ImageUtilities.createMBFImage(ExtendedImageIO.read(input), false); }
/** * Reads an {@link FImage} from the given input stream. * * @param input * The input stream to read the {@link FImage} from. * @return An {@link FImage} * @throws IOException * if the stream cannot be read */ public static FImage readF(final InputStream input) throws IOException { return ImageUtilities.createFImage(ExtendedImageIO.read(input)); }
/** * Convenience method to create an RGB {@link MBFImage} from an * {@link FImage} by cloning the {@link FImage} for each of the R, G and B * bands. * * @param image * the {@link FImage} to convert * @return the new RGB {@link MBFImage} */ public static MBFImage createRGB(final FImage image) { return new MBFImage(image.clone(), image.clone(), image.clone()); }
@Override public int[] toPackedARGBPixels() { final MBFImage mbf = createMBFImage(); return mbf.toPackedARGBPixels(); }
@Override public byte[] toByteImage() { final MBFImage mbf = createMBFImage(); return mbf.toByteImage(); }
/** * Reads an {@link MBFImage} from the given input stream. * * @param input * The input stream to read the {@link MBFImage} from. * @return An {@link MBFImage} * @throws IOException * if the stream cannot be read */ public static MBFImage readMBF(final InputStream input) throws IOException { return ImageUtilities.createMBFImage(ExtendedImageIO.read(input), false); }
@Override public int[] toPackedARGBPixels() { final MBFImage mbf = createMBFImage(); return mbf.toPackedARGBPixels(); }
/** * Reads an {@link FImage} from the given URL. * * @param input * The URL to read the {@link FImage} from. * @return An {@link FImage} * @throws IOException * if the URL stream cannot be read */ public static FImage readF(final URL input) throws IOException { return ImageUtilities.createFImage(ExtendedImageIO.read(input)); }
/** * Convenience method to create an RGB {@link MBFImage} from an * {@link FImage} by cloning the {@link FImage} for each of the R, G and B * bands. * * @param image * the {@link FImage} to convert * @return the new RGB {@link MBFImage} */ public static MBFImage createRGB(final FImage image) { return new MBFImage(image.clone(), image.clone(), image.clone()); }
/** * Reads an {@link MBFImage} from the given input stream. * * @param input * The input stream to read the {@link MBFImage} from. * @return An {@link MBFImage} * @throws IOException * if the stream cannot be read */ public static MBFImage readMBF(final InputStream input) throws IOException { return ImageUtilities.createMBFImage(ExtendedImageIO.read(input), false); }
/** * Reads an {@link FImage} from the given input stream. * * @param input * The input stream to read the {@link FImage} from. * @return An {@link FImage} * @throws IOException * if the stream cannot be read */ public static FImage readF(final InputStream input) throws IOException { return ImageUtilities.createFImage(ExtendedImageIO.read(input)); }
/** * Reads an {@link MBFImage} from the given URL. * * @param input * The URL to read the {@link MBFImage} from. * @return An {@link MBFImage} * @throws IOException * if the URL stream cannot be read */ public static MBFImage readMBF(final URL input) throws IOException { return ImageUtilities.createMBFImage(ExtendedImageIO.read(input), false); }
/** * Reads an {@link FImage} from the given file. * * @param input * The file to read the {@link FImage} from. * @return An {@link FImage} * @throws IOException * if the file cannot be read */ public static FImage readF(final File input) throws IOException { return ImageUtilities.createFImage(ExtendedImageIO.read(input)); }
/** * Reads an {@link MBFImage} from the given file. * * @param input * The file to read the {@link MBFImage} from. * @return An {@link MBFImage} * @throws IOException * if the file cannot be read */ public static MBFImage readMBF(final File input) throws IOException { return ImageUtilities.createMBFImage(ExtendedImageIO.read(input), false); }
/** * Reads an {@link FImage} from the given file. * * @param input * The file to read the {@link FImage} from. * @return An {@link FImage} * @throws IOException * if the file cannot be read */ public static FImage readF(final File input) throws IOException { return ImageUtilities.createFImage(ExtendedImageIO.read(input)); }
/** * Reads an {@link MBFImage} from the given URL. * * @param input * The URL to read the {@link MBFImage} from. * @return An {@link MBFImage} * @throws IOException * if the URL stream cannot be read */ public static MBFImage readMBF(final URL input) throws IOException { return ImageUtilities.createMBFImage(ExtendedImageIO.read(input), false); }
/** * Reads an {@link FImage} from the given URL. * * @param input * The URL to read the {@link FImage} from. * @return An {@link FImage} * @throws IOException * if the URL stream cannot be read */ public static FImage readF(final URL input) throws IOException { return ImageUtilities.createFImage(ExtendedImageIO.read(input)); }