From 36fec2d8a2aedfd70bde8144b6a72a2318e73cb6 Mon Sep 17 00:00:00 2001 From: Pascal de Bruijn Date: Mon, 18 Apr 2022 17:51:54 +0200 Subject: [PATCH 01/11] Fix deprecated uint8 datatype (should be uint8_t) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gcc -o tifio.o -c -I. -Wall -std=c99 -g -O2 -D_XOPEN_SOURCE=600 -D__EXTENSIONS__ -fopenmp -DDCAMPROF_VERSION=\"1.0.6\" tifio.c tifio.c: In function ‘tifio_rgbimg_save’: tifio.c:329:9: warning: ‘uint8’ is deprecated [-Wdeprecated-declarations] 329 | static const uint8 prophoto_icc[] = | ^~~~~~ --- src/tifio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tifio.c b/src/tifio.c index 628e666..2757a46 100644 --- a/src/tifio.c +++ b/src/tifio.c @@ -326,7 +326,7 @@ tifio_rgbimg_save(const char filename[], TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 3); TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_UINT); if (colorspace == COLORSPACE_PROPHOTO) { - static const uint8 prophoto_icc[] = + static const uint8_t prophoto_icc[] = { 0x00, 0x00, 0x03, 0xAC, 0x4B, 0x43, 0x4D, 0x53, 0x02, 0x10, 0x00, 0x00, 0x6D, 0x6E, 0x74, 0x72, 0x52, 0x47, 0x42, 0x20, 0x58, 0x59, 0x5A, 0x20, From 5b7979471ff63fc5803e7c871549552e2396e1be Mon Sep 17 00:00:00 2001 From: Pascal de Bruijn Date: Mon, 18 Apr 2022 17:56:09 +0200 Subject: [PATCH 02/11] Add layout for CMP Color Digital Target 3 --- data-examples/dt3-layout.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 data-examples/dt3-layout.json diff --git a/data-examples/dt3-layout.json b/data-examples/dt3-layout.json new file mode 100644 index 0000000..400c34c --- /dev/null +++ b/data-examples/dt3-layout.json @@ -0,0 +1,13 @@ +// Layout specification for CMP Color Digital Target 3 +// Can be used for flat-field correction and glare modeling +{ + "RowCount": 19, + "ColCount": 30, + "RelativeRowHeight": 1.0, + "RelativeColWidth": 1.0, + "HasColOffset": false, + + "WhitePatches": [ "R13" ], + "BlackPatches": [ "M08" ], + "MiddleGrayPatches": [ "O12" ] +} From 142d57536e5654ef0f7f301f1a66449691b51bf2 Mon Sep 17 00:00:00 2001 From: Pascal de Bruijn Date: Sun, 24 Apr 2022 16:46:25 +0200 Subject: [PATCH 03/11] Fix bad comment in layout for CMP Color Digital Target 3 --- data-examples/dt3-layout.json | 1 - 1 file changed, 1 deletion(-) diff --git a/data-examples/dt3-layout.json b/data-examples/dt3-layout.json index 400c34c..96341a5 100644 --- a/data-examples/dt3-layout.json +++ b/data-examples/dt3-layout.json @@ -1,5 +1,4 @@ // Layout specification for CMP Color Digital Target 3 -// Can be used for flat-field correction and glare modeling { "RowCount": 19, "ColCount": 30, From 420f9ff243d9117f353f5213c32cf65d621fa7ea Mon Sep 17 00:00:00 2001 From: Pascal de Bruijn Date: Sun, 24 Apr 2022 16:46:51 +0200 Subject: [PATCH 04/11] Add layout for LaserSoft DC Pro --- data-examples/dcpro-layout.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 data-examples/dcpro-layout.json diff --git a/data-examples/dcpro-layout.json b/data-examples/dcpro-layout.json new file mode 100644 index 0000000..a56e6b6 --- /dev/null +++ b/data-examples/dcpro-layout.json @@ -0,0 +1,13 @@ +// Layout specification for LaserSoft DC Pro layout +// Can be used for flat-field correction and glare modeling +{ + "RowCount": 10, + "ColCount": 14, + "RelativeRowHeight": 1.0, + "RelativeColWidth": 1.0, + "HasColOffset": false, + + "WhitePatches": [ "A08", "B01", "B14", "E08", "I01", "I14", "J03" ], + "BlackPatches": [ "A02", "A07", "A13", "C01", "C14", "E07", "F08", "H01", "H14", "J02", "J13" ], + "MiddleGrayPatches": [ "A04", "A11", "E01", "E14", "J09" ] +} From 0c1fe4cb43c0d4990c37daffbf3718f8853bc51f Mon Sep 17 00:00:00 2001 From: Pascal de Bruijn Date: Thu, 18 May 2023 14:51:25 +0200 Subject: [PATCH 05/11] make-dcp: add optional ProfileCalibrationSignature parameter --- src/dcamprof.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/dcamprof.c b/src/dcamprof.c index 36a00e7..d288d24 100644 --- a/src/dcamprof.c +++ b/src/dcamprof.c @@ -3544,6 +3544,7 @@ print_usage_and_exit(void) " -n \n" " -d \n" " -c \n" + " -s \n" " -b \n" " -B don't include default black render = none tag\n" " -i (default: from source profile)\n" @@ -5020,6 +5021,7 @@ main(int argc, const char *camera_name = NULL; const char *description = NULL; const char *copyright = NULL; + const char *calibration_signature = NULL; double baseline_exposure_offset = 0; bool skip_black_render_none = false; bool enable_3d_hsm = false; @@ -5047,6 +5049,7 @@ main(int argc, case 'n': camera_name = argv[++ai]; break; case 'd': description = argv[++ai]; break; case 'c': copyright = argv[++ai]; break; + case 's': calibration_signature = argv[++ai]; break; case 'b': baseline_exposure_offset = atof(argv[++ai]); has_beo = true; break; case 'B': skip_black_render_none = true; break; case 'i': @@ -5147,6 +5150,10 @@ main(int argc, free(dcp->copyright); dcp->copyright = strdup(copyright); } + if (calibration_signature != NULL) { + free(dcp->calibration_signature); + dcp->calibration_signature = strdup(calibration_signature); + } if (has_beo) { dcp->baseline_exposure_offset = baseline_exposure_offset; dcp->has.baseline_exposure_offset = true; From 6e764bb1fef9614f17c18f064b1603718c1b8184 Mon Sep 17 00:00:00 2001 From: Pascal de Bruijn Date: Thu, 18 May 2023 15:05:49 +0200 Subject: [PATCH 06/11] Remove confusing neutral tone repro operator reference --- src/dnglut.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dnglut.c b/src/dnglut.c index 3f4161b..2d3b570 100644 --- a/src/dnglut.c +++ b/src/dnglut.c @@ -189,7 +189,7 @@ dnglut_looktable_new(uint32_t hsmdims[3], enum gc_type gc_type, const struct tone_rep_op_config *ntro_conf) { - elog("Generating 3D LookTable with %dx%dx%d = %d entries for the neutral tone reproduction operator...\n 0%%", hcount, scount, vcount, hcount*scount*vcount); + elog("Generating 3D LookTable with %dx%dx%d = %d entries for the tone reproduction operator...\n 0%%", hcount, scount, vcount, hcount*scount*vcount); const m3x3 xyz2rgb = dcp_xyz_D50_to_prophoto_rgb; const m3x3 rgb2xyz = m3x3_invert(xyz2rgb); v3 *hsm = malloc(hcount * scount * vcount * sizeof(*hsm)); From 241d03942e2311467eb7ecc9017b9bbc025bb751 Mon Sep 17 00:00:00 2001 From: Pascal de Bruijn Date: Thu, 18 May 2023 15:11:16 +0200 Subject: [PATCH 07/11] make-dcp: add warning if unique camera name isn't set --- src/dcamprof.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dcamprof.c b/src/dcamprof.c index d288d24..84360cf 100644 --- a/src/dcamprof.c +++ b/src/dcamprof.c @@ -2344,6 +2344,7 @@ make_dcp(struct dcam_profile *prof, dcp->camera_model = strdup(prof->camera_name); } else { dcp->camera_model = strdup("Unknown Camera"); + elog("Warning: unique camera name should be set to exif make/model\n"); } dcp->profile_name = strdup("Generated by DCamProf v" DCAMPROF_VERSION); dcp->copyright = strdup("Copyright, the creator of this profile (generated by DCamProf v" DCAMPROF_VERSION ")"); From bdb236c4b43393b3ed69252abc831b54fcc248c5 Mon Sep 17 00:00:00 2001 From: Pascal de Bruijn Date: Thu, 18 May 2023 15:35:04 +0200 Subject: [PATCH 08/11] make-dcp: better default description behavior --- src/dcamprof.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/dcamprof.c b/src/dcamprof.c index 84360cf..822ec18 100644 --- a/src/dcamprof.c +++ b/src/dcamprof.c @@ -5146,6 +5146,17 @@ main(int argc, if (description != NULL) { free(dcp->profile_name); dcp->profile_name = strdup(description); + } else { + if (tc_type == TC_STANDARD) { + dcp->profile_name = strdup("Standard"); + } + if (tc_type == TC_STANDARD) { + if (ntro_conf == NULL) { + dcp->profile_name = strdup("Neutral"); + } else { + dcp->profile_name = strdup("Custom"); + } + } } if (copyright != NULL) { free(dcp->copyright); From e6a69fef483fe2d66239c9885c6ea7e22990e5bf Mon Sep 17 00:00:00 2001 From: Pascal de Bruijn Date: Thu, 18 May 2023 16:20:34 +0200 Subject: [PATCH 09/11] Makefile: support DESTDIR and PREFIX --- src/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Makefile b/src/Makefile index 024424f..36ea5d5 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,4 +1,4 @@ -INSTALL_PREFIX = /usr/local +PREFIX = /usr/local DCAMPROF_VERSION = $(shell cat VERSION) CC = gcc CFLAGS = -Wall -std=c99 -g -O2 -D_XOPEN_SOURCE=600 -D__EXTENSIONS__ -fopenmp @@ -50,8 +50,8 @@ dcamprof: $(DCAMPROF_OBJS) $(CC) -o $@ $(LDFLAGS) $(DCAMPROF_OBJS) -llcms2 -ltiff -lm install: $(PROGS) - install -d $(INSTALL_PREFIX)/bin - install $(PROGS) $(INSTALL_PREFIX)/bin + install -d $(DESTDIR)$(PREFIX)/bin + install $(PROGS) $(DESTDIR)$(PREFIX)/bin clean: rm -f $(DCAMPROF_OBJS) ${PROGS} From 69f91a578254c18f47f49d5befa23cbf954c9626 Mon Sep 17 00:00:00 2001 From: Pascal de Bruijn Date: Thu, 18 May 2023 18:16:13 +0200 Subject: [PATCH 10/11] Bump version to 1.0.7 --- src/VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/VERSION b/src/VERSION index af0b7dd..238d6e8 100644 --- a/src/VERSION +++ b/src/VERSION @@ -1 +1 @@ -1.0.6 +1.0.7 From a41872754f68ea81ca9b5b36a4cdf5a4d9ea7f87 Mon Sep 17 00:00:00 2001 From: Pascal de Bruijn Date: Thu, 18 May 2023 19:44:52 +0200 Subject: [PATCH 11/11] Add minimal debian packaging --- debian/changelog | 6 ++++++ debian/control | 11 +++++++++++ debian/docs | 1 + debian/install | 1 + debian/rules | 7 +++++++ debian/source/format | 1 + 6 files changed, 27 insertions(+) create mode 100644 debian/changelog create mode 100644 debian/control create mode 100644 debian/docs create mode 100644 debian/install create mode 100644 debian/rules create mode 100644 debian/source/format diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..4756de1 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,6 @@ +dcamprof (1.0.7) undefined; urgency=low + + * New release. + + -- John Doe Thu, 18 May 2023 17:46:29 +0200 + diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..10b77d8 --- /dev/null +++ b/debian/control @@ -0,0 +1,11 @@ +Source: dcamprof +Priority: optional +Section: graphics +Maintainer: John Doe +Build-Depends: debhelper-compat (= 13) +Standards-Version: 4.6.0 + +Package: dcamprof +Section: graphics +Architecture: any +Description: Digital Camera Profiler diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..f8d728c --- /dev/null +++ b/debian/docs @@ -0,0 +1 @@ +www diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..9c85114 --- /dev/null +++ b/debian/install @@ -0,0 +1 @@ +data-examples/* usr/share/dcamprof diff --git a/debian/rules b/debian/rules new file mode 100644 index 0000000..656f101 --- /dev/null +++ b/debian/rules @@ -0,0 +1,7 @@ +#!/usr/bin/make -f + +%: + dh $@ --sourcedirectory=src + +override_dh_auto_install: + dh_auto_install -- PREFIX=/usr diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..89ae9db --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (native)