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" ] +} diff --git a/data-examples/dt3-layout.json b/data-examples/dt3-layout.json new file mode 100644 index 0000000..96341a5 --- /dev/null +++ b/data-examples/dt3-layout.json @@ -0,0 +1,12 @@ +// Layout specification for CMP Color Digital Target 3 +{ + "RowCount": 19, + "ColCount": 30, + "RelativeRowHeight": 1.0, + "RelativeColWidth": 1.0, + "HasColOffset": false, + + "WhitePatches": [ "R13" ], + "BlackPatches": [ "M08" ], + "MiddleGrayPatches": [ "O12" ] +} 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) 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} 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 diff --git a/src/dcamprof.c b/src/dcamprof.c index 36a00e7..822ec18 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 ")"); @@ -3544,6 +3545,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 +5022,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 +5050,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': @@ -5142,11 +5146,26 @@ 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); 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; 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)); 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,