Skip to content

Commit 0cf06c9

Browse files
committed
add scRGB support
improve RAD handling bump version see #65
1 parent 86f797d commit 0cf06c9

File tree

6 files changed

+83
-9
lines changed

6 files changed

+83
-9
lines changed

Diff for: ChangeLog

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
started 8.6.0 16/8/17
2+
- add scRGB support
3+
- improve radiance support
4+
15
started 8.5.1 22/1/17
26
- fix a crash bug
37
- make separate Image / Alpha menu, add Add, Extract, Drop

Diff for: configure.ac

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Process this file with autoconf to produce a configure script.
22

3-
AC_INIT([nip2], [8.5.1], [[email protected]])
3+
AC_INIT([nip2], [8.6.0], [[email protected]])
44

55
# foreign stops complaints about a missing README (we use README.md instead)
66
# and missing INSTALL (the standard Gnu INSTALL is not very useful)
@@ -16,8 +16,8 @@ dnl of them.
1616
dnl
1717

1818
m4_define([nip_major_version], [8])
19-
m4_define([nip_minor_version], [5])
20-
m4_define([nip_micro_version], [1])
19+
m4_define([nip_minor_version], [6])
20+
m4_define([nip_micro_version], [0])
2121
m4_define([nip_version],
2222
[nip_major_version.nip_minor_version.nip_micro_version])
2323

Diff for: share/nip2/start/Colour.def

+10
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ Colour_convert_item = class
8383
action x = conv Image_type.sRGB x;
8484
}
8585

86+
scRGB_item = class
87+
Menuaction (_ "_scRGB") (_ "convert to scRGB colourspace") {
88+
action x = conv Image_type.scRGB x;
89+
}
90+
8691
GREY16_item = class
8792
Menuaction (_ "_GREY16") (_ "convert to GREY16 colourspace") {
8893
action x = conv Image_type.GREY16 x;
@@ -155,6 +160,11 @@ Colour_tag_item = class
155160
action x = tag Image_type.sRGB x;
156161
}
157162

163+
scRGB_item = class
164+
Menuaction (_ "_scRGB") (_ "tag as being in scRGB colourspace") {
165+
action x = tag Image_type.scRGB x;
166+
}
167+
158168
RGB16_item = class
159169
Menuaction (_ "_RGB16") (_ "tag as being in RGB16 colourspace") {
160170
action x = tag Image_type.RGB16 x;

Diff for: share/nip2/start/_convert.def

+57-3
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,33 @@ im_RGB162GREY16 in
373373
im_GREY162RGB16 in
374374
= image_set_type Image_type.RGB16 (in ++ in ++ in);
375375

376+
/* The vips8 scRGB functions.
377+
*/
378+
379+
im_sRGB2scRGB in
380+
= out
381+
{
382+
[out] = vips_call "sRGB2scRGB" [in] [];
383+
}
384+
385+
im_scRGB2sRGB in
386+
= out
387+
{
388+
[out] = vips_call "scRGB2sRGB" [in] [];
389+
}
390+
391+
im_scRGB2XYZ in
392+
= out
393+
{
394+
[out] = vips_call "scRGB2XYZ" [in] [];
395+
}
396+
397+
im_XYZ2scRGB in
398+
= out
399+
{
400+
[out] = vips_call "XYZ2scRGB" [in] [];
401+
}
402+
376403
/* apply a func to an image ... make it 1 or 3 bands, and reapply other bands
377404
* on the way out. Except if it's LABPACK.
378405
*/
@@ -457,6 +484,7 @@ _colour_conversion_table = [
457484
[B_W, UCS, im_XYZ2UCS @ im_sRGB2XYZ @ im_mono2sRGB @ im_clip],
458485
[B_W, RGB, im_XYZ2disp @ im_sRGB2XYZ @ im_mono2sRGB @ im_clip],
459486
[B_W, sRGB, im_mono2sRGB @ im_clip],
487+
[B_W, scRGB, im_sRGB2scRGB @ im_mono2sRGB @ im_clip],
460488
[B_W, RGB16, image_set_type RGB16 @ im_8216 @ im_mono2sRGB],
461489
[B_W, GREY16, image_set_type GREY16 @ im_8216],
462490
[B_W, LABQ, im_Lab2LabQ @ im_sRGB2Lab @ im_mono2sRGB @ im_clip],
@@ -471,6 +499,7 @@ _colour_conversion_table = [
471499
[XYZ, UCS, im_XYZ2UCS @ im_clip2f],
472500
[XYZ, RGB, im_XYZ2disp @ im_clip2f],
473501
[XYZ, sRGB, im_XYZ2sRGB @ im_clip2f],
502+
[XYZ, scRGB, im_XYZ2scRGB @ im_clip2f],
474503
[XYZ, LABQ, im_Lab2LabQ @ im_XYZ2Lab @ im_clip2f],
475504
[XYZ, LABS, im_LabQ2LabS @ im_Lab2LabQ @ im_XYZ2Lab @ im_clip2f],
476505

@@ -482,6 +511,7 @@ _colour_conversion_table = [
482511
[YXY, UCS, im_XYZ2UCS @ im_Yxy2XYZ @ im_clip2f],
483512
[YXY, RGB, im_XYZ2disp @ im_Yxy2XYZ @ im_clip2f],
484513
[YXY, sRGB, im_XYZ2sRGB @ im_Yxy2XYZ @ im_clip2f],
514+
[YXY, scRGB, im_XYZ2scRGB @ im_Yxy2XYZ @ im_clip2f],
485515
[YXY, LABQ, im_Lab2LabQ @ im_XYZ2Lab @ im_Yxy2XYZ @ im_clip2f],
486516
[YXY, LABS, im_LabQ2LabS @ im_Lab2LabQ @ im_XYZ2Lab @ im_Yxy2XYZ @
487517
im_clip2f],
@@ -494,6 +524,7 @@ _colour_conversion_table = [
494524
[LAB, UCS, im_Lab2UCS @ im_clip2f],
495525
[LAB, RGB, im_Lab2disp @ im_clip2f],
496526
[LAB, sRGB, im_Lab2sRGB @ im_clip2f],
527+
[LAB, scRGB, im_XYZ2scRGB @ im_Lab2XYZ @ im_clip2f],
497528
[LAB, LABQ, im_Lab2LabQ @ im_clip2f],
498529
[LAB, LABS, im_Lab2LabS @ im_clip2f],
499530

@@ -505,6 +536,7 @@ _colour_conversion_table = [
505536
[LCH, UCS, im_LCh2UCS @ im_clip2f],
506537
[LCH, RGB, im_Lab2disp @ im_LCh2Lab @ im_clip2f],
507538
[LCH, sRGB, im_Lab2sRGB @ im_LCh2Lab @ im_clip2f],
539+
[LCH, scRGB, im_XYZ2scRGB @ im_Lab2XYZ @ im_LCh2Lab @ im_clip2f],
508540
[LCH, LABQ, im_Lab2LabQ @ im_LCh2Lab @ im_clip2f],
509541
[LCH, LABS, im_LabQ2LabS @ im_Lab2LabQ @ im_LCh2Lab @ im_clip2f],
510542

@@ -516,6 +548,7 @@ _colour_conversion_table = [
516548
[UCS, UCS, image_set_type UCS],
517549
[UCS, RGB, im_Lab2disp @ im_UCS2Lab @ im_clip2f],
518550
[UCS, sRGB, im_Lab2sRGB @ im_UCS2Lab @ im_clip2f],
551+
[UCS, scRGB, im_XYZ2scRGB @ im_Lab2XYZ @ im_UCS2Lab @ im_clip2f],
519552
[UCS, LABQ, im_Lab2LabQ @ im_UCS2Lab @ im_clip2f],
520553
[UCS, LABS, im_LabQ2LabS @ im_Lab2LabQ @ im_UCS2Lab @ im_clip2f],
521554

@@ -527,6 +560,7 @@ _colour_conversion_table = [
527560
[RGB, UCS, im_Lab2UCS @ im_disp2Lab @ im_clip],
528561
[RGB, RGB, image_set_type RGB],
529562
[RGB, sRGB, im_XYZ2sRGB @ im_disp2XYZ @ im_clip],
563+
[RGB, scRGB, im_XYZ2scRGB @ im_disp2XYZ @ im_clip],
530564
[RGB, RGB16, image_set_type RGB16 @ im_8216],
531565
[RGB, GREY16, image_set_type GREY16 @ im_8216 @ im_sRGB2mono],
532566
[RGB, LABQ, im_Lab2LabQ @ im_disp2Lab @ im_clip],
@@ -540,21 +574,39 @@ _colour_conversion_table = [
540574
[sRGB, UCS, im_XYZ2UCS @ im_sRGB2XYZ @ im_clip],
541575
[sRGB, RGB, im_XYZ2disp @ im_sRGB2XYZ @ im_clip],
542576
[sRGB, sRGB, image_set_type sRGB],
577+
[sRGB, scRGB, im_sRGB2scRGB @ im_clip],
543578
[sRGB, RGB16, image_set_type RGB16 @ im_8216],
544579
[sRGB, GREY16, image_set_type GREY16 @ im_8216 @ im_sRGB2mono],
545580
[sRGB, LABQ, im_Lab2LabQ @ im_sRGB2Lab @ im_clip],
546-
[sRGB, LABS, im_LabQ2LabS @ im_Lab2LabQ @ im_sRGB2Lab @ im_clip],
581+
[sRGB, LABS, im_Lab2LabS @ im_sRGB2Lab @ im_clip],
582+
583+
[scRGB, B_W, im_sRGB2mono @ im_scRGB2sRGB],
584+
[scRGB, XYZ, im_scRGB2XYZ],
585+
[scRGB, YXY, im_XYZ2Yxy @ im_scRGB2XYZ],
586+
[scRGB, LAB, im_XYZ2Lab @ im_scRGB2XYZ],
587+
[scRGB, LCH, im_Lab2LCh @ im_XYZ2Lab @ im_scRGB2XYZ],
588+
[scRGB, UCS, im_XYZ2UCS @ im_scRGB2XYZ],
589+
[scRGB, RGB, im_XYZ2disp @ im_scRGB2XYZ],
590+
[scRGB, sRGB, im_scRGB2sRGB],
591+
[scRGB, scRGB, image_set_type scRGB],
592+
[scRGB, RGB16, image_set_type RGB16 @ im_8216 @ im_scRGB2sRGB],
593+
[scRGB, GREY16, image_set_type GREY16 @ im_8216 @ im_sRGB2mono @
594+
im_scRGB2sRGB],
595+
[scRGB, LABQ, im_Lab2LabQ @ im_XYZ2Lab @ im_scRGB2XYZ],
596+
[scRGB, LABS, im_Lab2LabS @ im_XYZ2Lab @ im_scRGB2XYZ],
547597

548598
[RGB16, B_W, im_1628 @ im_sRGB2mono],
549599
[RGB16, RGB, image_set_type RGB @ im_1628],
550600
[RGB16, sRGB, image_set_type sRGB @ im_1628],
601+
[RGB16, scRGB, im_sRGB2scRGB],
551602
[RGB16, RGB16, image_set_type RGB16],
552603
[RGB16, GREY16, im_RGB162GREY16],
553604
[RGB16, LABS, im_LabQ2LabS @ im_Lab2LabQ @ im_sRGB2Lab],
554605

555606
[GREY16, B_W, image_set_type B_W @ im_1628],
556607
[GREY16, RGB, im_mono2sRGB @ im_1628],
557608
[GREY16, sRGB, im_mono2sRGB @ im_1628],
609+
[GREY16, scRGB, im_sRGB2scRGB @ im_mono2sRGB],
558610
[GREY16, RGB16, im_GREY162RGB16],
559611
[GREY16, GREY16, image_set_type GREY16],
560612

@@ -566,6 +618,7 @@ _colour_conversion_table = [
566618
[LABQ, UCS, im_Lab2UCS @ im_LabQ2Lab],
567619
[LABQ, RGB, im_LabQ2disp],
568620
[LABQ, sRGB, im_Lab2sRGB @ im_LabQ2Lab],
621+
[LABQ, scRGB, im_XYZ2scRGB @ im_Lab2XYZ @ im_LabQ2Lab],
569622
[LABQ, LABQ, image_set_type LABQ],
570623
[LABQ, LABS, im_LabQ2LabS],
571624

@@ -578,8 +631,8 @@ _colour_conversion_table = [
578631
[LABS, LCH, im_Lab2LCh @ im_LabQ2Lab @ im_LabS2LabQ @ im_clip2s],
579632
[LABS, UCS, im_Lab2UCS @ im_LabQ2Lab @ im_LabS2LabQ @ im_clip2s],
580633
[LABS, RGB, im_LabQ2disp @ im_LabS2LabQ @ im_clip2s],
581-
[LABS, sRGB, im_XYZ2sRGB @
582-
im_Lab2XYZ @ im_LabQ2Lab @ im_LabS2LabQ @ im_clip2s],
634+
[LABS, sRGB, im_XYZ2sRGB @ im_Lab2XYZ @ im_LabS2Lab @ im_clip2s],
635+
[LABS, scRGB, im_XYZ2scRGB @ im_Lab2XYZ @ im_LabS2Lab @ im_clip2s],
583636
[LABS, LABQ, im_LabS2LabQ @ im_clip2s],
584637
[LABS, LABS, image_set_type LABS]
585638
]
@@ -595,6 +648,7 @@ _colour_conversion_table = [
595648
UCS = 18;
596649
RGB = 17;
597650
sRGB = 22;
651+
scRGB = 28;
598652
RGB16 = 25;
599653
GREY16 = 26;
600654
LABQ = 16;

Diff for: share/nip2/start/_predicate.def

+2
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ get_type x
232232

233233
get_type_im im
234234
= Image_type.LABQ, coding == Image_coding.LABPACK
235+
= Image_type.scRGB, coding == Image_coding.RAD
235236
= Image_type.GREY16, type == Image_type.GREY16 && is_bands 1
236237
= Image_type.HISTOGRAM, type == Image_type.HISTOGRAM &&
237238
(width == 1 || height == 1)
@@ -252,6 +253,7 @@ get_type x
252253
// Colour/Convert To menu can make, excluding mono.
253254
ok_types = [
254255
Image_type.sRGB,
256+
Image_type.scRGB,
255257
Image_type.RGB16,
256258
Image_type.LAB,
257259
Image_type.LABQ,

Diff for: share/nip2/start/_types.def

+7-3
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,7 @@ Image_type = class {
816816
RGB16 = 25;
817817
GREY16 = 26;
818818
ARRAY = 27;
819+
scRGB = 28;
819820

820821
/* Table to get names <-> numbers.
821822
*/
@@ -836,15 +837,17 @@ Image_type = class {
836837
$FOURIER => FOURIER,
837838
$RGB16 => RGB16,
838839
$GREY16 => GREY16,
839-
$ARRAY => ARRAY
840+
$ARRAY => ARRAY,
841+
$scRGB => scRGB
840842
];
841843

842844
/* Table relating nip's colour space names and VIPS's Type numbers.
843-
* Options generated from this, so match the order to the order in the
844-
* Colour menu.
845+
* Options are generated from this, so match the order to the order in
846+
* the Colour menu.
845847
*/
846848
colour_spaces = Enum [
847849
$sRGB => sRGB,
850+
$scRGB => scRGB,
848851
$Lab => LAB,
849852
$LCh => LCH,
850853
$XYZ => XYZ,
@@ -858,6 +861,7 @@ Image_type = class {
858861
image_colour_spaces = Enum [
859862
$Mono => B_W,
860863
$sRGB => sRGB,
864+
$scRGB => scRGB,
861865
$RGB16 => RGB16,
862866
$GREY16 => GREY16,
863867
$Lab => LAB,

0 commit comments

Comments
 (0)