1mlib_ImageColorOrderedDithemreMdxiNa(L3iMbLILBi)brarmyliFbu_nIcmtaigoenCsolorOrderedDitherMxN(3MLIB)
2
3
4
6 mlib_ImageColorOrderedDitherMxN - true-color to indexed-color or
7 grayscale to black-white conversion, using ordered dithering
8
10 cc [ flag... ] file... -lmlib [ library... ]
11 #include <mlib.h>
12
13 mlib_status mlib_ImageColorOrderedDitherMxN(mlib_image *dst,
14 const mlib_image *src, const mlib_s32 **dmask, mlib_s32 m,
15 mlib_s32 n, mlib_s32 scale, const void *colormap);
16
17
19 The mlib_ImageColorOrderedDitherMxN() function converts a 3-channel
20 image to a 1-channel indexed image, or converts a 1-channel grayscale
21 image to a 1-channel MLIB_BIT image, with the method of ordered dither‐
22 ing.
23
24
25 The src can be an MLIB_BYTE image with 1 or 3 channels. The dst must be
26 a 1-channel MLIB_BIT or MLIB_BYTE image.
27
28
29 The colormap must be created by mlib_ImageColorDitherInit(), and it
30 must have a colorcube included.
31
32
33 The dither masks are required to have the following property:
34
35 0 ≤ dmask[i][j] < 2**scale; scale > 0
36
37
39 The function takes the following arguments:
40
41 dst Pointer to destination image.
42
43
44 src Pointer to source image.
45
46
47 dmask Pointer to the dither masks, one per channel, in row major
48 order.
49
50
51 m Mask width. m > 1.
52
53
54 n Mask height. n > 1.
55
56
57 scale Scaling factor for dmask to convert the input integer coef‐
58 ficients into floating-point coefficients:
59
60 floating-point coefficient = integer coefficient * \
61 2**(-scale)
62
63
64
65 colormap Internal data structure for image dithering.
66
67
69 The function returns MLIB_SUCCESS if successful. Otherwise it returns
70 MLIB_FAILURE.
71
73 See attributes(5) for descriptions of the following attributes:
74
75
76
77
78 ┌─────────────────────────────┬─────────────────────────────┐
79 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
80 ├─────────────────────────────┼─────────────────────────────┤
81 │Interface Stability │Committed │
82 ├─────────────────────────────┼─────────────────────────────┤
83 │MT-Level │MT-Safe │
84 └─────────────────────────────┴─────────────────────────────┘
85
87 mlib_ImageColorDitherInit(3MLIB), mlib_ImageColorDitherFree(3MLIB),
88 mlib_ImageColorErrorDiffusion3x3(3MLIB), mlib_ImageColorErrorDiffusion‐
89 MxN(3MLIB), mlib_ImageColorOrderedDither8x8(3MLIB), attributes(5)
90
91
92
93SunOS 5.11 2 Mar 2m0l0i7b_ImageColorOrderedDitherMxN(3MLIB)