@photivra/engine 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +3 -3
- package/CHANGELOG.md +12 -0
- package/CITATION.cff +1 -1
- package/CONTRIBUTING.md +3 -3
- package/NODE_SUPPORT.md +9 -9
- package/README.md +9 -7
- package/SECURITY.md +1 -1
- package/dist/core/version.d.ts +6 -11
- package/dist/core/version.d.ts.map +1 -1
- package/dist/core/version.js +6 -11
- package/dist/core/version.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/output/print-detail.d.ts +106 -0
- package/dist/output/print-detail.d.ts.map +1 -0
- package/dist/output/print-detail.js +215 -0
- package/dist/output/print-detail.js.map +1 -0
- package/dist/output/print-plan.d.ts +138 -0
- package/dist/output/print-plan.d.ts.map +1 -0
- package/dist/output/print-plan.js +305 -0
- package/dist/output/print-plan.js.map +1 -0
- package/docs/API_REFERENCE.md +38 -1
- package/docs/API_STYLE.md +11 -7
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/AUTOMATION_COORDINATION.md +1 -1
- package/docs/CAPTURE_COLOR.md +1 -1
- package/docs/CAPTURE_CORRECTED_SDR.md +1 -1
- package/docs/CAPTURE_EXPORT_METADATA.md +1 -1
- package/docs/CAPTURE_SDR.md +1 -1
- package/docs/DEVELOPERS.md +12 -6
- package/docs/DIGITAL_OPTICS_FOUNDATION.md +1 -1
- package/docs/ENVIRONMENT_RAW_CAPTURE.md +1 -1
- package/docs/EXPORT_ACCEPTANCE.md +1 -1
- package/docs/GENERIC_TIER_PRESETS.md +2 -2
- package/docs/GEOMETRIC_PREPARATION_REUSE.md +1 -1
- package/docs/IMAGE_FORMATION.md +1 -1
- package/docs/LINEAR_CAPTURE_ENCODING.md +1 -1
- package/docs/MOTION_AND_SIGNAL.md +1 -1
- package/docs/NUMERICAL_CORRECTNESS.md +1 -1
- package/docs/PERFORMANCE_BASELINE.md +1 -1
- package/docs/PHOTOGRAPHIC_EXPORT.md +1 -1
- package/docs/PHYSICS_FOUNDATION.md +1 -1
- package/docs/POC_API.md +1 -1
- package/docs/POC_PROJECTION_PLATFORM_REFERENCE.md +12 -0
- package/docs/POC_PROJECTION_REUSE.md +1 -1
- package/docs/PRINT_DETAIL_ASSESSMENT.md +81 -0
- package/docs/PRINT_DETAIL_SDR_EVIDENCE.md +29 -0
- package/docs/PRINT_DETAIL_VALIDATION.md +36 -0
- package/docs/PRINT_PLANNING.md +73 -0
- package/docs/PROCESSED_OUTPUT.md +1 -1
- package/docs/PRODUCTION_COMPOSITION.md +1 -1
- package/docs/PRODUCTION_ENVIRONMENT_CAPTURE.md +3 -3
- package/docs/PROVENANCE.md +1 -1
- package/docs/PSF_FOUNDATION.md +1 -1
- package/docs/RAW_FRAME_ENVELOPE.md +1 -1
- package/docs/RAW_FRAME_RECONSTRUCTION.md +2 -2
- package/docs/RELEASE_1_0.md +1 -0
- package/docs/RELEASE_1_0_1.md +61 -0
- package/docs/RELEASE_1_1_0.md +25 -0
- package/docs/RELEASE_AUDIT.md +1 -0
- package/docs/SCENE_RADIANCE_AND_ILLUMINATION.md +1 -1
- package/docs/SCENE_SENSOR_QUADRATURE.md +1 -1
- package/docs/SCENE_SENSOR_TEMPORAL_EXPOSURE.md +1 -1
- package/docs/SCIENTIFIC_ASSURANCE.md +1 -1
- package/docs/SCIENTIFIC_CONFORMANCE.md +1 -1
- package/docs/SDR_RENDERING.md +2 -2
- package/docs/SENSOR_ENVIRONMENT_QUERY.md +1 -1
- package/docs/SENSOR_EQE_LOCAL_EXPOSURE.md +1 -1
- package/docs/SENSOR_EQE_TEMPORAL_EXPOSURE.md +1 -1
- package/docs/SENSOR_PSF_QUADRATURE.md +1 -1
- package/docs/SENSOR_RAW_FRAME.md +2 -2
- package/docs/SENSOR_RAW_PRODUCER.md +1 -1
- package/docs/SIGNAL_CONFORMANCE.md +1 -1
- package/docs/SIMULATED_CAPTURE.md +1 -1
- package/docs/STABILIZATION.md +1 -1
- package/docs/TEMPORAL_PHOTO_RAW.md +1 -1
- package/docs/TIER_ACCEPTANCE.md +1 -1
- package/docs/TIER_PRESET_ACCEPTANCE.md +2 -2
- package/docs/USAGE.md +7 -1
- package/docs/V1_COMPOSITION_MAP.md +2 -2
- package/docs/V1_HELPER_REUSE_REVIEW.md +1 -1
- package/docs/V1_PERFORMANCE_DISPOSITION.md +1 -1
- package/docs/api/camera-equivalent-focal-length.md +1 -1
- package/docs/api/camera-field-of-view.md +1 -1
- package/docs/api/camera-projected-object-size.md +1 -1
- package/docs/api/capture-capture-export-metadata.md +1 -1
- package/docs/api/capture-environment-raw-producer.md +1 -1
- package/docs/api/capture-focus-control.md +1 -1
- package/docs/api/capture-linear-encoding.md +1 -1
- package/docs/api/capture-photographic-export.md +1 -1
- package/docs/api/capture-raw-frame-reconstruction.md +1 -1
- package/docs/api/capture-release-sequence.md +1 -1
- package/docs/api/capture-sensor-raw-frame.md +1 -1
- package/docs/api/capture-sensor-raw-producer.md +1 -1
- package/docs/api/capture-simulated-capture.md +1 -1
- package/docs/api/color-capture-color.md +1 -1
- package/docs/api/color-white-balance.md +1 -1
- package/docs/api/composition-image-formation-plan.md +1 -1
- package/docs/api/composition-plan-consumer.md +1 -1
- package/docs/api/core-calculation-result.md +1 -1
- package/docs/api/core-configuration-error.md +1 -1
- package/docs/api/core-image-formation.md +1 -1
- package/docs/api/core-scientific-assurance.md +1 -1
- package/docs/api/core-spectral-composition.md +1 -1
- package/docs/api/core-spectral.md +1 -1
- package/docs/api/core-validation.md +1 -1
- package/docs/api/core-version.md +6 -6
- package/docs/api/equipment-exposure-capabilities.md +1 -1
- package/docs/api/equipment-generic-tier-assets.md +1 -1
- package/docs/api/equipment-generic-tier-presets.md +1 -1
- package/docs/api/equipment-iso-capabilities.md +1 -1
- package/docs/api/equipment-metering-capabilities.md +1 -1
- package/docs/api/equipment-release-capabilities.md +1 -1
- package/docs/api/exports.json +117 -2
- package/docs/api/exposure-exposure-duration-control.md +1 -1
- package/docs/api/exposure-exposure-mode-resolver.md +1 -1
- package/docs/api/exposure-exposure.md +1 -1
- package/docs/api/exposure-flash.md +1 -1
- package/docs/api/exposure-metering-scene-radiance.md +1 -1
- package/docs/api/exposure-metering-target.md +1 -1
- package/docs/api/exposure-metering-temporal.md +1 -1
- package/docs/api/exposure-metering.md +1 -1
- package/docs/api/exposure-program-line.md +1 -1
- package/docs/api/motion-camera-rotation.md +1 -1
- package/docs/api/motion-capture-rotation-inverse-mapping.md +1 -1
- package/docs/api/motion-capture-rotation-temporal-quadrature.md +1 -1
- package/docs/api/motion-capture-rotation-trajectory.md +1 -1
- package/docs/api/motion-capture-translation-parallax-temporal-quadrature.md +1 -1
- package/docs/api/motion-extended-object-projection.md +1 -1
- package/docs/api/motion-projected-motion.md +1 -1
- package/docs/api/optics-aperture.md +1 -1
- package/docs/api/optics-circle-of-confusion.md +1 -1
- package/docs/api/optics-complex-pupil-psf.md +1 -1
- package/docs/api/optics-depth-of-field.md +1 -1
- package/docs/api/optics-diffraction.md +1 -1
- package/docs/api/optics-focus-breathing.md +1 -1
- package/docs/api/optics-focus-state.md +1 -1
- package/docs/api/optics-front-of-lens-filter.md +1 -1
- package/docs/api/optics-illumination-vignetting.md +1 -1
- package/docs/api/optics-lateral-chromatic-aberration.md +1 -1
- package/docs/api/optics-lens-psf-profile.md +1 -1
- package/docs/api/optics-polygon-diffraction.md +1 -1
- package/docs/api/optics-profile-contract.md +1 -1
- package/docs/api/optics-psf-foundation.md +1 -1
- package/docs/api/optics-radial-distortion.md +1 -1
- package/docs/api/optics-scene-to-sensor-irradiance.md +1 -1
- package/docs/api/optics-scene-to-sensor-quadrature.md +1 -1
- package/docs/api/optics-sensor-environment-query.md +1 -1
- package/docs/api/optics-sensor-psf-quadrature.md +1 -1
- package/docs/api/optics-stray-light.md +1 -1
- package/docs/api/optics-thin-lens.md +1 -1
- package/docs/api/output-capture-corrected-sdr.md +1 -1
- package/docs/api/output-capture-geometry.md +1 -1
- package/docs/api/output-capture-sdr.md +1 -1
- package/docs/api/output-crop.md +1 -1
- package/docs/api/output-geometric-transforms.md +1 -1
- package/docs/api/output-lens-corrections.md +1 -1
- package/docs/api/output-print-detail.md +147 -0
- package/docs/api/output-print-plan.md +165 -0
- package/docs/api/output-sdr-rendering.md +1 -1
- package/docs/api/output-subject-framing-crop.md +1 -1
- package/docs/api/schema-camera.md +1 -1
- package/docs/api/schema-illumination-spectral.md +1 -1
- package/docs/api/schema-illumination-temporal.md +1 -1
- package/docs/api/schema-illumination.md +1 -1
- package/docs/api/schema-scene-radiance-temporal.md +1 -1
- package/docs/api/schema-scene-radiance.md +1 -1
- package/docs/api/schema-scene.md +1 -1
- package/docs/api/schema-validation.md +1 -1
- package/docs/api/sensor-accumulated-charge.md +1 -1
- package/docs/api/sensor-architecture.md +1 -1
- package/docs/api/sensor-camera-saturation-capacity.md +1 -1
- package/docs/api/sensor-capture-color-sampling-binding.md +1 -1
- package/docs/api/sensor-capture-mode-timing.md +1 -1
- package/docs/api/sensor-capture-mode.md +1 -1
- package/docs/api/sensor-color-sampling.md +1 -1
- package/docs/api/sensor-constant-rate-temporal-integration.md +1 -1
- package/docs/api/sensor-dark-current.md +1 -1
- package/docs/api/sensor-environment-photo-signal.md +1 -1
- package/docs/api/sensor-eqe-electron-rate.md +1 -1
- package/docs/api/sensor-eqe-local-exposure.md +1 -1
- package/docs/api/sensor-eqe-temporal-exposure.md +1 -1
- package/docs/api/sensor-exposure-window.md +1 -1
- package/docs/api/sensor-iso-signal-chain.md +1 -1
- package/docs/api/sensor-local-exposure-binding.md +1 -1
- package/docs/api/sensor-optical-stack.md +1 -1
- package/docs/api/sensor-photon-energy.md +1 -1
- package/docs/api/sensor-physical-charge-capacity.md +1 -1
- package/docs/api/sensor-pixel-pitch.md +1 -1
- package/docs/api/sensor-radiometry-readiness.md +1 -1
- package/docs/api/sensor-raw-readout.md +1 -1
- package/docs/api/sensor-raw-reconstruction.md +1 -1
- package/docs/api/sensor-readout-exposure-linkage.md +1 -1
- package/docs/api/sensor-readout-timing.md +1 -1
- package/docs/api/sensor-response-application-compatibility.md +1 -1
- package/docs/api/sensor-response-operating-range.md +1 -1
- package/docs/api/sensor-responsivity-photocurrent.md +1 -1
- package/docs/api/sensor-sampling-aperture.md +1 -1
- package/docs/api/sensor-scene-eqe-temporal-exposure.md +1 -1
- package/docs/api/sensor-sensor-geometry.md +1 -1
- package/docs/api/sensor-signal-noise.md +1 -1
- package/docs/api/sensor-spatial-sample-reduction.md +1 -1
- package/docs/api/sensor-spatial-sampling-quadrature.md +1 -1
- package/docs/api/sensor-spatio-spectral-reduction.md +1 -1
- package/docs/api/sensor-spectral-coverage.md +1 -1
- package/docs/api/sensor-spectral-quadrature.md +1 -1
- package/docs/api/sensor-spectral-response.md +1 -1
- package/docs/api/sensor-temporal-photo-signal.md +1 -1
- package/docs/api/simulation-poc-simulation.md +1 -1
- package/docs/api/stabilization-camera-shake.md +1 -1
- package/docs/api/stabilization-system.md +1 -1
- package/docs/examples/quick-start.mjs +1 -1
- package/docs/validation/print-detail-capabilities.json +100 -0
- package/docs/validation/print-detail-sdr-evidence.json +81 -0
- package/package.json +1 -1
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/** Bounded regional Fourier diagnostic, not a perceived-quality or captured-MTF verdict.
|
|
3
|
+
* @see docs/PRINT_DETAIL_ASSESSMENT.md and docs/PRINT_DETAIL_VALIDATION.md.
|
|
4
|
+
*/
|
|
5
|
+
import { calculatedResult } from "../core/calculation-result.js";
|
|
6
|
+
import { InvalidConfigurationError } from "../core/configuration-error.js";
|
|
7
|
+
import { parseEvidenceList } from "../core/evidence-provenance.js";
|
|
8
|
+
import { freezeOwnedData } from "../core/owned-data.js";
|
|
9
|
+
import { requireAllowlistedRecord, requirePublicOpaqueId } from "../core/record-validation.js";
|
|
10
|
+
import { composeScientificAssurance } from "../core/scientific-assurance.js";
|
|
11
|
+
import { requirePositiveInteger } from "../core/validation.js";
|
|
12
|
+
import { ENGINE_API_VERSION } from "../core/version.js";
|
|
13
|
+
import { mapOrientedPhysicalUvToImagePlanePoint, resolveCaptureGeometry } from "./capture-geometry.js";
|
|
14
|
+
import { calculatePrintPlan, parsePrintPlanInput } from "./print-plan.js";
|
|
15
|
+
/** Metric/protocol identity; independent of the root creator version. */
|
|
16
|
+
export const PRINT_REGION_DETAIL_MODEL_VERSION = "0.1.0";
|
|
17
|
+
/** Work bound for one dense ROI, not an actual-device capability claim. */
|
|
18
|
+
export const MAX_PRINT_DETAIL_REGION_SAMPLES = 65536;
|
|
19
|
+
function record(value, keys) {
|
|
20
|
+
return requireAllowlistedRecord(value, keys, "Invalid or unknown Print detail fields.");
|
|
21
|
+
}
|
|
22
|
+
function finite(value) {
|
|
23
|
+
if (typeof value !== "number" || !Number.isFinite(value))
|
|
24
|
+
throw new InvalidConfigurationError("Print detail quantities must be finite numbers.");
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
function positive(value) {
|
|
28
|
+
const v = finite(value);
|
|
29
|
+
if (v <= 0)
|
|
30
|
+
throw new InvalidConfigurationError("Print detail quantity must be positive.");
|
|
31
|
+
return v;
|
|
32
|
+
}
|
|
33
|
+
function integer(value, nonnegative = false) {
|
|
34
|
+
const v = finite(value);
|
|
35
|
+
if (!Number.isSafeInteger(v) || (nonnegative && v < 0))
|
|
36
|
+
throw new InvalidConfigurationError("Print detail coordinates/counts must be safe integers.");
|
|
37
|
+
return v === 0 ? 0 : v;
|
|
38
|
+
}
|
|
39
|
+
function id(value) { return requirePublicOpaqueId(value, "Invalid public Print detail identity."); }
|
|
40
|
+
function choice(value, options) {
|
|
41
|
+
if (typeof value !== "string" || !options.includes(value))
|
|
42
|
+
throw new InvalidConfigurationError("Unknown Print detail enum.");
|
|
43
|
+
return value;
|
|
44
|
+
}
|
|
45
|
+
function raster(value) {
|
|
46
|
+
const r = record(value, ["pixelWidth", "pixelHeight"]);
|
|
47
|
+
const pixelWidth = integer(r.pixelWidth), pixelHeight = integer(r.pixelHeight);
|
|
48
|
+
requirePositiveInteger("pixelWidth", pixelWidth);
|
|
49
|
+
requirePositiveInteger("pixelHeight", pixelHeight);
|
|
50
|
+
return { pixelWidth, pixelHeight };
|
|
51
|
+
}
|
|
52
|
+
function nullableDistance(value) { return value === null ? null : positive(value); }
|
|
53
|
+
/** Parse/copy bounded, untrusted region/source/target data and existing Print geometry.
|
|
54
|
+
* Unknowns, sparse arrays and factual-reference-only numeric samples fail closed.
|
|
55
|
+
*/
|
|
56
|
+
export function parsePrintRegionDetailInput(value) {
|
|
57
|
+
const r = record(value, ["assessmentId", "print", "source", "region", "target", "samples"]);
|
|
58
|
+
const s = record(r.source, ["captureId", "representationId", "contentSha256", "raster", "stage", "domain", "registration", "processing", "noiseRealizationId", "evidence"]);
|
|
59
|
+
if (typeof s.contentSha256 !== "string" || !/^[a-f0-9]{64}$/.test(s.contentSha256))
|
|
60
|
+
throw new InvalidConfigurationError("Print detail source requires a lowercase SHA-256 declaration.");
|
|
61
|
+
const processing = record(s.processing, ["id", "version"]);
|
|
62
|
+
if (!Array.isArray(s.evidence) || s.evidence.length > 16)
|
|
63
|
+
throw new InvalidConfigurationError("Print detail evidence must be a bounded nonempty array.");
|
|
64
|
+
for (const entry of s.evidence)
|
|
65
|
+
record(entry, ["sourceOrigin", "sourceReference", "reuseStatus", "license", "note"]);
|
|
66
|
+
const evidence = parseEvidenceList(s.evidence, "printDetail.source.evidence");
|
|
67
|
+
if (evidence.some(e => e.reuseStatus === "factual-reference-only"))
|
|
68
|
+
throw new InvalidConfigurationError("Numeric sample data require owned/reusable provenance.");
|
|
69
|
+
const source = {
|
|
70
|
+
captureId: id(s.captureId), representationId: id(s.representationId), contentSha256: s.contentSha256,
|
|
71
|
+
raster: raster(s.raster), stage: choice(s.stage, ["native-retained-linear", "post-resampling-linear", "post-encoding-decoded-linear"]),
|
|
72
|
+
domain: choice(s.domain, ["relative-linear-luminance", "transfer-encoded-luma", "unknown"]),
|
|
73
|
+
registration: choice(s.registration, ["oriented-retained-unwarped", "correction-or-warp-unqualified"]),
|
|
74
|
+
processing: { id: id(processing.id), version: id(processing.version) },
|
|
75
|
+
noiseRealizationId: s.noiseRealizationId === null ? null : id(s.noiseRealizationId), evidence
|
|
76
|
+
};
|
|
77
|
+
const regionRecord = record(r.region, ["id", "rect", "role", "subjectDistanceM", "focusDistanceM"]);
|
|
78
|
+
const rr = record(regionRecord.rect, ["x", "y", "width", "height"]);
|
|
79
|
+
const rect = { x: integer(rr.x, true), y: integer(rr.y, true), width: integer(rr.width), height: integer(rr.height) };
|
|
80
|
+
requirePositiveInteger("region.width", rect.width);
|
|
81
|
+
requirePositiveInteger("region.height", rect.height);
|
|
82
|
+
// Subtraction avoids overflowing a safe-integer edge sum.
|
|
83
|
+
if (rect.x > source.raster.pixelWidth - rect.width || rect.y > source.raster.pixelHeight - rect.height)
|
|
84
|
+
throw new InvalidConfigurationError("Print region must fit the represented raster.");
|
|
85
|
+
const sampleCount = rect.width * rect.height;
|
|
86
|
+
if (!Number.isSafeInteger(sampleCount) || sampleCount > MAX_PRINT_DETAIL_REGION_SAMPLES || !Array.isArray(r.samples) || r.samples.length !== sampleCount)
|
|
87
|
+
throw new InvalidConfigurationError("Print detail requires a bounded exact row-major ROI array.");
|
|
88
|
+
const samples = Array.from({ length: sampleCount }, (_, i) => {
|
|
89
|
+
if (!Object.hasOwn(r.samples, i))
|
|
90
|
+
throw new InvalidConfigurationError("Sparse Print detail sample arrays are unsupported.");
|
|
91
|
+
return finite(r.samples[i]);
|
|
92
|
+
});
|
|
93
|
+
const region = { id: id(regionRecord.id), rect, role: choice(regionRecord.role, ["selected-subject", "field-diagnostic", "intentional-defocus"]), subjectDistanceM: nullableDistance(regionRecord.subjectDistanceM), focusDistanceM: nullableDistance(regionRecord.focusDistanceM) };
|
|
94
|
+
const t = record(r.target, ["id", "version", "kind", "cyclesAcrossRegion", "referenceModulation"]);
|
|
95
|
+
const cycles = record(t.cyclesAcrossRegion, ["x", "y"]);
|
|
96
|
+
const referenceModulation = positive(t.referenceModulation);
|
|
97
|
+
if (referenceModulation > 1)
|
|
98
|
+
throw new InvalidConfigurationError("Reference modulation must be at most one.");
|
|
99
|
+
const target = { id: id(t.id), version: id(t.version), kind: choice(t.kind, ["coherent-sinusoid"]), cyclesAcrossRegion: { x: integer(cycles.x), y: integer(cycles.y) }, referenceModulation };
|
|
100
|
+
return { assessmentId: id(r.assessmentId), print: parsePrintPlanInput(r.print), source, region, target, samples };
|
|
101
|
+
}
|
|
102
|
+
/** Compensated sum of normalized bounded values; no image transformation is applied. */
|
|
103
|
+
class Sum {
|
|
104
|
+
total = 0;
|
|
105
|
+
correction = 0;
|
|
106
|
+
get value() { return this.total + this.correction; }
|
|
107
|
+
add(value) {
|
|
108
|
+
const next = this.total + value;
|
|
109
|
+
this.correction += Math.abs(this.total) >= Math.abs(value) ? (this.total - next) + value : (value - next) + this.total;
|
|
110
|
+
this.total = next;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function phase(x, y, width, height, kx, ky) {
|
|
114
|
+
return 2 * Math.PI * ((kx * x / width + ky * y / height) % 1);
|
|
115
|
+
}
|
|
116
|
+
function finiteValues(...values) { return values.every(v => Number.isFinite(v)); }
|
|
117
|
+
/** Calculate one coherent regional fundamental and its print reference scale.
|
|
118
|
+
* Acquisition remains unknown; no MTF, noise, compression or perceptual pass is produced.
|
|
119
|
+
*/
|
|
120
|
+
export function calculatePrintRegionDetail(value) {
|
|
121
|
+
const input = parsePrintRegionDetailInput(value), print = calculatePrintPlan(input.print).value;
|
|
122
|
+
const result = {
|
|
123
|
+
assessmentId: input.assessmentId, engineApiVersion: ENGINE_API_VERSION, modelVersion: PRINT_REGION_DETAIL_MODEL_VERSION,
|
|
124
|
+
input, print, status: "blocked", blockers: [], measurement: null, projection: null, assessedRasterMatchesRecommendation: false,
|
|
125
|
+
sourceArtifactVerification: "caller-declared-unverified",
|
|
126
|
+
assurance: composeScientificAssurance({ components: [{ componentId: "region-acquisition", role: "source-target-stage-registration", required: true,
|
|
127
|
+
sourceIdentity: { kind: "result", id: input.source.representationId, version: input.source.processing.version },
|
|
128
|
+
basisKind: "evidence-backed-fact", scientificStatus: "unknown", evidenceRequirement: "required", evidence: input.source.evidence,
|
|
129
|
+
uncertainty: { kind: "unknown", limitation: "Acquisition, decoding, target truth and physical applicability are not independently verified by this diagnostic." },
|
|
130
|
+
limitations: ["Evidence and SHA-256 are declarations; analytic conformance is not renderer qualification."] }] }),
|
|
131
|
+
unassessed: ["captured-system-mtf", "optical-motion-attribution", "noise", "aliasing", "halos", "compression", "color", "perceived-quality", "printer-substrate"], overallPrintVerdict: "not-offered"
|
|
132
|
+
};
|
|
133
|
+
const finish = () => freezeOwnedData(calculatedResult(result, "regional-coherent-print-detail", PRINT_REGION_DETAIL_MODEL_VERSION, ["Known coherent grating, scalar linear luminance and explicit unwarped region registration are caller declarations.", "Fourier modulation is a directional regional diagnostic, not an overall quality or visibility score.", "Angular period is at the normal image-center reference, not a field-dependent retinal metric."]));
|
|
134
|
+
const unsupported = (reason) => { result.status = "unsupported"; result.blockers.push(reason); return finish(); };
|
|
135
|
+
if (input.print.source.kind === "unavailable") {
|
|
136
|
+
result.blockers.push("missing-authoritative-native-geometry");
|
|
137
|
+
return finish();
|
|
138
|
+
}
|
|
139
|
+
if (print.status === "unsupported")
|
|
140
|
+
return unsupported("print-geometry-unsupported");
|
|
141
|
+
if (print.status === "crop-confirmation-required") {
|
|
142
|
+
result.blockers.push("print-crop-confirmation-required");
|
|
143
|
+
return finish();
|
|
144
|
+
}
|
|
145
|
+
if (input.source.captureId !== input.print.source.captureId) {
|
|
146
|
+
result.blockers.push("capture-identity-mismatch");
|
|
147
|
+
return finish();
|
|
148
|
+
}
|
|
149
|
+
if (input.source.domain !== "relative-linear-luminance")
|
|
150
|
+
return unsupported("linear-luminance-domain-required");
|
|
151
|
+
if (input.source.registration !== "oriented-retained-unwarped")
|
|
152
|
+
return unsupported("correction-warp-registration-unqualified");
|
|
153
|
+
const geometry = resolveCaptureGeometry(input.print.source.geometry).value;
|
|
154
|
+
const native = { pixelWidth: geometry.output.cropRect.width, pixelHeight: geometry.output.cropRect.height }, actual = input.source.raster;
|
|
155
|
+
if (input.source.stage === "native-retained-linear" && (actual.pixelWidth !== native.pixelWidth || actual.pixelHeight !== native.pixelHeight)) {
|
|
156
|
+
result.blockers.push("native-representation-raster-mismatch");
|
|
157
|
+
return finish();
|
|
158
|
+
}
|
|
159
|
+
if (actual.pixelWidth > native.pixelWidth || actual.pixelHeight > native.pixelHeight) {
|
|
160
|
+
result.blockers.push("represented-native-upscale-unsupported");
|
|
161
|
+
return finish();
|
|
162
|
+
}
|
|
163
|
+
if (BigInt(actual.pixelWidth) * BigInt(native.pixelHeight) !== BigInt(actual.pixelHeight) * BigInt(native.pixelWidth)) {
|
|
164
|
+
result.blockers.push("represented-retained-aspect-mismatch");
|
|
165
|
+
return finish();
|
|
166
|
+
}
|
|
167
|
+
const { width, height } = input.region.rect, { x: kx, y: ky } = input.target.cyclesAcrossRegion;
|
|
168
|
+
if ((kx === 0 && ky === 0) || Math.abs(kx) >= width / 2 || Math.abs(ky) >= height / 2)
|
|
169
|
+
return unsupported("dc-nyquist-or-aliased-frequency-unsupported");
|
|
170
|
+
let scale = 0;
|
|
171
|
+
for (const v of input.samples)
|
|
172
|
+
scale = Math.max(scale, Math.abs(v));
|
|
173
|
+
if (scale === 0)
|
|
174
|
+
return unsupported("nonpositive-region-mean");
|
|
175
|
+
if (input.samples.some(v => v !== 0 && v / scale === 0))
|
|
176
|
+
return unsupported("measurement-dynamic-range-unsupported");
|
|
177
|
+
const dc = new Sum(), cosine = new Sum(), sine = new Sum(), count = input.samples.length;
|
|
178
|
+
for (let y = 0; y < height; y++)
|
|
179
|
+
for (let x = 0; x < width; x++) {
|
|
180
|
+
const v = input.samples[y * width + x] / scale, angle = phase(x, y, width, height, kx, ky);
|
|
181
|
+
dc.add(v);
|
|
182
|
+
cosine.add(v * Math.cos(angle));
|
|
183
|
+
sine.add(v * Math.sin(angle));
|
|
184
|
+
}
|
|
185
|
+
const mean = dc.value / count;
|
|
186
|
+
if (mean <= 0)
|
|
187
|
+
return unsupported("nonpositive-region-mean");
|
|
188
|
+
const a = 2 * cosine.value / count, b = 2 * sine.value / count, amplitude = Math.hypot(a, b);
|
|
189
|
+
let residualNorm = 0;
|
|
190
|
+
for (let y = 0; y < height; y++)
|
|
191
|
+
for (let x = 0; x < width; x++) {
|
|
192
|
+
const angle = phase(x, y, width, height, kx, ky);
|
|
193
|
+
const r = input.samples[y * width + x] / scale - mean - a * Math.cos(angle) - b * Math.sin(angle);
|
|
194
|
+
residualNorm = Math.hypot(residualNorm, r);
|
|
195
|
+
}
|
|
196
|
+
const measurement = { meanRelativeLuminance: scale * mean, fundamentalAmplitudeRelativeLuminance: scale * amplitude,
|
|
197
|
+
fundamentalModulation: amplitude / mean, declaredGratingTransfer: amplitude / mean / input.target.referenceModulation,
|
|
198
|
+
unexplainedResidualRmsRelativeToMean: residualNorm / Math.sqrt(count) / mean };
|
|
199
|
+
if (!finiteValues(...Object.values(measurement)) || measurement.meanRelativeLuminance <= 0 || (amplitude > 0 && measurement.fundamentalAmplitudeRelativeLuminance === 0))
|
|
200
|
+
return unsupported("measurement-numeric-range-unsupported");
|
|
201
|
+
const image = print.printedImageMm, distance = print.viewingDistanceMm;
|
|
202
|
+
const fx = kx / (width / actual.pixelWidth * image.width), fy = ky / (height / actual.pixelHeight * image.height);
|
|
203
|
+
const frequency = Math.hypot(fx, fy), period = 1 / frequency;
|
|
204
|
+
const angularPeriod = 2 * Math.atan((period / distance) / 2) * 180 / Math.PI;
|
|
205
|
+
if (!finiteValues(fx, fy, period, angularPeriod) || period <= 0 || angularPeriod <= 0)
|
|
206
|
+
return unsupported("projection-numeric-range-unsupported");
|
|
207
|
+
const rect = input.region.rect;
|
|
208
|
+
const fieldPointMm = mapOrientedPhysicalUvToImagePlanePoint({ uv: { u: (rect.x + width / 2) / actual.pixelWidth, v: (rect.y + height / 2) / actual.pixelHeight }, orientation: input.print.source.geometry.orientation, orientedPhysicalBoundsFromOpticalAxisMm: geometry.output.physicalBoundsFromOpticalAxisMm });
|
|
209
|
+
result.measurement = measurement;
|
|
210
|
+
result.projection = { fieldPointMm, frequencyCyclesPerMm: { x: fx === 0 ? 0 : fx, y: fy === 0 ? 0 : fy }, physicalPeriodMm: period, angularPeriodAtImageCenterDegrees: angularPeriod };
|
|
211
|
+
result.assessedRasterMatchesRecommendation = print.recommended !== null && actual.pixelWidth === print.recommended.raster.pixelWidth && actual.pixelHeight === print.recommended.raster.pixelHeight;
|
|
212
|
+
result.status = "diagnostic-only";
|
|
213
|
+
return finish();
|
|
214
|
+
}
|
|
215
|
+
//# sourceMappingURL=print-detail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"print-detail.js","sourceRoot":"","sources":["../../src/output/print-detail.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAA0B,MAAM,+BAA+B,CAAC;AACzF,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAA2B,MAAM,gCAAgC,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC/F,OAAO,EAAE,0BAA0B,EAAoC,MAAM,iCAAiC,CAAC;AAC/G,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EAAE,sCAAsC,EAAE,sBAAsB,EAAmB,MAAM,uBAAuB,CAAC;AACxH,OAAO,EAAE,kBAAkB,EAAE,mBA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AE,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,gBAAgB,EAAE,MAAM,EAAE,iCAAiC,EAAE,aAAa,EAAE,CAAC;IACvL,MAAM,CAAC,mCAAmC,GAAG,KAAK,CAAC,WAAW,KAAK,IAAI,IAAI,MAAM,CAAC,UAAU,KAAK,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,IAAI,MAAM,CAAC,WAAW,KAAK,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC;IACpM,MAAM,CAAC,MAAM,GAAG,iBAAiB,CAAC;IAAC,OAAO,MAAM,EAAE,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/** Native-only print geometry. No image generation or perceived-quality certification.
|
|
2
|
+
* @see docs/PRINT_PLANNING.md for equations, rounding and support limits.
|
|
3
|
+
*/
|
|
4
|
+
import { type CalculationResult } from "../core/calculation-result.js";
|
|
5
|
+
import { type ResolveCaptureGeometryInput } from "./capture-geometry.js";
|
|
6
|
+
import type { RasterDimensions } from "../sensor/sensor-geometry.js";
|
|
7
|
+
/** Physical length, separate from raster pixels and printer dots. */
|
|
8
|
+
export interface PrintLength {
|
|
9
|
+
value: number;
|
|
10
|
+
unit: "mm" | "cm" | "inches" | "m";
|
|
11
|
+
}
|
|
12
|
+
/** Flat printed image area; excludes paper, borders and wraps. */
|
|
13
|
+
export interface PrintedImageSize {
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
unit: PrintLength["unit"];
|
|
17
|
+
}
|
|
18
|
+
/** Explicit angular convention; manual PPI starts a different plan. */
|
|
19
|
+
export type PrintSamplingCriterion = {
|
|
20
|
+
kind: "angular-pixel-pitch";
|
|
21
|
+
maximumArcminutesPerPixel: number;
|
|
22
|
+
} | {
|
|
23
|
+
kind: "angular-stroke";
|
|
24
|
+
strokeWidthArcminutes: number;
|
|
25
|
+
samplesPerStroke: number;
|
|
26
|
+
} | {
|
|
27
|
+
kind: "angular-line-pair";
|
|
28
|
+
periodArcminutes: number;
|
|
29
|
+
samplesPerPeriod: number;
|
|
30
|
+
} | {
|
|
31
|
+
kind: "manual-ppi";
|
|
32
|
+
pixelsPerInch: number;
|
|
33
|
+
};
|
|
34
|
+
/** Declared authoritative geometry, not a preview or resampled pixel count. */
|
|
35
|
+
export type PrintNativeSource = {
|
|
36
|
+
kind: "native-retained";
|
|
37
|
+
captureId: string;
|
|
38
|
+
geometry: ResolveCaptureGeometryInput;
|
|
39
|
+
} | {
|
|
40
|
+
kind: "unavailable";
|
|
41
|
+
reason: "missing-native-raster" | "unverified-native-identity";
|
|
42
|
+
};
|
|
43
|
+
/** Caller-supplied lab constraints; no vendor catalog or delivery guarantee. */
|
|
44
|
+
export interface PrintProviderConstraints {
|
|
45
|
+
minimumRaster?: RasterDimensions;
|
|
46
|
+
exactRaster?: RasterDimensions;
|
|
47
|
+
minimumPpi?: number;
|
|
48
|
+
exactPpi?: number;
|
|
49
|
+
}
|
|
50
|
+
/** Exact-ratio output policy. Physical aspect tolerance is explicit and reported. */
|
|
51
|
+
export interface PrintPlanInput {
|
|
52
|
+
source: PrintNativeSource;
|
|
53
|
+
printedImage: PrintedImageSize;
|
|
54
|
+
viewingDistance: PrintLength;
|
|
55
|
+
sampling: PrintSamplingCriterion;
|
|
56
|
+
fit: {
|
|
57
|
+
kind: "confirmed-native-aspect";
|
|
58
|
+
maximumRelativeAspectError: number;
|
|
59
|
+
};
|
|
60
|
+
provider?: PrintProviderConstraints;
|
|
61
|
+
}
|
|
62
|
+
/** Per-axis density and angular pitch; angular values are geometry, not acuity. */
|
|
63
|
+
export interface PrintRasterSampling {
|
|
64
|
+
raster: RasterDimensions;
|
|
65
|
+
pixelsPerInch: {
|
|
66
|
+
x: number;
|
|
67
|
+
y: number;
|
|
68
|
+
};
|
|
69
|
+
angularPixelPitchArcminutes: {
|
|
70
|
+
x: number;
|
|
71
|
+
y: number;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/** Finite conditional plan. Null recommendation never authorizes an upscale. */
|
|
75
|
+
export interface PrintPlan {
|
|
76
|
+
engineApiVersion: string;
|
|
77
|
+
input: PrintPlanInput;
|
|
78
|
+
status: "ready" | "insufficient-native-pixels" | "provider-conflict" | "crop-confirmation-required" | "cannot-assess" | "unsupported";
|
|
79
|
+
nativePixelSufficiency: "sufficient" | "insufficient" | "cannot-assess";
|
|
80
|
+
reasons: string[];
|
|
81
|
+
printedImageMm: {
|
|
82
|
+
width: number;
|
|
83
|
+
height: number;
|
|
84
|
+
} | null;
|
|
85
|
+
viewingDistanceMm: number | null;
|
|
86
|
+
guidance: CalculationResult<{
|
|
87
|
+
derivedPixelsPerInch: number;
|
|
88
|
+
maximumPixelPitchMm: number;
|
|
89
|
+
maximumArcminutesPerPixel: number | null;
|
|
90
|
+
}> | null;
|
|
91
|
+
relativeAspectError: number | null;
|
|
92
|
+
native: PrintRasterSampling | null;
|
|
93
|
+
minimumSamplingRaster: RasterDimensions | null;
|
|
94
|
+
recommended: PrintRasterSampling | null;
|
|
95
|
+
resamplingScale: {
|
|
96
|
+
x: number;
|
|
97
|
+
y: number;
|
|
98
|
+
} | null;
|
|
99
|
+
alternatives: {
|
|
100
|
+
maximumImageMmAtCurrentDistance: {
|
|
101
|
+
width: number;
|
|
102
|
+
height: number;
|
|
103
|
+
};
|
|
104
|
+
minimumViewingDistanceMmAtCurrentSize: number | null;
|
|
105
|
+
} | null;
|
|
106
|
+
capturedDetailAssessment: "unassessed";
|
|
107
|
+
deliveryAssessment: "unassessed";
|
|
108
|
+
}
|
|
109
|
+
/** Validate and copy an untrusted Print request; never infer native authority. */
|
|
110
|
+
export declare function parsePrintPlanInput(value: unknown): PrintPlanInput;
|
|
111
|
+
/** Resolve the minimum exact-native-ratio file under declared sampling/lab constraints.
|
|
112
|
+
* Angular guidance is approximate as a usage criterion; geometry is calculated.
|
|
113
|
+
* No source detail, perceived quality, serializer or resource availability is assessed.
|
|
114
|
+
*/
|
|
115
|
+
export declare function calculatePrintPlan(value: PrintPlanInput): CalculationResult<PrintPlan>;
|
|
116
|
+
/** Size-limit query retains the reference image aspect and criterion.
|
|
117
|
+
* Proportional viewing scales the supplied reference distance with both image axes.
|
|
118
|
+
*/
|
|
119
|
+
export interface PrintSizeLimitInput {
|
|
120
|
+
plan: PrintPlanInput;
|
|
121
|
+
viewingDistancePolicy: "fixed" | "proportional-to-image-size";
|
|
122
|
+
}
|
|
123
|
+
/** Semantic bounds avoid Infinity sentinels; no-positive-size differs from invalid input. */
|
|
124
|
+
export interface PrintSizeLimit {
|
|
125
|
+
engineApiVersion: string;
|
|
126
|
+
status: "finite" | "unbounded" | "no-positive-size" | "cannot-assess" | "unsupported";
|
|
127
|
+
maximumImageMm: {
|
|
128
|
+
width: number;
|
|
129
|
+
height: number;
|
|
130
|
+
} | null;
|
|
131
|
+
reasons: string[];
|
|
132
|
+
referencePlan: PrintPlan;
|
|
133
|
+
}
|
|
134
|
+
/** Calculate a conditional size bound. Lab constraints require individual plans;
|
|
135
|
+
* this first size-query contract reports them as unsupported rather than ignoring them.
|
|
136
|
+
*/
|
|
137
|
+
export declare function calculatePrintSizeLimit(value: PrintSizeLimitInput): CalculationResult<PrintSizeLimit>;
|
|
138
|
+
//# sourceMappingURL=print-plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"print-plan.d.ts","sourceRoot":"","sources":["../../src/output/print-plan.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,OAAO,EAAyC,KAAK,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAK9G,OAAO,EAA0B,KAAK,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACjG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE,qEAAqE;AACrE,MAAM,WAAW,WAAW;IAAG,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,IAA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