Source code: com/sixlegs/image/png/Adam7Interlacer.java
1 // Copyright (C) 1998, 1999, 2001 Chris Nokleberg
2 // Please see included LICENSE.TXT
3
4 package com.sixlegs.image.png;
5
6 final class Adam7Interlacer
7 extends Interlacer
8 {
9 static final int[] init = { 0, 0, 4, 0, 2, 0, 1, 0 };
10 static final int[] sp = { 8, 8, 8, 4, 4, 2, 2, 1 };
11
12 Adam7Interlacer(int w, int h)
13 {
14 super(w, h);
15 }
16
17 final int numPasses ()
18 {
19 return 7;
20 }
21
22 final int getSpacingX(int pass)
23 {
24 return sp[pass+1];
25 }
26
27 final int getSpacingY(int pass)
28 {
29 return sp[pass];
30 }
31
32 final int getOffsetX(int pass)
33 {
34 return init[pass+1];
35 }
36
37 final int getOffsetY(int pass)
38 {
39 return init[pass];
40 }
41 }