use of ar.com.hjg.pngj.ImageInfo in project imageio-ext by geosolutions-it.
the class PNGWriter method getImageInfo.
private ImageInfo getImageInfo(RenderedImage image, ScanlineProvider scanlines, ColorModel colorModel, boolean indexed) {
int numColorComponents = colorModel.getNumColorComponents();
boolean grayscale = !indexed && numColorComponents < 3;
byte bitDepth = scanlines.getBitDepth();
boolean hasAlpha = !indexed && colorModel.hasAlpha();
ImageInfo ii = new ImageInfo(image.getWidth(), image.getHeight(), bitDepth, hasAlpha, grayscale, indexed);
return ii;
}
Aggregations