1mlib_ImageLookUp2(3MLIB) mediaLib Library Functions mlib_ImageLookUp2(3MLIB)
2
3
4
6 mlib_ImageLookUp2 - table lookup
7
9 cc [ flag... ] file... -lmlib [ library... ]
10 #include <mlib.h>
11
12 mlib_status mlib_ImageLookUp2(mlib_image *dst, const mlib_image *src,
13 const void **table, const mlib_s32 *offsets, mlib_s32 channels);
14
15
17 The mlib_ImageLookUp2() function maps the source image to the destina‐
18 tion image by using the user-specified lookup table and an offset.
19
20
21 The source and destination images must have the same width and height.
22
23
24 The source and destination images can have different data types. See
25 the following table for available variations of the table lookup func‐
26 tion on image types:
27
28
29
30
31 Type [*] BYTE SHORT USHORT INT FLOAT DOUBLE
32 ────────────────────────────────────────────────────────────────────────────────────────
33 MLIB_BIT Y
34 MLIB_BYTE Y Y Y Y Y Y
35 ────────────────────────────────────────────────────────────────────────────────────────
36 MLIB_SHORT Y Y Y Y Y Y
37 ────────────────────────────────────────────────────────────────────────────────────────
38 MLIB_USHORT Y Y Y Y Y Y
39 ────────────────────────────────────────────────────────────────────────────────────────
40 MLIB_INT Y Y Y Y Y Y
41
42
43
44 [*] Each row represents a source data type. Each column represents a
45 destination data type.
46
47
48 The source and destination images also can have a different number of
49 channels. The source image can be a single-channel image or can have
50 the same number of channels as the destination image. The lookup table
51 can have one channel or have the same channels as the destination
52 image. See the following table for possible variations on the number of
53 channels in the images and the lookup table:
54
55
56
57
58 # of channels in # of channels in # of channels in
59 the input image the lookup table the output image
60 ──────────────────────────────────────────────────────────────
61 1 n n
62 n 1 n
63 n n n
64
65
66
67 where, n = 1, 2, 3, 4.
68
69
70 Each of the following equations is used in the corresponding case shown
71 in the table above.
72
73 dst[x][y][i] = table[i][src[x][y][0] - offsets[i]]
74 dst[x][y][i] = table[0][src[x][y][i] - offsets[0]]
75 dst[x][y][i] = table[i][src[x][y][i] - offsets[i]]
76
77
79 The function takes the following arguments:
80
81 dst Pointer to destination image.
82
83
84 src Pointer to source image.
85
86
87 table Pointer to lookup table. The data type of the lookup table
88 is the same as that of the destination image.. The format
89 of the lookup table is:
90
91 table[channel][index]
92
93 The entries are indexed from 0 to 1, 2, ..., and so on. It
94 is the user's responsibility to provide a lookup table that
95 has enough entries to cover all possible values of the
96 pixel components deducted by the offset in each channel of
97 the source image.
98
99
100 offsets Offset values subtracted from the src pixel before table
101 lookup.
102
103
104 channels Number of channels in the lookup table. If the number of
105 channels equals 1, then the same table is applied to all
106 channels. Otherwise, the number of channels must be no less
107 than the number of channels in the destination image.
108
109
111 The function returns MLIB_SUCCESS if successful. Otherwise it returns
112 MLIB_FAILURE.
113
115 See attributes(5) for descriptions of the following attributes:
116
117
118
119
120 ┌─────────────────────────────┬─────────────────────────────┐
121 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
122 ├─────────────────────────────┼─────────────────────────────┤
123 │Interface Stability │Committed │
124 ├─────────────────────────────┼─────────────────────────────┤
125 │MT-Level │MT-Safe │
126 └─────────────────────────────┴─────────────────────────────┘
127
129 mlib_ImageLookUp(3MLIB), mlib_ImageLookUp_Inp(3MLIB), mlib_ImageLookUp‐
130 Mask(3MLIB), attributes(5)
131
132
133
134SunOS 5.11 2 Mar 2007 mlib_ImageLookUp2(3MLIB)