| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
#line 453 "lib/PDL/PP.pm" |
|
3
|
|
|
|
|
|
|
/* |
|
4
|
|
|
|
|
|
|
* THIS FILE WAS GENERATED BY PDL::PP from color_space.pd! Do not modify! |
|
5
|
|
|
|
|
|
|
*/ |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
#define PDL_FREE_CODE(trans, destroy, comp_free_code, ntpriv_free_code) \ |
|
8
|
|
|
|
|
|
|
if (destroy) { \ |
|
9
|
|
|
|
|
|
|
comp_free_code \ |
|
10
|
|
|
|
|
|
|
} \ |
|
11
|
|
|
|
|
|
|
if ((trans)->dims_redone) { \ |
|
12
|
|
|
|
|
|
|
ntpriv_free_code \ |
|
13
|
|
|
|
|
|
|
} |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
#include "EXTERN.h" |
|
16
|
|
|
|
|
|
|
#include "perl.h" |
|
17
|
|
|
|
|
|
|
#include "XSUB.h" |
|
18
|
|
|
|
|
|
|
#include "pdl.h" |
|
19
|
|
|
|
|
|
|
#include "pdlcore.h" |
|
20
|
|
|
|
|
|
|
#define PDL PDL_Graphics_ColorSpace |
|
21
|
|
|
|
|
|
|
extern Core* PDL; /* Structure hold core C functions */ |
|
22
|
|
|
|
|
|
|
#line 23 "ColorSpace.xs" |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
#include |
|
25
|
|
|
|
|
|
|
#include "color_space.h" /* Local decs */ |
|
26
|
|
|
|
|
|
|
pdl_error pdl_run_rgb_to_cmyk(pdl *rgb,pdl *cmyk); |
|
27
|
|
|
|
|
|
|
pdl_error pdl_run_cmyk_to_rgb(pdl *cmyk,pdl *rgb); |
|
28
|
|
|
|
|
|
|
pdl_error pdl_run_rgb_to_hsl(pdl *rgb,pdl *hsl); |
|
29
|
|
|
|
|
|
|
pdl_error pdl_run_hsl_to_rgb(pdl *hsl,pdl *rgb); |
|
30
|
|
|
|
|
|
|
pdl_error pdl_run_rgb_to_hsv(pdl *rgb,pdl *hsv); |
|
31
|
|
|
|
|
|
|
pdl_error pdl_run_hsv_to_rgb(pdl *hsv,pdl *rgb); |
|
32
|
|
|
|
|
|
|
pdl_error pdl_run_xyY_to_xyz(pdl *xyY,pdl *xyz); |
|
33
|
|
|
|
|
|
|
pdl_error pdl_run__rgb_to_xyz(pdl *rgb,pdl *gamma,pdl *m,pdl *xyz); |
|
34
|
|
|
|
|
|
|
pdl_error pdl_run__xyz_to_rgb(pdl *xyz,pdl *gamma,pdl *mstar,pdl *rgb); |
|
35
|
|
|
|
|
|
|
pdl_error pdl_run__xyz_to_lab(pdl *xyz,pdl *w,pdl *lab); |
|
36
|
|
|
|
|
|
|
pdl_error pdl_run__lab_to_xyz(pdl *lab,pdl *w,pdl *xyz); |
|
37
|
|
|
|
|
|
|
pdl_error pdl_run_lab_to_lch(pdl *lab,pdl *lch); |
|
38
|
|
|
|
|
|
|
pdl_error pdl_run_lch_to_lab(pdl *lch,pdl *lab); |
|
39
|
|
|
|
|
|
|
pdl_error pdl_run_rgb_to_linear(pdl *rgb,pdl *gamma,pdl *out); |
|
40
|
|
|
|
|
|
|
pdl_error pdl_run_rgb_from_linear(pdl *rgb,pdl *gamma,pdl *out); |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
#line 449 "lib/PDL/PP.pm" |
|
43
|
|
|
|
|
|
|
#include "pdlperl.h" |
|
44
|
|
|
|
|
|
|
#line 45 "ColorSpace.xs" |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Core* PDL = NULL; /* Structure hold core C functions */ |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
MODULE = PDL::Graphics::ColorSpace PACKAGE = PDL PREFIX=pdl_run_ |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
PROTOTYPES: DISABLE |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
void |
|
54
|
|
|
|
|
|
|
pdl_run_rgb_to_cmyk(rgb, cmyk=PDL_XS_PERLINIT_initsv(cmyk_SV)) |
|
55
|
|
|
|
|
|
|
SV *cmyk_SV = items > 1 ? ST(1) : NULL; |
|
56
|
|
|
|
|
|
|
PREINIT: |
|
57
|
2
|
50
|
|
|
|
|
PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
INPUT: |
|
59
|
|
|
|
|
|
|
pdl *rgb |
|
60
|
|
|
|
|
|
|
pdl *cmyk |
|
61
|
|
|
|
|
|
|
PPCODE: |
|
62
|
2
|
|
|
|
|
|
PDL->barf_if_error(pdl_run_rgb_to_cmyk(rgb,cmyk)); |
|
63
|
2
|
50
|
|
|
|
|
PDL_XS_RETURN(ST(0) = cmyk_SV) |
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
void |
|
66
|
|
|
|
|
|
|
pdl_run_cmyk_to_rgb(cmyk, rgb=PDL_XS_PERLINIT_initsv(rgb_SV)) |
|
67
|
|
|
|
|
|
|
SV *rgb_SV = items > 1 ? ST(1) : NULL; |
|
68
|
|
|
|
|
|
|
PREINIT: |
|
69
|
2
|
50
|
|
|
|
|
PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
INPUT: |
|
71
|
|
|
|
|
|
|
pdl *cmyk |
|
72
|
|
|
|
|
|
|
pdl *rgb |
|
73
|
|
|
|
|
|
|
PPCODE: |
|
74
|
2
|
|
|
|
|
|
PDL->barf_if_error(pdl_run_cmyk_to_rgb(cmyk,rgb)); |
|
75
|
2
|
50
|
|
|
|
|
PDL_XS_RETURN(ST(0) = rgb_SV) |
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
void |
|
78
|
|
|
|
|
|
|
pdl_run_rgb_to_hsl(rgb, hsl=hsl) |
|
79
|
|
|
|
|
|
|
SV *hsl_SV = items > 1 ? ST(1) : NULL; |
|
80
|
|
|
|
|
|
|
PREINIT: |
|
81
|
2
|
50
|
|
|
|
|
PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
INPUT: |
|
83
|
|
|
|
|
|
|
pdl *rgb |
|
84
|
|
|
|
|
|
|
pdl *hsl=NO_INIT |
|
85
|
|
|
|
|
|
|
PPCODE: |
|
86
|
2
|
50
|
|
|
|
|
PDL_XS_INPLACE(rgb, hsl) |
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
87
|
2
|
|
|
|
|
|
PDL->barf_if_error(pdl_run_rgb_to_hsl(rgb,hsl)); |
|
88
|
2
|
50
|
|
|
|
|
PDL_XS_RETURN(ST(0) = hsl_SV) |
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
void |
|
91
|
|
|
|
|
|
|
pdl_run_hsl_to_rgb(hsl, rgb=rgb) |
|
92
|
|
|
|
|
|
|
SV *rgb_SV = items > 1 ? ST(1) : NULL; |
|
93
|
|
|
|
|
|
|
PREINIT: |
|
94
|
2
|
50
|
|
|
|
|
PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
INPUT: |
|
96
|
|
|
|
|
|
|
pdl *hsl |
|
97
|
|
|
|
|
|
|
pdl *rgb=NO_INIT |
|
98
|
|
|
|
|
|
|
PPCODE: |
|
99
|
2
|
50
|
|
|
|
|
PDL_XS_INPLACE(hsl, rgb) |
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
100
|
2
|
|
|
|
|
|
PDL->barf_if_error(pdl_run_hsl_to_rgb(hsl,rgb)); |
|
101
|
2
|
50
|
|
|
|
|
PDL_XS_RETURN(ST(0) = rgb_SV) |
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
void |
|
104
|
|
|
|
|
|
|
pdl_run_rgb_to_hsv(rgb, hsv=hsv) |
|
105
|
|
|
|
|
|
|
SV *hsv_SV = items > 1 ? ST(1) : NULL; |
|
106
|
|
|
|
|
|
|
PREINIT: |
|
107
|
2
|
50
|
|
|
|
|
PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
INPUT: |
|
109
|
|
|
|
|
|
|
pdl *rgb |
|
110
|
|
|
|
|
|
|
pdl *hsv=NO_INIT |
|
111
|
|
|
|
|
|
|
PPCODE: |
|
112
|
2
|
50
|
|
|
|
|
PDL_XS_INPLACE(rgb, hsv) |
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
113
|
2
|
|
|
|
|
|
PDL->barf_if_error(pdl_run_rgb_to_hsv(rgb,hsv)); |
|
114
|
2
|
50
|
|
|
|
|
PDL_XS_RETURN(ST(0) = hsv_SV) |
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
void |
|
117
|
|
|
|
|
|
|
pdl_run_hsv_to_rgb(hsv, rgb=rgb) |
|
118
|
|
|
|
|
|
|
SV *rgb_SV = items > 1 ? ST(1) : NULL; |
|
119
|
|
|
|
|
|
|
PREINIT: |
|
120
|
2
|
50
|
|
|
|
|
PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
INPUT: |
|
122
|
|
|
|
|
|
|
pdl *hsv |
|
123
|
|
|
|
|
|
|
pdl *rgb=NO_INIT |
|
124
|
|
|
|
|
|
|
PPCODE: |
|
125
|
2
|
50
|
|
|
|
|
PDL_XS_INPLACE(hsv, rgb) |
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
126
|
2
|
|
|
|
|
|
PDL->barf_if_error(pdl_run_hsv_to_rgb(hsv,rgb)); |
|
127
|
2
|
50
|
|
|
|
|
PDL_XS_RETURN(ST(0) = rgb_SV) |
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
void |
|
130
|
|
|
|
|
|
|
pdl_run_xyY_to_xyz(xyY, xyz=xyz) |
|
131
|
|
|
|
|
|
|
SV *xyz_SV = items > 1 ? ST(1) : NULL; |
|
132
|
|
|
|
|
|
|
PREINIT: |
|
133
|
1
|
50
|
|
|
|
|
PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
INPUT: |
|
135
|
|
|
|
|
|
|
pdl *xyY |
|
136
|
|
|
|
|
|
|
pdl *xyz=NO_INIT |
|
137
|
|
|
|
|
|
|
PPCODE: |
|
138
|
1
|
50
|
|
|
|
|
PDL_XS_INPLACE(xyY, xyz) |
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
139
|
1
|
|
|
|
|
|
PDL->barf_if_error(pdl_run_xyY_to_xyz(xyY,xyz)); |
|
140
|
1
|
50
|
|
|
|
|
PDL_XS_RETURN(ST(0) = xyz_SV) |
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
void |
|
143
|
|
|
|
|
|
|
pdl_run__rgb_to_xyz(rgb, gamma, m, xyz=xyz) |
|
144
|
|
|
|
|
|
|
SV *xyz_SV = items > 3 ? ST(3) : NULL; |
|
145
|
|
|
|
|
|
|
PREINIT: |
|
146
|
10
|
50
|
|
|
|
|
PDL_XS_PREAMBLE((items == 4) ? 0 : 1); |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
INPUT: |
|
148
|
|
|
|
|
|
|
pdl *rgb |
|
149
|
|
|
|
|
|
|
pdl *gamma |
|
150
|
|
|
|
|
|
|
pdl *m |
|
151
|
|
|
|
|
|
|
pdl *xyz=NO_INIT |
|
152
|
|
|
|
|
|
|
PPCODE: |
|
153
|
10
|
100
|
|
|
|
|
PDL_XS_INPLACE(rgb, xyz) |
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
154
|
10
|
|
|
|
|
|
PDL->barf_if_error(pdl_run__rgb_to_xyz(rgb,gamma,m,xyz)); |
|
155
|
10
|
50
|
|
|
|
|
PDL_XS_RETURN(ST(0) = xyz_SV) |
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
void |
|
158
|
|
|
|
|
|
|
pdl_run__xyz_to_rgb(xyz, gamma, mstar, rgb=rgb) |
|
159
|
|
|
|
|
|
|
SV *rgb_SV = items > 3 ? ST(3) : NULL; |
|
160
|
|
|
|
|
|
|
PREINIT: |
|
161
|
5
|
50
|
|
|
|
|
PDL_XS_PREAMBLE((items == 4) ? 0 : 1); |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
INPUT: |
|
163
|
|
|
|
|
|
|
pdl *xyz |
|
164
|
|
|
|
|
|
|
pdl *gamma |
|
165
|
|
|
|
|
|
|
pdl *mstar |
|
166
|
|
|
|
|
|
|
pdl *rgb=NO_INIT |
|
167
|
|
|
|
|
|
|
PPCODE: |
|
168
|
5
|
50
|
|
|
|
|
PDL_XS_INPLACE(xyz, rgb) |
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
169
|
5
|
|
|
|
|
|
PDL->barf_if_error(pdl_run__xyz_to_rgb(xyz,gamma,mstar,rgb)); |
|
170
|
5
|
50
|
|
|
|
|
PDL_XS_RETURN(ST(0) = rgb_SV) |
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
void |
|
173
|
|
|
|
|
|
|
pdl_run__xyz_to_lab(xyz, w, lab=lab) |
|
174
|
|
|
|
|
|
|
SV *lab_SV = items > 2 ? ST(2) : NULL; |
|
175
|
|
|
|
|
|
|
PREINIT: |
|
176
|
8
|
50
|
|
|
|
|
PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
INPUT: |
|
178
|
|
|
|
|
|
|
pdl *xyz |
|
179
|
|
|
|
|
|
|
pdl *w |
|
180
|
|
|
|
|
|
|
pdl *lab=NO_INIT |
|
181
|
|
|
|
|
|
|
PPCODE: |
|
182
|
8
|
50
|
|
|
|
|
PDL_XS_INPLACE(xyz, lab) |
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
183
|
8
|
|
|
|
|
|
PDL->barf_if_error(pdl_run__xyz_to_lab(xyz,w,lab)); |
|
184
|
8
|
50
|
|
|
|
|
PDL_XS_RETURN(ST(0) = lab_SV) |
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
void |
|
187
|
|
|
|
|
|
|
pdl_run__lab_to_xyz(lab, w, xyz=xyz) |
|
188
|
|
|
|
|
|
|
SV *xyz_SV = items > 2 ? ST(2) : NULL; |
|
189
|
|
|
|
|
|
|
PREINIT: |
|
190
|
7
|
50
|
|
|
|
|
PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
INPUT: |
|
192
|
|
|
|
|
|
|
pdl *lab |
|
193
|
|
|
|
|
|
|
pdl *w |
|
194
|
|
|
|
|
|
|
pdl *xyz=NO_INIT |
|
195
|
|
|
|
|
|
|
PPCODE: |
|
196
|
7
|
50
|
|
|
|
|
PDL_XS_INPLACE(lab, xyz) |
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
197
|
7
|
|
|
|
|
|
PDL->barf_if_error(pdl_run__lab_to_xyz(lab,w,xyz)); |
|
198
|
7
|
50
|
|
|
|
|
PDL_XS_RETURN(ST(0) = xyz_SV) |
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
void |
|
201
|
|
|
|
|
|
|
pdl_run_lab_to_lch(lab, lch=lch) |
|
202
|
|
|
|
|
|
|
SV *lch_SV = items > 1 ? ST(1) : NULL; |
|
203
|
|
|
|
|
|
|
PREINIT: |
|
204
|
5
|
50
|
|
|
|
|
PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
INPUT: |
|
206
|
|
|
|
|
|
|
pdl *lab |
|
207
|
|
|
|
|
|
|
pdl *lch=NO_INIT |
|
208
|
|
|
|
|
|
|
PPCODE: |
|
209
|
5
|
50
|
|
|
|
|
PDL_XS_INPLACE(lab, lch) |
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
210
|
5
|
|
|
|
|
|
PDL->barf_if_error(pdl_run_lab_to_lch(lab,lch)); |
|
211
|
5
|
50
|
|
|
|
|
PDL_XS_RETURN(ST(0) = lch_SV) |
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
void |
|
214
|
|
|
|
|
|
|
pdl_run_lch_to_lab(lch, lab=lab) |
|
215
|
|
|
|
|
|
|
SV *lab_SV = items > 1 ? ST(1) : NULL; |
|
216
|
|
|
|
|
|
|
PREINIT: |
|
217
|
3
|
50
|
|
|
|
|
PDL_XS_PREAMBLE((items == 2) ? 0 : 1); |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
INPUT: |
|
219
|
|
|
|
|
|
|
pdl *lch |
|
220
|
|
|
|
|
|
|
pdl *lab=NO_INIT |
|
221
|
|
|
|
|
|
|
PPCODE: |
|
222
|
3
|
50
|
|
|
|
|
PDL_XS_INPLACE(lch, lab) |
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
223
|
3
|
|
|
|
|
|
PDL->barf_if_error(pdl_run_lch_to_lab(lch,lab)); |
|
224
|
3
|
50
|
|
|
|
|
PDL_XS_RETURN(ST(0) = lab_SV) |
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
void |
|
227
|
|
|
|
|
|
|
pdl_run_rgb_to_linear(rgb, gamma, out=out) |
|
228
|
|
|
|
|
|
|
SV *out_SV = items > 2 ? ST(2) : NULL; |
|
229
|
|
|
|
|
|
|
PREINIT: |
|
230
|
1
|
50
|
|
|
|
|
PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
INPUT: |
|
232
|
|
|
|
|
|
|
pdl *rgb |
|
233
|
|
|
|
|
|
|
pdl *gamma |
|
234
|
|
|
|
|
|
|
pdl *out=NO_INIT |
|
235
|
|
|
|
|
|
|
PPCODE: |
|
236
|
1
|
50
|
|
|
|
|
PDL_XS_INPLACE(rgb, out) |
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
237
|
1
|
|
|
|
|
|
PDL->barf_if_error(pdl_run_rgb_to_linear(rgb,gamma,out)); |
|
238
|
1
|
50
|
|
|
|
|
PDL_XS_RETURN(ST(0) = out_SV) |
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
void |
|
241
|
|
|
|
|
|
|
pdl_run_rgb_from_linear(rgb, gamma, out=out) |
|
242
|
|
|
|
|
|
|
SV *out_SV = items > 2 ? ST(2) : NULL; |
|
243
|
|
|
|
|
|
|
PREINIT: |
|
244
|
1
|
50
|
|
|
|
|
PDL_XS_PREAMBLE((items == 3) ? 0 : 1); |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
INPUT: |
|
246
|
|
|
|
|
|
|
pdl *rgb |
|
247
|
|
|
|
|
|
|
pdl *gamma |
|
248
|
|
|
|
|
|
|
pdl *out=NO_INIT |
|
249
|
|
|
|
|
|
|
PPCODE: |
|
250
|
1
|
50
|
|
|
|
|
PDL_XS_INPLACE(rgb, out) |
|
|
|
0
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
251
|
1
|
|
|
|
|
|
PDL->barf_if_error(pdl_run_rgb_from_linear(rgb,gamma,out)); |
|
252
|
1
|
50
|
|
|
|
|
PDL_XS_RETURN(ST(0) = out_SV) |
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
#line 483 "lib/PDL/PP.pm" |
|
256
|
|
|
|
|
|
|
BOOT: |
|
257
|
|
|
|
|
|
|
/* Get pointer to structure of core shared C routines */ |
|
258
|
|
|
|
|
|
|
/* make sure PDL::Core is loaded */ |
|
259
|
|
|
|
|
|
|
#line 260 "ColorSpace.xs" |
|
260
|
1
|
|
|
|
|
|
perl_require_pv ("PDL/Core.pm"); /* make sure PDL::Core is loaded */ |
|
261
|
|
|
|
|
|
|
#ifndef aTHX_ |
|
262
|
|
|
|
|
|
|
#define aTHX_ |
|
263
|
|
|
|
|
|
|
#endif |
|
264
|
1
|
50
|
|
|
|
|
if (SvTRUE (ERRSV)) Perl_croak(aTHX_ "%s",SvPV_nolen (ERRSV)); |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
265
|
1
|
|
|
|
|
|
SV* CoreSV = perl_get_sv("PDL::SHARE",FALSE); /* var with core structure */ |
|
266
|
1
|
50
|
|
|
|
|
if (!CoreSV) |
|
267
|
0
|
|
|
|
|
|
Perl_croak(aTHX_ "We require the PDL::Core module, which was not found"); |
|
268
|
1
|
50
|
|
|
|
|
if (!(PDL = INT2PTR(Core*,SvIV( CoreSV )))) /* Core* value */ |
|
269
|
0
|
|
|
|
|
|
Perl_croak(aTHX_ "Got NULL pointer for PDL"); |
|
270
|
1
|
50
|
|
|
|
|
if (PDL->Version != PDL_CORE_VERSION) |
|
271
|
0
|
|
|
|
|
|
Perl_croak(aTHX_ "[PDL->Version: %ld PDL_CORE_VERSION: %ld XS_VERSION: %s] PDL::Graphics::ColorSpace needs to be recompiled against the newly installed PDL", (long int)PDL->Version, (long int)PDL_CORE_VERSION, XS_VERSION); |