1mlib_ImageScale_Fp(3MLIB) mediaLib Library Functions mlib_ImageScale_Fp(3MLIB)
2
3
4
6 mlib_ImageScale_Fp - linear scaling
7
9 cc [ flag... ] file... -lmlib [ library... ]
10 #include <mlib.h>
11
12 mlib_status mlib_ImageScale_Fp(mlib_image *dst, const mlib_image *src,
13 const mlib_d64 *alpha, const mlib_d64 *beta);
14
15
17 The mlib_ImageScale_Fp() function performs a floating-point linear
18 scaling on the pixels of the source image by multiplying the data by a
19 scale factor, shifting, and then adding an offset.
20
21
22 The following equation is used:
23
24 dst[x][y][i] = src[x][y][i] * alpha[i] + beta[i]
25
26
27
28 If the result of the operation underflows/overflows the minimum/maximum
29 value supported by the destination image, then it will be clamped to
30 the minimum/maximum value respectively.
31
32
33 See the following table for available variations of this linear scaling
34 function.
35
36
37
38
39 Type [*] BYTE SHORT USHORT INT FLOAT DOUBLE
40 ────────────────────────────────────────────────────────────────────────────────────────
41 MLIB_FLOAT Y Y Y Y Y Y
42 ────────────────────────────────────────────────────────────────────────────────────────
43 MLIB_DOUBLE Y Y Y Y Y Y
44
45
46
47 [*] Each row represents a source data type. Each column represents a
48 destination data type.
49
51 The function takes the following arguments:
52
53 dst Pointer to destination image.
54
55
56 src Pointer to source image.
57
58
59 alpha Scaling factor. alpha[i] contains the scaling factor for chan‐
60 nel i.
61
62
63 beta Offset value. beta[i] contains the offset for channel i.
64
65
67 The function returns MLIB_SUCCESS if successful. Otherwise it returns
68 MLIB_FAILURE.
69
71 See attributes(5) for descriptions of the following attributes:
72
73
74
75
76 ┌─────────────────────────────┬─────────────────────────────┐
77 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
78 ├─────────────────────────────┼─────────────────────────────┤
79 │Interface Stability │Committed │
80 ├─────────────────────────────┼─────────────────────────────┤
81 │MT-Level │MT-Safe │
82 └─────────────────────────────┴─────────────────────────────┘
83
85 mlib_ImageScale(3MLIB), mlib_ImageScale_Fp_Inp(3MLIB),
86 mlib_ImageScale_Inp(3MLIB), mlib_ImageScale2(3MLIB),
87 mlib_ImageScale2_Inp(3MLIB), attributes(5)
88
89
90
91SunOS 5.11 2 Mar 2007 mlib_ImageScale_Fp(3MLIB)