2 // Copyright (C) 1998, James R. Weeks and BioElectroMech.
3 // Visit BioElectroMech at www.obrador.com. Email James@obrador.com.
5 // See license.txt for details about the allowed used of this software.
6 // This software is based in part on the work of the Independent JPEG Group.
7 // See IJGreadme.txt for details about the Independent JPEG Group's license.
9 // This encoder is inspired by the Java Jpeg encoder by Florian Raemy,
10 // studwww.eurecom.fr/~raemy.
11 // It borrows a great deal of code and structure from the Independent
12 // Jpeg Group's Jpeg 6a library, Copyright Thomas G. Lane.
13 // See license.txt for details
16 * JpegEncoder and its associated classes are Copyright (c) 1998, James R. Weeks and BioElectroMech
17 * see(Jmol/src/com/obrador/license.txt)
19 * javajs.img.JpegEncoder.java was adapted by Bob Hanson
20 * for Jmol in the following ways:
22 * 1) minor coding efficiencies were made in some for() loops.
23 * 2) methods not used by Jmol were commented out
24 * 3) method and variable signatures were modified to provide
25 * more appropriate method privacy.
26 * 4) additions for Java2Script compatibility
28 * Original files are maintained in the Jmol.src.com.obrador package, but
29 * these original files are not distributed with Jmol.
35 import java.io.IOException;
38 import javajs.util.Base64;
39 import javajs.util.OC;
42 public class Jpg64Encoder extends JpgEncoder {
47 protected void setParams(Map<String, Object> params) {
49 outTemp = (OC) params.remove("outputChannelTemp");
50 super.setParams(params);
54 protected void generate() throws IOException {
58 byte[] bytes = Base64.getBytes64(out.toByteArray());
61 out.write(bytes, 0, bytes.length);