public class ReduceRGB extends ImageToImageOperation
RGB24Image
and RGB48Image
.
PixelImage inputImage = ...; // initialize ReduceRGB reduce = new ReduceRGB(); reduce.setBitsPerSample(5); reduce.setInputImage(inputImage); reduce.process(); PixelImage reducedImage = reduce.getOutputImage();
ReduceShadesOfGray
Modifier and Type | Field and Description |
---|---|
private java.lang.Integer |
destBits
Number of significant bits per channel in the destination RGB image.
|
Constructor and Description |
---|
ReduceRGB() |
Modifier and Type | Method and Description |
---|---|
void |
process()
This method does the actual work of the operation.
|
void |
setBitsPerSample(int bits)
Specifies the number of bits per sample in the output image.
|
canInputAndOutputBeEqual, ensureImagesHaveSameResolution, ensureInputImageIsAvailable, ensureOutputImageResolution, getInputImage, getOutputImage, setCanInputAndOutputBeEqual, setInputImage, setOutputImage
addProgressListener, addProgressListeners, getAbort, removeProgressListener, setAbort, setProgress, setProgress
private java.lang.Integer destBits
public void process() throws MissingParameterException, WrongParameterException
Operation
process
in class Operation
MissingParameterException
- if any mandatory parameter was not given to the operationWrongParameterException
- if at least one of the input parameters was
not initialized appropriately (values out of the valid interval, etc.)public void setBitsPerSample(int bits)
bits
- number of bits in output image, from 1 to 15java.lang.IllegalArgumentException
- if bits is smaller than 1 or larger than 15