1mlib_ImageScale_Inp(3MLIB)mediaLib Library Functionsmlib_ImageScale_Inp(3MLIB)
2
3
4
6 mlib_ImageScale_Inp - linear scaling, in place
7
9 cc [ flag... ] file... -lmlib [ library... ]
10 #include <mlib.h>
11
12 mlib_status mlib_ImageScale_Inp(mlib_image *srcdst, const mlib_s32 *alpha,
13 const mlib_s32 *beta, mlib_s32 shift);
14
15
17 The mlib_ImageScale_Inp() function performs an in-place linear scaling
18 on the pixels of the source image by multiplying the data by a scale
19 factor, shifting, and then adding an offset.
20
21
22 The following equation is used:
23
24 srcdst[x][y][i] = srcdst[x][y][i] * alpha[i] * 2**(-shift) +
25 beta[i]
26
27
28
29 If the result of the operation underflows/overflows the minimum/maximum
30 value supported by the destination image, then it will be clamped to
31 the minimum/maximum value respectively.
32
33
34 The image can be of type MLIB_BYTE, MLIB_SHORT, MLIB_USHORT or
35 MLIB_INT.
36
38 The function takes the following arguments:
39
40 srcdst Pointer to source and destination image.
41
42
43 alpha Scaling factor. alpha[i] contains the scaling factor for
44 channel i.
45
46
47 beta Offset value. beta[i] contains the offset for channel i.
48
49
50 shift Right shifting factor.
51
52
54 The function returns MLIB_SUCCESS if successful. Otherwise it returns
55 MLIB_FAILURE.
56
58 See attributes(5) for descriptions of the following attributes:
59
60
61
62
63 ┌─────────────────────────────┬─────────────────────────────┐
64 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
65 ├─────────────────────────────┼─────────────────────────────┤
66 │Interface Stability │Committed │
67 ├─────────────────────────────┼─────────────────────────────┤
68 │MT-Level │MT-Safe │
69 └─────────────────────────────┴─────────────────────────────┘
70
72 mlib_ImageScale(3MLIB), mlib_ImageScale_Fp(3MLIB),
73 mlib_ImageScale_Fp_Inp(3MLIB), mlib_ImageScale2(3MLIB),
74 mlib_ImageScale2_Inp(3MLIB), attributes(5)
75
76
77
78SunOS 5.11 2 Mar 2007 mlib_ImageScale_Inp(3MLIB)