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 | Description |
---|---|---|
private Integer |
destBits |
Number of significant bits per channel in the destination RGB image.
|
Constructor | Description |
---|---|
ReduceRGB() |
Modifier and Type | Method | 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addProgressListener, addProgressListeners, getAbort, removeProgressListener, setAbort, setProgress, setProgress
private 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 15IllegalArgumentException
- if bits is smaller than 1 or larger than 15