net.sourceforge.jiu.apps

Class ColorIndexer


public class ColorIndexer
extends net.sourceforge.jiu.ops.BatchProcessorOperation

Loads image files and generates color index information for them.
Author:
Marco Schmidt
Since:
0.12.0

Field Summary

static int
BLACK
static int
BLUE
static String[]
COLOR_NAMES
static int
CYAN
static int
GREEN
static int
MAGENTA
static int
RED
static int
WHITE
static int
YELLOW
private int
contrastChange
private NumberFormat
formatter
private int
maxLength

Fields inherited from class net.sourceforge.jiu.ops.BatchProcessorOperation

collectErrors, directoryTrees, errorMessages, inputFileNames, outputDirectory, overwrite

Fields inherited from class net.sourceforge.jiu.ops.Operation

abort, progressListeners

Method Summary

private PixelImage
adjustColor(PixelImage img)
private PixelImage
convertToRgb24(PixelImage in)
private int[]
count(PixelImage image)
static void
main(String[] args)
void
processFile(String inputDirectory, String inputFileName, String outputDirectory)
Method to be called on each file given to this operation.
private PixelImage
scale(PixelImage in)
private void
store(String name, int[] occ)

Methods inherited from class net.sourceforge.jiu.ops.BatchProcessorOperation

addDirectoryTree, addDirectoryTree, addInputFileName, addInputFileNames, getErrorMessages, getOverwrite, process, processDirectoryTree, processFile, setCollectErrorMessages, setOutputDirectory, setOverwrite

Methods inherited from class net.sourceforge.jiu.ops.Operation

addProgressListener, addProgressListeners, getAbort, process, removeProgressListener, setAbort, setProgress, setProgress

Field Details

BLACK

public static final int BLACK
Field Value:
0

BLUE

public static final int BLUE
Field Value:
1

COLOR_NAMES

public static final String[] COLOR_NAMES

CYAN

public static final int CYAN
Field Value:
3

GREEN

public static final int GREEN
Field Value:
2

MAGENTA

public static final int MAGENTA
Field Value:
5

RED

public static final int RED
Field Value:
4

WHITE

public static final int WHITE
Field Value:
7

YELLOW

public static final int YELLOW
Field Value:
6

contrastChange

private int contrastChange

formatter

private NumberFormat formatter

maxLength

private int maxLength

Method Details

adjustColor

private PixelImage adjustColor(PixelImage img)

convertToRgb24

private PixelImage convertToRgb24(PixelImage in)

count

private int[] count(PixelImage image)

main

public static void main(String[] args)

processFile

public void processFile(String inputDirectory,
                        String inputFileName,
                        String outputDirectory)
Method to be called on each file given to this operation. Non-abstract heirs of this class must implement this method to add functionality.
Overrides:
processFile in interface net.sourceforge.jiu.ops.BatchProcessorOperation
Parameters:
inputDirectory - name of directory where the file to be processed resides
inputFileName - name of file to be processed
outputDirectory - output directory for that file, need not necessarily be used

scale

private PixelImage scale(PixelImage in)

store

private void store(String name,
                   int[] occ)