1mlib_ImageInvert(3MLIB) mediaLib Library Functions mlib_ImageInvert(3MLIB)
2
3
4
6 mlib_ImageInvert - invert
7
9 cc [ flag... ] file... -lmlib [ library... ]
10 #include <mlib.h>
11
12 mlib_status mlib_ImageInvert(mlib_image *dst, const mlib_image *src);
13
14
16 The mlib_ImageInvert() function performs the inversion of an image such
17 that white becomes black, light gray becomes dark gray, and so on.
18
19
20 It uses the following equation:
21
22 dst[x][y][i] = (Gwhite + Gblack) - src[x][y][i]
23
24
25
26 The values of Gwhite and Gblack for different types of images are:
27
28
29
30
31 Image Type Gwhite Gblack Gwhite + Gblack
32 ──────────────────────────────────────────────────────────────────
33 MLIB_BYTE 255 0 255 (0xFF)
34 MLIB_SHORT 32767 -32768 -1 (0xFFFF)
35 ──────────────────────────────────────────────────────────────────
36 MLIB_USHORT 65535 0 65535 (0xFFFF)
37 ──────────────────────────────────────────────────────────────────
38 MLIB_INT 2147483647 -2147483648 -1 (0xFFFFFFFF)
39
40
41
42 Given that integer data are in the two's complement representation,
43 mlib_ImageInvert() is the same as mlib_ImageNot(), while mlib_ImageIn‐
44 vert_Inp() is the same as mlib_ImageNot_Inp().
45
47 The function takes the following arguments:
48
49 dst Pointer to destination image.
50
51
52 src Pointer to source image.
53
54
56 The function returns MLIB_SUCCESS if successful. Otherwise it returns
57 MLIB_FAILURE.
58
60 See attributes(5) for descriptions of the following attributes:
61
62
63
64
65 ┌─────────────────────────────┬─────────────────────────────┐
66 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
67 ├─────────────────────────────┼─────────────────────────────┤
68 │Interface Stability │Committed │
69 ├─────────────────────────────┼─────────────────────────────┤
70 │MT-Level │MT-Safe │
71 └─────────────────────────────┴─────────────────────────────┘
72
74 mlib_ImageInvert_Inp(3MLIB), mlib_ImageInvert_Fp(3MLIB), mlib_ImageIn‐
75 vert_Fp_Inp(3MLIB), attributes(5)
76
77
78
79SunOS 5.11 2 Mar 2007 mlib_ImageInvert(3MLIB)