Skip to content

Commit 3f93827

Browse files
tjdcsKelSolaar
authored andcommitted
use freshly source built ctlrender
remove contributing-mac-os file
1 parent 6f1bf7c commit 3f93827

File tree

4 files changed

+111
-115
lines changed

4 files changed

+111
-115
lines changed

colour/io/ctl.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -341,14 +341,14 @@ def template_ctl_transform_float(
341341
<BLANKLINE>
342342
void main
343343
(
344-
input varying float rIn,
345-
input varying float gIn,
346-
input varying float bIn,
347-
input varying float aIn,
348344
output varying float rOut,
349345
output varying float gOut,
350346
output varying float bOut,
351347
output varying float aOut,
348+
input varying float rIn,
349+
input varying float gIn,
350+
input varying float bIn,
351+
input varying float aIn = 1.0,
352352
input float exposure = 0.0
353353
)
354354
{
@@ -380,14 +380,14 @@ def template_ctl_transform_float(
380380
<BLANKLINE>
381381
void main
382382
(
383-
input varying float rIn,
384-
input varying float gIn,
385-
input varying float bIn,
386-
input varying float aIn,
387383
output varying float rOut,
388384
output varying float gOut,
389385
output varying float bOut,
390-
output varying float aOut)
386+
output varying float aOut,
387+
input varying float rIn,
388+
input varying float gIn,
389+
input varying float bIn,
390+
input varying float aIn = 1.0)
391391
{
392392
rOut = Y_2_linCV(rIn, CINEMA_WHITE, CINEMA_BLACK);
393393
gOut = Y_2_linCV(gIn, CINEMA_WHITE, CINEMA_BLACK);
@@ -421,14 +421,14 @@ def template_ctl_transform_float(
421421
ctl_file_content += """
422422
void main
423423
(
424-
input varying float rIn,
425-
input varying float gIn,
426-
input varying float bIn,
427-
input varying float aIn,
428424
output varying float rOut,
429425
output varying float gOut,
430426
output varying float bOut,
431-
output varying float aOut
427+
output varying float aOut,
428+
input varying float rIn,
429+
input varying float gIn,
430+
input varying float bIn,
431+
input varying float aIn = 1.0
432432
""".strip()
433433

434434
if parameters:
@@ -503,14 +503,14 @@ def template_ctl_transform_float3(
503503
<BLANKLINE>
504504
void main
505505
(
506-
input varying float rIn,
507-
input varying float gIn,
508-
input varying float bIn,
509-
input varying float aIn,
510506
output varying float rOut,
511507
output varying float gOut,
512508
output varying float bOut,
513-
output varying float aOut)
509+
output varying float aOut,
510+
input varying float rIn,
511+
input varying float gIn,
512+
input varying float bIn,
513+
input varying float aIn = 1.0)
514514
{
515515
float rgbIn[3] = {rIn, gIn, bIn};
516516
<BLANKLINE>
@@ -546,14 +546,14 @@ def template_ctl_transform_float3(
546546
ctl_file_content += """
547547
void main
548548
(
549-
input varying float rIn,
550-
input varying float gIn,
551-
input varying float bIn,
552-
input varying float aIn,
553549
output varying float rOut,
554550
output varying float gOut,
555551
output varying float bOut,
556-
output varying float aOut
552+
output varying float aOut,
553+
input varying float rIn,
554+
input varying float gIn,
555+
input varying float bIn,
556+
input varying float aIn = 1.0
557557
""".strip()
558558

559559
if parameters:

colour/io/tests/resources/Adjust_Exposure_Float.ctl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
void main
44
(
5-
input varying float rIn,
6-
input varying float gIn,
7-
input varying float bIn,
8-
input varying float aIn,
95
output varying float rOut,
106
output varying float gOut,
117
output varying float bOut,
128
output varying float aOut,
9+
input varying float rIn,
10+
input varying float gIn,
11+
input varying float bIn,
12+
input varying float aIn = 1.0,
1313
input float exposure = 0.0
1414
)
1515
{

colour/io/tests/resources/Adjust_Exposure_Float3.ctl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ float[3] adjust_exposure(float rgbIn[3], float exposureIn)
1515

1616
void main
1717
(
18-
input varying float rIn,
19-
input varying float gIn,
20-
input varying float bIn,
21-
input varying float aIn,
2218
output varying float rOut,
2319
output varying float gOut,
2420
output varying float bOut,
2521
output varying float aOut,
22+
input varying float rIn,
23+
input varying float gIn,
24+
input varying float bIn,
25+
input varying float aIn = 1.0,
2626
input float exposure = 0.0
2727
)
2828
{

colour/io/tests/test_ctl.py

Lines changed: 79 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -219,43 +219,40 @@ def test_template_ctl_transform_float(self):
219219
"input float foo[3] = {1.0, 1.0, 1.0}",
220220
"input float bar = 1.0",
221221
],
222-
header="// Custom Header\n",
222+
header="// Custom Header",
223223
)
224224

225-
self.assertEqual(
226-
ctl_foo_bar_float,
227-
textwrap.dedent(
228-
"""
229-
// Foo & Bar
230-
231-
import "Foo.ctl";
232-
import "Bar.ctl";
233-
234-
// Custom Header
235-
236-
void main
237-
(
238-
input varying float rIn,
239-
input varying float gIn,
240-
input varying float bIn,
241-
input varying float aIn,
242-
output varying float rOut,
243-
output varying float gOut,
244-
output varying float bOut,
245-
output varying float aOut,
246-
input float foo[3] = {1.0, 1.0, 1.0},
247-
input float bar = 1.0
248-
)
249-
{
250-
rOut = rIn + foo[0];
251-
gOut = gIn + foo[1];
252-
bOut = bIn + foo[2];
253-
aOut = aIn;
254-
}"""[
255-
1:
256-
]
257-
),
225+
target = textwrap.dedent(
226+
"""
227+
// Foo & Bar
228+
229+
import "Foo.ctl";
230+
import "Bar.ctl";
231+
232+
// Custom Header
233+
void main
234+
(
235+
output varying float rOut,
236+
output varying float gOut,
237+
output varying float bOut,
238+
output varying float aOut,
239+
input varying float rIn,
240+
input varying float gIn,
241+
input varying float bIn,
242+
input varying float aIn = 1.0,
243+
input float foo[3] = {1.0, 1.0, 1.0},
244+
input float bar = 1.0
245+
)
246+
{
247+
rOut = rIn + foo[0];
248+
gOut = gIn + foo[1];
249+
bOut = bIn + foo[2];
250+
aOut = aIn;
251+
}"""[
252+
1:
253+
]
258254
)
255+
self.assertEqual(ctl_foo_bar_float, target)
259256

260257

261258
class TestTemplateCtlTransformFloat3(unittest.TestCase):
@@ -281,31 +278,6 @@ def test_template_ctl_transform_float3(self):
281278
],
282279
header=textwrap.dedent(
283280
"""
284-
float[3] baz(float rgbIn[3], float foo[3], float qux)
285-
{
286-
float rgbOut[3];
287-
288-
rgbOut[0] = rgbIn[0] * foo[0]* qux;
289-
rgbOut[1] = rgbIn[1] * foo[1]* qux;
290-
rgbOut[2] = rgbIn[2] * foo[2]* qux;
291-
292-
return rgbOut;
293-
}\n"""[
294-
1:
295-
]
296-
),
297-
)
298-
299-
self.assertEqual(
300-
ctl_foo_bar_float3,
301-
textwrap.dedent(
302-
"""
303-
// Foo, Bar & Baz
304-
305-
// import "Foo.ctl";
306-
// import "Bar.ctl";
307-
// import "Baz.ctl";
308-
309281
float[3] baz(float rgbIn[3], float foo[3], float qux)
310282
{
311283
float rgbOut[3];
@@ -316,34 +288,58 @@ def test_template_ctl_transform_float3(self):
316288
317289
return rgbOut;
318290
}
319-
320-
void main
321-
(
322-
input varying float rIn,
323-
input varying float gIn,
324-
input varying float bIn,
325-
input varying float aIn,
326-
output varying float rOut,
327-
output varying float gOut,
328-
output varying float bOut,
329-
output varying float aOut,
330-
input float foo[3] = {1.0, 1.0, 1.0},
331-
input float bar = 1.0
332-
)
333-
{
334-
float rgbIn[3] = {rIn, gIn, bIn};
335-
336-
float rgbOut[3] = baz(rgbIn, foo, bar);
337-
338-
rOut = rgbOut[0];
339-
gOut = rgbOut[1];
340-
bOut = rgbOut[2];
341-
aOut = aIn;
342-
}"""[
291+
"""[
343292
1:
344293
]
345294
),
346295
)
296+
# fmt: off
297+
target = textwrap.dedent(
298+
"""
299+
// Foo, Bar & Baz
300+
301+
// import "Foo.ctl";
302+
// import "Bar.ctl";
303+
// import "Baz.ctl";
304+
305+
float[3] baz(float rgbIn[3], float foo[3], float qux)
306+
{
307+
float rgbOut[3];
308+
309+
rgbOut[0] = rgbIn[0] * foo[0]* qux;
310+
rgbOut[1] = rgbIn[1] * foo[1]* qux;
311+
rgbOut[2] = rgbIn[2] * foo[2]* qux;
312+
313+
return rgbOut;
314+
}
315+
316+
void main
317+
(
318+
output varying float rOut,
319+
output varying float gOut,
320+
output varying float bOut,
321+
output varying float aOut,
322+
input varying float rIn,
323+
input varying float gIn,
324+
input varying float bIn,
325+
input varying float aIn = 1.0,
326+
input float foo[3] = {1.0, 1.0, 1.0},
327+
input float bar = 1.0
328+
)
329+
{
330+
float rgbIn[3] = {rIn, gIn, bIn};
331+
332+
float rgbOut[3] = baz(rgbIn, foo, bar);
333+
334+
rOut = rgbOut[0];
335+
gOut = rgbOut[1];
336+
bOut = rgbOut[2];
337+
aOut = aIn;
338+
}"""[
339+
1:
340+
]
341+
)
342+
self.assertEqual(ctl_foo_bar_float3, target)
347343

348344

349345
if __name__ == "__main__":

0 commit comments

Comments
 (0)