dbf-udg

annotate src/dither_matrix.h @ 6:57ea4988a9f2

added code to dump the ditherblock image
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 18 Feb 2013 04:41:26 +0200
parents 2d27bfd21fc5
children 1abbed71e9c9
rev   line source
nuclear@0 1 #ifndef DITHER_MATRIX_H_
nuclear@0 2 #define DITHER_MATRIX_H_
nuclear@0 3
nuclear@0 4 static const float dither_matrix2[2][2] = {
nuclear@0 5 {0, 3}, {2, 1}
nuclear@0 6 };
nuclear@0 7
nuclear@0 8 static const float dither_matrix4[4][4] = {
nuclear@0 9 {0, 12, 3, 15},
nuclear@0 10 {8, 4, 11, 7},
nuclear@0 11 {2, 14, 1, 13},
nuclear@0 12 {10, 6, 9, 5}
nuclear@0 13 };
nuclear@0 14
nuclear@0 15 static const float dither_matrix8[8][8] = {
nuclear@0 16 {0, 48, 12, 60, 3, 51, 15, 63},
nuclear@0 17 {32, 16, 44, 28, 35, 19, 47, 31},
nuclear@0 18 {8, 56, 4, 52, 11, 59, 7, 55},
nuclear@0 19 {40, 24, 36, 20, 43, 27, 39, 23},
nuclear@0 20 {2, 50, 14, 62, 1, 49, 13, 61},
nuclear@0 21 {34, 18, 46, 30, 33, 17, 45, 29},
nuclear@0 22 {10, 58, 6, 54, 9, 57, 5, 53},
nuclear@0 23 {42, 26, 38, 22, 41, 25, 37, 21}
nuclear@0 24 };
nuclear@0 25
nuclear@3 26 static const float halftone_matrix8[8][8] = {
nuclear@3 27 {24, 10, 12, 26, 35, 47, 49, 37},
nuclear@3 28 {8, 0, 2, 14, 45, 59, 61, 51},
nuclear@3 29 {22, 6, 4, 16, 43, 57, 63, 53},
nuclear@3 30 {30, 20, 18, 28, 33, 41, 55, 39},
nuclear@3 31 {34, 46, 48, 36, 25, 11, 13, 27},
nuclear@3 32 {44, 58, 60, 50, 9, 1, 3, 15},
nuclear@3 33 {42, 56, 62, 52, 23, 7, 5, 17},
nuclear@3 34 {32, 40, 54, 38, 31, 21, 19, 29}
nuclear@3 35 };
nuclear@3 36
nuclear@0 37 #endif /* DITHER_MATRIX_H_ */