1mlib_ImageConstDivShift_Inpm(e3dMiLaILBi)b Library Fumnlcitbi_oInmsageConstDivShift_Inp(3MLIB)
2
3
4

NAME

6       mlib_ImageConstDivShift_Inp - division into a constant, with shifting
7

SYNOPSIS

9       cc [ flag... ] file... -lmlib [ library... ]
10       #include <mlib.h>
11
12       mlib_status mlib_ImageConstDivShift_Inp(mlib_image *srcdst,
13            const mlib_s32 *c, mlib_s32 shift);
14
15

DESCRIPTION

17       The  mlib_ImageConstDivShift_Inp()  function  divides  each pixel in an
18       image into a constant value on a pixel-by-pixel  basis,  in  place.  It
19       scales the result by a left shift and writes the result to the image on
20       a pixel-by-pixel basis.
21
22
23       It uses the following equation:
24
25         srcdst[x][y][i] = c[i] / srcdst[x][y][i] * 2**shift
26
27
28
29       In the case of srcdst[x][y][i] = 0,
30
31         srcdst[x][y][i] = 0              if c[i] = 0
32         srcdst[x][y][i] = DATA_TYPE_MAX  if c[i] > 0
33         srcdst[x][y][i] = DATA_TYPE_MIN  if c[i] < 0
34
35
36
37       where DATA_TYPE is MLIB_U8, MLIB_S16,  MLIB_U16,  or  MLIB_S32  for  an
38       image  of type MLIB_BYTE, MLIB_SHORT, MLIB_USHORT, or MLIB_INT, respec‐
39       tively.
40

PARAMETERS

42       The function takes the following arguments:
43
44       srcdst    Pointer to source and destination image.
45
46
47       c         Constant into which each pixel is divided. c[i] contains  the
48                 constant for channel i.
49
50
51       shift     Left shifting factor. 0 ≤ shift ≤ 31.
52
53

RETURN VALUES

55       The  function  returns MLIB_SUCCESS if successful. Otherwise it returns
56       MLIB_FAILURE.
57

ATTRIBUTES

59       See attributes(5) for descriptions of the following attributes:
60
61
62
63
64       ┌─────────────────────────────┬─────────────────────────────┐
65       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
66       ├─────────────────────────────┼─────────────────────────────┤
67       │Interface Stability          │Committed                    │
68       ├─────────────────────────────┼─────────────────────────────┤
69       │MT-Level                     │MT-Safe                      │
70       └─────────────────────────────┴─────────────────────────────┘
71

SEE ALSO

73       mlib_ImageConstDiv(3MLIB), mlib_ImageConstDiv_Fp(3MLIB), mlib_ImageCon‐
74       stDiv_Fp_Inp(3MLIB),  mlib_ImageConstDiv_Inp(3MLIB), mlib_ImageConstDi‐
75       vShift(3MLIB), attributes(5)
76
77
78
79SunOS 5.11                        2 Mar 2007mlib_ImageConstDivShift_Inp(3MLIB)
Impressum