JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / bin / javajs / img / Jpg64Encoder.js
1 Clazz.declarePackage ("javajs.img");\r
2 Clazz.load (["javajs.img.JpgEncoder"], "javajs.img.Jpg64Encoder", ["javajs.util.Base64"], function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.outTemp = null;\r
5 Clazz.instantialize (this, arguments);\r
6 }, javajs.img, "Jpg64Encoder", javajs.img.JpgEncoder);\r
7 Clazz.defineMethod (c$, "setParams", \r
8 function (params) {\r
9 this.defaultQuality = 75;\r
10 this.outTemp = params.remove ("outputChannelTemp");\r
11 Clazz.superCall (this, javajs.img.Jpg64Encoder, "setParams", [params]);\r
12 }, "java.util.Map");\r
13 Clazz.defineMethod (c$, "generate", \r
14 function () {\r
15 var out0 = this.out;\r
16 this.out = this.outTemp;\r
17 Clazz.superCall (this, javajs.img.Jpg64Encoder, "generate", []);\r
18 var bytes = javajs.util.Base64.getBytes64 (this.out.toByteArray ());\r
19 this.outTemp = null;\r
20 this.out = out0;\r
21 this.out.write (bytes, 0, bytes.length);\r
22 });\r
23 });\r