1mlib_ImageScale2(3MLIB) mediaLib Library Functions mlib_ImageScale2(3MLIB)
2
3
4
6 mlib_ImageScale2 - linear scaling
7
9 cc [ flag... ] file... -lmlib [ library... ]
10 #include <mlib.h>
11
12 mlib_status mlib_ImageScale2(mlib_image *dst, const mlib_image *src,
13 const mlib_d64 *alpha, const mlib_d64 *beta);
14
15
17 The mlib_ImageScale2() function performs a linear scaling on the pixels
18 of the source image by multiplying the data by a scale factor and then
19 adding an offset. Images must have the same size, and number of chan‐
20 nels. They can have 1, 2, 3, or 4 channels.
21
22
23 The following equation is used:
24
25 dst[x][y][i] = src[x][y][i] * alpha[i] + 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 See the following table for available variations of this linear scaling
35 function.
36
37
38
39
40 Type [*] BYTE SHORT USHORT INT FLOAT DOUBLE
41 ────────────────────────────────────────────────────────────────────────────────────────
42 MLIB_BYTE Y Y Y Y Y Y
43 ────────────────────────────────────────────────────────────────────────────────────────
44 MLIB_SHORT Y Y Y Y Y Y
45 ────────────────────────────────────────────────────────────────────────────────────────
46 MLIB_USHORT Y Y Y Y Y Y
47 ────────────────────────────────────────────────────────────────────────────────────────
48 MLIB_INT Y Y Y Y Y Y
49
50
51
52 [*] Each row represents a source data type. Each column represents a
53 destination data type.
54
56 The function takes the following arguments:
57
58 dst Pointer to destination image.
59
60
61 src Pointer to source image.
62
63
64 alpha Scaling factor. alpha[i] contains the scaling factor for chan‐
65 nel i.
66
67
68 beta Offset value. beta[i] contains the offset for channel i.
69
70
72 The function returns MLIB_SUCCESS if successful. Otherwise it returns
73 MLIB_FAILURE.
74
76 See attributes(5) for descriptions of the following attributes:
77
78
79
80
81 ┌─────────────────────────────┬─────────────────────────────┐
82 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
83 ├─────────────────────────────┼─────────────────────────────┤
84 │Interface Stability │Committed │
85 ├─────────────────────────────┼─────────────────────────────┤
86 │MT-Level │MT-Safe │
87 └─────────────────────────────┴─────────────────────────────┘
88
90 mlib_ImageScale(3MLIB), mlib_ImageScale_Fp(3MLIB),
91 mlib_ImageScale_Fp_Inp(3MLIB), mlib_ImageScale_Inp(3MLIB),
92 mlib_ImageScale2_Inp(3MLIB), attributes(5)
93
94
95
96SunOS 5.11 2 Mar 2007 mlib_ImageScale2(3MLIB)