CVS: jfor/src/org/jfor/jfor/tools/jpeg/encoder JpegEncoder.java,NONE,1.1

Bertrand Delacretaz <[email protected]> Thu, 17 Jul 2003 07:43:57 -0700
Newsgroups gmane.text.xml.jfor.cvs
Message-ID <[email protected]>
Update of /cvsroot/jfor/jfor/src/org/jfor/jfor/tools/jpeg/encoder
In directory sc8-pr-cvs1:/tmp/cvs-serv17385/src/org/jfor/jfor/tools/jpeg/encoder

Added Files:
	JpegEncoder.java 
Log Message:
V0.7.2dev-i - jpeg encoder refactored, encoder license files added

--- NEW FILE: JpegEncoder.java ---
package org.jfor.jfor.tools.jpeg.encoder;

// Version 1.0a
// Copyright (C) 1998, James R. Weeks and BioElectroMech.
// Visit BioElectroMech at www.obrador.com.  Email [email protected].

// This is version 1.0a.  This version corrected the dirty edges of images whose
// dimensions were not mutliples of 8.

// See license.txt for details about the allowed used of this software.
// This software is based in part on the work of the Independent JPEG Group.
// See IJGreadme.txt for details about the Independent JPEG Group's license.
//
// Licenses of all external software used by jfor can be found in the directory
// named "legal" of the jfor CVS, the files in question are:
//      LICENSE.jpeg.encoder.txt
// and
//      LICENSE.ijg.jpeg.txt
//
[...1290 lines suppressed...]
        int inrow, incol;
        int outrow, outcol;
        float output[][];
        int temp;
        int bias;
        inrow = 0;
        incol = 0;
        output = new float[compHeight[comp]][compWidth[comp]];
        for (outrow = 0; outrow < compHeight[comp]; outrow++) {
            bias = 1;
            for (outcol = 0; outcol < compWidth[comp]; outcol++) {
                output[outrow][outcol] = (C[inrow][incol++] + C[inrow++][incol--] + C[inrow][incol++] + C[inrow--][incol++] + (float) bias) / (float) 4.0;
                bias ^= 3;
            }
            inrow += 2;
            incol = 0;
        }
        return output;
    }
}



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0