final class DecodeWorker
extends java.lang.Object
implements java.util.concurrent.Callable<java.lang.Integer>
CommandLineRunner
Modifier and Type | Field and Description |
---|---|
private static int |
BLACK |
private DecoderConfig |
config |
private java.util.Map<DecodeHintType,?> |
hints |
private java.util.Queue<java.net.URI> |
inputs |
private static int |
RED |
private static int |
WHITE |
Constructor and Description |
---|
DecodeWorker(DecoderConfig config,
java.util.Queue<java.net.URI> inputs) |
Modifier and Type | Method and Description |
---|---|
private static java.nio.file.Path |
buildOutputPath(java.net.URI input,
java.lang.String suffix) |
java.lang.Integer |
call() |
private Result[] |
decode(java.net.URI uri,
java.util.Map<DecodeHintType,?> hints) |
private static void |
dumpBlackPoint(java.net.URI uri,
java.awt.image.BufferedImage image,
BinaryBitmap bitmap)
Writes out a single PNG which is three times the width of the input image, containing from left
to right: the original image, the row sampling monochrome version, and the 2D sampling
monochrome version.
|
private static void |
dumpResult(java.net.URI input,
Result... results) |
private static void |
writeResultImage(int stride,
int height,
int[] pixels,
java.net.URI input,
java.lang.String suffix) |
private static final int RED
private static final int BLACK
private static final int WHITE
private final DecoderConfig config
private final java.util.Queue<java.net.URI> inputs
private final java.util.Map<DecodeHintType,?> hints
DecodeWorker(DecoderConfig config, java.util.Queue<java.net.URI> inputs)
public java.lang.Integer call() throws java.io.IOException
call
in interface java.util.concurrent.Callable<java.lang.Integer>
java.io.IOException
private static java.nio.file.Path buildOutputPath(java.net.URI input, java.lang.String suffix) throws java.io.IOException
java.io.IOException
private static void dumpResult(java.net.URI input, Result... results) throws java.io.IOException
java.io.IOException
private Result[] decode(java.net.URI uri, java.util.Map<DecodeHintType,?> hints) throws java.io.IOException
java.io.IOException
private static void dumpBlackPoint(java.net.URI uri, java.awt.image.BufferedImage image, BinaryBitmap bitmap) throws java.io.IOException
java.io.IOException
private static void writeResultImage(int stride, int height, int[] pixels, java.net.URI input, java.lang.String suffix) throws java.io.IOException
java.io.IOException