throws FormatException, IOException checkParams(no, buf, x, y, w, h); MetadataRetrieve meta = getMetadataRetrieve(); int sizeX = meta.getPixelsSizeX(series).getValue().intValue(); int nChannels = getSamplesPerPixel(); initialized[series][no] = true; writeHeader(); if (!isFullPlane(x, y, w, h)) {
private void writeHeader() throws IOException { MetadataRetrieve r = getMetadataRetrieve(); int width = r.getPixelsSizeX(series).getValue().intValue(); int height = r.getPixelsSizeY(series).getValue().intValue(); int nChannels = getSamplesPerPixel(); out.writeBytes("%!PS-Adobe-2.0 EPSF-1.2\n"); out.writeBytes("%%Title: " + currentId + "\n"); out.writeBytes("%%Creator: " + FormatTools.CREATOR + "\n"); out.writeBytes("%%Pages: 1\n"); out.writeBytes("%%BoundingBox: 0 0 " + width + " " + height + "\n"); out.writeBytes("%%EndComments\n\n"); out.writeBytes("/ld {load def} bind def\n"); out.writeBytes("/s /stroke ld /f /fill ld /m /moveto ld /l " + "/lineto ld /c /curveto ld /rgb {255 div 3 1 roll 255 div 3 1 " + "roll 255 div 3 1 roll setrgbcolor} def\n"); out.writeBytes("0 0 translate\n"); out.writeBytes(((float) width) + " " + ((float) height) + " scale\n"); out.writeBytes("/picstr 40 string def\n"); out.writeBytes(width + " " + height + " 8 [" + width + " 0 0 " + (-1 * height) + " 0 " + height + "] {currentfile picstr readhexstring pop} "); if (nChannels == 1) { out.writeBytes("image\n"); } else { out.writeBytes("false 3 colorimage\n"); } planeOffset = out.getFilePointer(); }
private void writeHeader() throws IOException { MetadataRetrieve r = getMetadataRetrieve(); int width = r.getPixelsSizeX(series).getValue().intValue(); int height = r.getPixelsSizeY(series).getValue().intValue(); int nChannels = getSamplesPerPixel(); out.writeBytes("%!PS-Adobe-2.0 EPSF-1.2\n"); out.writeBytes("%%Title: " + currentId + "\n"); out.writeBytes("%%Creator: " + FormatTools.CREATOR + "\n"); out.writeBytes("%%Pages: 1\n"); out.writeBytes("%%BoundingBox: 0 0 " + width + " " + height + "\n"); out.writeBytes("%%EndComments\n\n"); out.writeBytes("/ld {load def} bind def\n"); out.writeBytes("/s /stroke ld /f /fill ld /m /moveto ld /l " + "/lineto ld /c /curveto ld /rgb {255 div 3 1 roll 255 div 3 1 " + "roll 255 div 3 1 roll setrgbcolor} def\n"); out.writeBytes("0 0 translate\n"); out.writeBytes(((float) width) + " " + ((float) height) + " scale\n"); out.writeBytes("/picstr 40 string def\n"); out.writeBytes(width + " " + height + " 8 [" + width + " 0 0 " + (-1 * height) + " 0 " + height + "] {currentfile picstr readhexstring pop} "); if (nChannels == 1) { out.writeBytes("image\n"); } else { out.writeBytes("false 3 colorimage\n"); } planeOffset = out.getFilePointer(); }
throws FormatException, IOException checkParams(no, buf, x, y, w, h); MetadataRetrieve meta = getMetadataRetrieve(); int sizeX = meta.getPixelsSizeX(series).getValue().intValue(); int nChannels = getSamplesPerPixel(); initialized[series][no] = true; writeHeader(); if (!isFullPlane(x, y, w, h)) {