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 int
BLACK
static int
BLUE
static String[]
COLOR_NAMES
private int
contrastChange
static int
CYAN
private NumberFormat
formatter
static int
GREEN
static int
MAGENTA
private int
maxLength
static int
RED
static int
WHITE
static int
YELLOW
-
Constructor Summary
Constructors Constructor Description ColorIndexer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods 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
-
-
-
-
Field Detail
-
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
-
-
Method Detail
-
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 classBatchProcessorOperation
- Parameters:
inputDirectory
- name of directory where the file to be processed residesinputFileName
- name of file to be processedoutputDirectory
- output directory for that file, need not necessarily be used
-
-