From a76511ea194e6e54d85e48bdda077bdda47cb101 Mon Sep 17 00:00:00 2001
From: Riccardo Azzolini
-Contains the code related to chunk management for the PNGJ library.
-Only needed by client code if some special chunk handling is required.
-
-PNGJ main package
-
-Users of this library should rarely need more than the public members of this package.
-Example of use: this code reads a true colour PNG image (RGB8 or RGBA8)
-and reduces the red channel by half, increasing the green by 20.
-It copies all the "safe" metadata from the original image, and adds a textual metadata.
-
-
-Newcomers: start with PngReader and PngWriter.
-
- public static void convert(String origFilename, String destFilename) {
- // you can also use PngReader (esentially the same) or PngReaderByte
- PngReaderInt pngr = new PngReaderInt(new File(origFilename));
- System.out.println(pngr.toString());
- int channels = pngr.imgInfo.channels;
- if (channels < 3 || pngr.imgInfo.bitDepth != 8)
- throw new RuntimeException("For simplicity this supports only RGB8/RGBA8 images");
- // writer with same image properties as original
- PngWriter pngw = new PngWriter(new File(destFilename), pngr.imgInfo, true);
- // instruct the writer to grab all ancillary chunks from the original
- pngw.copyChunksFrom(pngr.getChunksList(), ChunkCopyBehaviour.COPY_ALL_SAFE);
- // add a textual chunk to writer
- pngw.getMetadata().setText(PngChunkTextVar.KEY_Description, "Decreased red and increased green");
- // also: while(pngr.hasMoreRows())
- for (int row = 0; row < pngr.imgInfo.rows; row++) {
- ImageLineInt l1 = pngr.readRowInt(); // each element is a sample
- int[] scanline = l1.getScanline(); // to save typing
- for (int j = 0; j < pngr.imgInfo.cols; j++) {
- scanline[j * channels] /= 2;
- scanline[j * channels + 1] = ImageLineHelper.clampTo_0_255(scanline[j * channels + 1] + 20);
- }
- pngw.writeRow(l1);
- }
- pngr.end(); // it's recommended to end the reader first, in case there are trailing chunks to read
- pngw.end();
- }
-
-
-
-For more examples, see the tests and samples.
-
-
-Mostly related with logic specific to reading/writing pixels. -
--Includes ImageLine related classes, and rows filtering -
--Some classes like ImageLineInt should belong here, but we keep them in the main package for backward compatibility. - -
- - diff --git a/rules/teavm/target/javadoc-bundle-options/javadoc-options-javadoc-resources.xml b/rules/teavm/target/javadoc-bundle-options/javadoc-options-javadoc-resources.xml deleted file mode 100644 index 8b89c977..00000000 --- a/rules/teavm/target/javadoc-bundle-options/javadoc-options-javadoc-resources.xml +++ /dev/null @@ -1,10 +0,0 @@ - -=p[0]){e=(p[0]-a|0)+g|0;}if((b+m|0)>=p[1]){f=(p[1]-b|0)+h|0;}if(a<0){if(n!= -1){g=g-a|0;}else{e=e+(a+1|0)|0;}a=0;}if(b<0){if(l!= -1){h=h-b|0;}else{f=f+(b+1|0)|0;}b=0;}XOb($t.c1,
-!!0);q=$t.c1;r=Erc($t.LT);s=g;t=h;k=e-g|0;u=f-h|0;v=a*$t.b1.nT|0;w=b*$t.b1.nT|0;x=(c-a|0)*$t.b1.nT|0;y=(d-b|0)*$t.b1.nT|0;q.drawImage(r,s,t,k,u,v,w,x,y);return;}}
-function U8b($t,a,b,c,d){var e,f,g,h,i,j,k;Ec_$callClinit();e=a+X3c.data[0];b=b+X3c.data[1];f=$t.c1;g=$rt_ustr($t.kZ);f.fillStyle=g;f=$t.c1;g=$t.b1;Gm_$callClinit();h=e*g.nT;i=b*$t.b1.nT;j=c*$t.b1.nT;k=d*$t.b1.nT;f.fillRect(h,i,j,k);}
-function XAc($t,a,b,c){Qhb($t,a-FGc($t.d1,c),b,c);}
-function Qhb($t,a,b,c){var d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;Ec_$callClinit();a=a+X3c.data[0];d=b+X3c.data[1];e=$t.d1;e=e.Zo;f="source-in";e.globalCompositeOperation=f;e=$t.d1.Zo;f=$rt_ustr($t.kZ);e.fillStyle=f;e=$t.d1.Zo;g=0.0;h=0.0;i=$t.d1.Kg.width;j=$t.d1.Kg.height;e.fillRect(g,h,i,j);k=YGb($t.d1,c).data;l=k.length;m=0;while(m