JIU 0.12.0 Homepage

net.sourceforge.jiu.color.reduction
Class ReduceRGB

java.lang.Object
  extended bynet.sourceforge.jiu.ops.Operation
      extended bynet.sourceforge.jiu.ops.ImageToImageOperation
          extended bynet.sourceforge.jiu.color.reduction.ReduceRGB

public class ReduceRGB
extends ImageToImageOperation

Reduces the color depth of RGB truecolor images. This class uses a simple approach, it just drops some of the lowest bits and scales the value back to eight or sixteen bits per sample.

Supported image classes

This class works with RGB24Image and RGB48Image.

Usage example

Reduce a 24 bits per pixel RGB image to 15 bits per pixel:
 RGB24Image inputImage = ...; // initialize
 ReduceRGB reduce = new ReduceRGB();
 reduce.setBits(5);
 reduce.setInputImage(inputImage);
 reduce.process();
 PixelImage reducedImage = reduce.getOutputImage();
 

Since:
0.12.0
Author:
Marco Schmidt
See Also:
ReduceShadesOfGray

Constructor Summary
ReduceRGB()
           
 
Method Summary
 void process()
          This method does the actual work of the operation.
 void setBits(int bits)
          Specifies the number of bits the output image is supposed to have.
 
Methods inherited from class net.sourceforge.jiu.ops.ImageToImageOperation
canInputAndOutputBeEqual, ensureImagesHaveSameResolution, ensureInputImageIsAvailable, ensureOutputImageResolution, getInputImage, getOutputImage, setCanInputAndOutputBeEqual, setInputImage, setOutputImage
 
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
 

Constructor Detail

ReduceRGB

public ReduceRGB()
Method Detail

process

public void process()
             throws MissingParameterException,
                    WrongParameterException
Description copied from class: Operation
This method does the actual work of the operation. It must be called after all parameters have been given to the operation object.

Overrides:
process in class Operation
Throws:
MissingParameterException - if any mandatory parameter was not given to the operation
WrongParameterException - if at least one of the input parameters was not initialized appropriately (values out of the valid interval, etc.)

setBits

public void setBits(int bits)
Specifies the number of bits the output image is supposed to have.

Parameters:
bits - number of bits in output image, from 1 to 15
Throws:
IllegalArgumentException - if bits is smaller than 1 or larger than 15

JIU 0.12.0 Homepage

Copyright © 2000, 2001, 2002, 2003, 2004 Marco Schmidt