Search in sources :

Example 6 with ImageInfo

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;
}
Also used : ImageInfo(ar.com.hjg.pngj.ImageInfo)

Aggregations

ImageInfo (ar.com.hjg.pngj.ImageInfo)6 PngWriter (ar.com.hjg.pngj.PngWriter)5 ImageLineInt (ar.com.hjg.pngj.ImageLineInt)4 PngChunkPLTE (ar.com.hjg.pngj.chunks.PngChunkPLTE)3 PngChunkTRNS (ar.com.hjg.pngj.chunks.PngChunkTRNS)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)3 ChunksListForWrite (ar.com.hjg.pngj.chunks.ChunksListForWrite)1 PngChunkTEXT (ar.com.hjg.pngj.chunks.PngChunkTEXT)1 PngMetadata (ar.com.hjg.pngj.chunks.PngMetadata)1 ColorModel (java.awt.image.ColorModel)1 IndexColorModel (java.awt.image.IndexColorModel)1 RenderedImage (java.awt.image.RenderedImage)1 Date (java.util.Date)1 Entry (java.util.Map.Entry)1 CacheControl (javax.ws.rs.core.CacheControl)1 WTWD (org.opentripplanner.analyst.request.SampleGridRenderer.WTWD)1 SampleGridRequest (org.opentripplanner.analyst.request.SampleGridRequest)1 ZSamplePoint (org.opentripplanner.common.geometry.ZSampleGrid.ZSamplePoint)1 GenericLocation (org.opentripplanner.common.model.GenericLocation)1 RoutingRequest (org.opentripplanner.routing.core.RoutingRequest)1