Package com.google.zxing.client.j2se
Class MatrixToImageWriter
java.lang.Object
com.google.zxing.client.j2se.MatrixToImageWriter
Writes a 
BitMatrix to BufferedImage,
 file or stream. Provided here instead of core since it depends on
 Java SE libraries.- Author:
- Sean Owen
- 
Method SummaryModifier and TypeMethodDescriptionstatic BufferedImagetoBufferedImage(BitMatrix matrix) Renders aBitMatrixas an image, where "false" bits are rendered as white, and "true" bits are rendered as black.static BufferedImagetoBufferedImage(BitMatrix matrix, MatrixToImageConfig config) AstoBufferedImage(BitMatrix), but allows customization of the output.static voidwriteToFile(BitMatrix matrix, String format, File file) Deprecated.static voidwriteToFile(BitMatrix matrix, String format, File file, MatrixToImageConfig config) Deprecated.static voidwriteToPath(BitMatrix matrix, String format, Path file) Writes aBitMatrixto a file with default configuration.static voidwriteToPath(BitMatrix matrix, String format, Path file, MatrixToImageConfig config) AswriteToPath(BitMatrix, String, Path), but allows customization of the output.static voidwriteToStream(BitMatrix matrix, String format, OutputStream stream) Writes aBitMatrixto a stream with default configuration.static voidwriteToStream(BitMatrix matrix, String format, OutputStream stream, MatrixToImageConfig config) AswriteToStream(BitMatrix, String, OutputStream), but allows customization of the output.
- 
Method Details- 
toBufferedImageRenders aBitMatrixas an image, where "false" bits are rendered as white, and "true" bits are rendered as black. Uses default configuration.- Parameters:
- matrix-- BitMatrixto write
- Returns:
- BufferedImagerepresentation of the input
 
- 
toBufferedImageAstoBufferedImage(BitMatrix), but allows customization of the output.- Parameters:
- matrix-- BitMatrixto write
- config- output configuration
- Returns:
- BufferedImagerepresentation of the input
 
- 
writeToFile@Deprecated public static void writeToFile(BitMatrix matrix, String format, File file) throws IOException Deprecated.- Parameters:
- matrix-- BitMatrixto write
- format- image format
- file- file- Fileto write image to
- Throws:
- IOException- if writes to the file fail
 
- 
writeToPathWrites aBitMatrixto a file with default configuration.- Parameters:
- matrix-- BitMatrixto write
- format- image format
- file- file- Pathto write image to
- Throws:
- IOException- if writes to the stream fail
- See Also:
 
- 
writeToFile@Deprecated public static void writeToFile(BitMatrix matrix, String format, File file, MatrixToImageConfig config) throws IOException Deprecated.- Parameters:
- matrix-- BitMatrixto write
- format- image format
- file- file- Fileto write image to
- config- output configuration
- Throws:
- IOException- if writes to the file fail
 
- 
writeToPathpublic static void writeToPath(BitMatrix matrix, String format, Path file, MatrixToImageConfig config) throws IOException AswriteToPath(BitMatrix, String, Path), but allows customization of the output.- Parameters:
- matrix-- BitMatrixto write
- format- image format
- file- file- Pathto write image to
- config- output configuration
- Throws:
- IOException- if writes to the file fail
 
- 
writeToStreampublic static void writeToStream(BitMatrix matrix, String format, OutputStream stream) throws IOException Writes aBitMatrixto a stream with default configuration.- Parameters:
- matrix-- BitMatrixto write
- format- image format
- stream-- OutputStreamto write image to
- Throws:
- IOException- if writes to the stream fail
- See Also:
 
- 
writeToStreampublic static void writeToStream(BitMatrix matrix, String format, OutputStream stream, MatrixToImageConfig config) throws IOException AswriteToStream(BitMatrix, String, OutputStream), but allows customization of the output.- Parameters:
- matrix-- BitMatrixto write
- format- image format
- stream-- OutputStreamto write image to
- config- output configuration
- Throws:
- IOException- if writes to the stream fail
 
 
- 
writeToPath(BitMatrix, String, Path)