Package ar.com.hjg.pngj

Examples of ar.com.hjg.pngj.ImageInfo


    private ImageInfo imgInfo;
    private PngWriter writer;
   
    public PNGWriter(File outputFile, int cols, int rows) {
      imgInfo = new ImageInfo(cols, rows, 8, false);
      writer = new PngWriter(outputFile, imgInfo, true);
     
      PngMetadata metaData = writer.getMetadata();
      metaData.setTimeNow();
      metaData.setText(PngChunkTextVar.KEY_Software, "OSM2World");
View Full Code Here


    check();
    boolean alpha = (getColormodel() & 0x04) != 0;
    boolean palette = (getColormodel() & 0x01) != 0;
    boolean grayscale = (getColormodel() == 0 || getColormodel() == 4);
    // creates ImgInfo and imgLine, and allocates buffers
    return new ImageInfo(getCols(), getRows(), getBitspc(), alpha, grayscale, palette);
  }
View Full Code Here

        int rows = sampleGrid.getYMax() - sampleGrid.getYMin() + 1;
        int channels = 4; // Hard-coded to RGBA

        // We force to 8 bits channel depth, some clients won't support more than 8
        // (namely, HTML5 canvas...)
        ImageInfo imgInfo = new ImageInfo(cols, rows, 8, true, false, false);
        /**
         * TODO: PNGJ allow for progressive (ie line-by-line) writing. Thus we could theorically
         * prevent having to allocate a bit pixel array in the first place, but we would need a
         * line-by-line iterator on the sample grid, which is currently not the case.
         */
 
View Full Code Here

    check();
    boolean alpha = (getColormodel() & 0x04) != 0;
    boolean palette = (getColormodel() & 0x01) != 0;
    boolean grayscale = (getColormodel() == 0 || getColormodel() == 4);
    // creates ImgInfo and imgLine, and allocates buffers
    return new ImageInfo(getCols(), getRows(), getBitspc(), alpha, grayscale, palette);
  }
View Full Code Here

TOP

Related Classes of ar.com.hjg.pngj.ImageInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.