use of org.polymap.core.data.image.ImageEncodeProcessor in project polymap4-core by Polymap4.
the class ImageGrayscaleProcessor method eop.
@Consumes({ EndOfProcessing.class })
@Produces({ EndOfProcessing.class })
public void eop(ProcessorResponse r, ProcessorContext context) throws Exception {
ByteArrayOutputStream buf = (ByteArrayOutputStream) context.get("buf");
if (buf != null) {
Image image = Toolkit.getDefaultToolkit().createImage(buf.toByteArray());
Image gray = grayscale(image);
ImageEncodeProcessor encodeProcessor = new ImageEncodeProcessor();
encodeProcessor.encodeImageResponse(new ImageResponse(gray), context);
} else {
context.sendResponse(r);
}
}
use of org.polymap.core.data.image.ImageEncodeProcessor in project polymap4-core by Polymap4.
the class ProcessorSignatureTest method testImageEncodeCompatibelFeatureRender.
@Test
public void testImageEncodeCompatibelFeatureRender() throws Exception {
ImageEncodeProcessor proc1 = new ImageEncodeProcessor();
FeatureRenderProcessor2 proc2 = new FeatureRenderProcessor2();
ProcessorSignature sig1 = new ProcessorSignature(proc1.getClass());
ProcessorSignature sig2 = new ProcessorSignature(proc2.getClass());
// log.info( "ImageEncode:\n" + sig1 );
// log.info( "FeatureRender:\n" + sig2 );
assertTrue(sig1.isCompatible(sig2));
}
Aggregations