dbf-udg

view src/dither_matrix.h @ 12:1abbed71e9c9

cleanup, copyright statements and notices, readme files
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 20 Feb 2013 05:45:27 +0200
parents 403ec1be3a1a
children
line source
1 /* dither matrices taken directly from:
2 * http://caca.zoy.org/wiki/libcaca/study/2
3 */
4 #ifndef DITHER_MATRIX_H_
5 #define DITHER_MATRIX_H_
7 static const float dither_matrix2[2][2] = {
8 {0, 3}, {2, 1}
9 };
11 static const float dither_matrix4[4][4] = {
12 {0, 12, 3, 15},
13 {8, 4, 11, 7},
14 {2, 14, 1, 13},
15 {10, 6, 9, 5}
16 };
18 static const float dither_matrix8[8][8] = {
19 {0, 48, 12, 60, 3, 51, 15, 63},
20 {32, 16, 44, 28, 35, 19, 47, 31},
21 {8, 56, 4, 52, 11, 59, 7, 55},
22 {40, 24, 36, 20, 43, 27, 39, 23},
23 {2, 50, 14, 62, 1, 49, 13, 61},
24 {34, 18, 46, 30, 33, 17, 45, 29},
25 {10, 58, 6, 54, 9, 57, 5, 53},
26 {42, 26, 38, 22, 41, 25, 37, 21}
27 };
29 static const float halftone_matrix8[8][8] = {
30 {24, 10, 12, 26, 35, 47, 49, 37},
31 {8, 0, 2, 14, 45, 59, 61, 51},
32 {22, 6, 4, 16, 43, 57, 63, 53},
33 {30, 20, 18, 28, 33, 41, 55, 39},
34 {34, 46, 48, 36, 25, 11, 13, 27},
35 {44, 58, 60, 50, 9, 1, 3, 15},
36 {42, 56, 62, 52, 23, 7, 5, 17},
37 {32, 40, 54, 38, 31, 21, 19, 29}
38 };
40 #endif /* DITHER_MATRIX_H_ */