Package net.sourceforge.jiu.apps

# Class ColorIndexer

java.lang.Object
net.sourceforge.jiu.ops.Operation
net.sourceforge.jiu.ops.BatchProcessorOperation
net.sourceforge.jiu.apps.ColorIndexer

public class ColorIndexer extends BatchProcessorOperation
Loads image files and generates color index information for them.

Since:
  0.12.0
Author:
  Marco Schmidt

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`BLACK`
`static final int`
`BLUE`
`static final String[]`
`COLOR_NAMES`
`private int`
`contrastChange`
`static final int`
`CYAN`
`private NumberFormat`
`formatter`
`static final int`
`GREEN`
`static final int`
`MAGENTA`
`private int`
`maxLength`
`static final int`
`RED`
`static final int`
`WHITE`
`static final int`
`YELLOW`

## Constructor Summary

Constructors
Constructor
Description
`ColorIndexer()`

## Method Summary

Modifier and Type
Method
Description
`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, setCollectErrorMessages, setOutputDirectory, setOverwrite`

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

`addProgressListener, addProgressListeners, getAbort, removeProgressListener, setAbort, setProgress, setProgress`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### maxLength

private int maxLength

### contrastChange

private int contrastChange

### formatter

private NumberFormat formatter

### BLACK

public static final int BLACK

See Also:
  - Constant Field Values

### RED

public static final int RED

See Also:
  - Constant Field Values

### GREEN

public static final int GREEN

See Also:
  - Constant Field Values

### BLUE

public static final int BLUE

See Also:
  - Constant Field Values

### YELLOW

public static final int YELLOW

See Also:
  - Constant Field Values

### MAGENTA

public static final int MAGENTA

See Also:
  - Constant Field Values

### CYAN

public static final int CYAN

See Also:
  - Constant Field Values

### WHITE

public static final int WHITE

See Also:
  - Constant Field Values

### COLOR_NAMES

public static final String[] COLOR_NAMES

## Constructor Details

### ColorIndexer

public ColorIndexer()

## Method Details

### main

public static void main(String[] args)

### convertToRgb24

private PixelImage convertToRgb24(PixelImage in)

### adjustColor

private PixelImage adjustColor(PixelImage img)

### scale

private PixelImage scale(PixelImage in)

### count

private int[] count(PixelImage image)

### store

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

### processFile

public void processFile(String inputDirectory, String inputFileName, String outputDirectory)
Description copied from class: `BatchProcessorOperation`
Method to be called on each file given to this operation. Non-abstract heirs of this class must implement this method to add functionality.

Specified by:
  `processFile` in class `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