Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/sixlegs/image/png/BitMover16RGB.java


1   // Copyright (C) 1998, 1999, 2001 Chris Nokleberg
2   // Please see included LICENSE.TXT
3   
4   package com.sixlegs.image.png;
5   
6   import java.io.IOException;
7   import java.io.InputStream;
8   
9   final class BitMover16RGB
10  extends BitMover
11  {
12      int fill(int[] pixels, InputStream str, int off, int len)
13      throws IOException
14      {
15          for (int n = 0; n < len; n++) {
16              int rhi = str.read();
17              int rlo = str.read();
18              int ghi = str.read();
19              int glo = str.read();
20              int bhi = str.read();
21              int blo = str.read();
22              int chkhi = rhi << 16 | ghi << 8 | bhi;
23              int chklo = rlo << 16 | glo << 8 | blo;
24              int val = gammaTable[rhi] << 16 | gammaTable[ghi] << 8 | gammaTable[bhi];
25              pixels[off++] = (trans == chkhi && translow == chklo ? 0 : 0xFF000000) | val;
26          }
27          return off;
28      }
29  }