com.google.zxing.client.j2se
Class MatrixToImageWriter

java.lang.Object
  extended by com.google.zxing.client.j2se.MatrixToImageWriter

public final class MatrixToImageWriter
extends Object

Writes a BitMatrix to BufferedImage, file or stream. Provided here instead of core since it depends on Java SE libraries.

Author:
Sean Owen

Method Summary
static BufferedImage toBufferedImage(BitMatrix matrix)
          Renders a BitMatrix as an image, where "false" bits are rendered as white, and "true" bits are rendered as black.
static void writeToFile(BitMatrix matrix, String format, File file)
          Writes a BitMatrix to a file.
static void writeToStream(BitMatrix matrix, String format, OutputStream stream)
          Writes a BitMatrix to a stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toBufferedImage

public static BufferedImage toBufferedImage(BitMatrix matrix)
Renders a BitMatrix as an image, where "false" bits are rendered as white, and "true" bits are rendered as black.


writeToFile

public static void writeToFile(BitMatrix matrix,
                               String format,
                               File file)
                        throws IOException
Writes a BitMatrix to a file.

Throws:
IOException
See Also:
toBufferedImage(BitMatrix)

writeToStream

public static void writeToStream(BitMatrix matrix,
                                 String format,
                                 OutputStream stream)
                          throws IOException
Writes a BitMatrix to a stream.

Throws:
IOException
See Also:
toBufferedImage(BitMatrix)


Copyright © 2011. All Rights Reserved.