Source code: com/sixlegs/image/png/BitMover1G.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 BitMover1G
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 x = str.read();
17 for (int i = 7; i >= 0; i--) {
18 int p1 = (x >>> i & 1);
19 pixels[off++] = (p1 == transgray ? 0 : 0xFF000000) | gammaTable[p1];
20 }
21 }
22 return off;
23 }
24 }