@photivra/engine 1.0.1 → 1.2.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/CHANGELOG.md +14 -0
- package/CITATION.cff +1 -1
- package/NOTICE +29 -0
- package/README.md +8 -6
- package/THIRD_PARTY.md +10 -0
- package/dist/core/version.d.ts +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/optics/complex-pupil-psf.d.ts +6 -0
- package/dist/optics/complex-pupil-psf.d.ts.map +1 -1
- package/dist/optics/complex-pupil-psf.js +10 -7
- package/dist/optics/complex-pupil-psf.js.map +1 -1
- package/dist/output/native-capture-sdr.d.ts +78 -0
- package/dist/output/native-capture-sdr.d.ts.map +1 -0
- package/dist/output/native-capture-sdr.js +171 -0
- package/dist/output/native-capture-sdr.js.map +1 -0
- package/dist/output/print-contrast-reference.d.ts +47 -0
- package/dist/output/print-contrast-reference.d.ts.map +1 -0
- package/dist/output/print-contrast-reference.js +95 -0
- package/dist/output/print-contrast-reference.js.map +1 -0
- package/dist/output/print-detail.d.ts +113 -0
- package/dist/output/print-detail.d.ts.map +1 -0
- package/dist/output/print-detail.js +224 -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/dist/output/print-region-statistics.d.ts +92 -0
- package/dist/output/print-region-statistics.d.ts.map +1 -0
- package/dist/output/print-region-statistics.js +300 -0
- package/dist/output/print-region-statistics.js.map +1 -0
- package/docs/API_REFERENCE.md +89 -1
- package/docs/API_STYLE.md +1 -1
- 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 +3 -1
- package/docs/DEVELOPERS.md +12 -4
- 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 +1 -1
- 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/NATIVE_CAPTURE_SDR.md +70 -0
- package/docs/NATIVE_CAPTURE_SDR_REVIEW.md +37 -0
- package/docs/NATIVE_CAPTURE_SDR_VALIDATION.md +34 -0
- 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_195_196_REVIEW.md +93 -0
- package/docs/PRINT_196_ENGINE_ACCEPTANCE.md +45 -0
- package/docs/PRINT_CONTRAST_REFERENCE.md +43 -0
- package/docs/PRINT_DETAIL_ASSESSMENT.md +81 -0
- package/docs/PRINT_DETAIL_JPEG_EVIDENCE.md +36 -0
- package/docs/PRINT_DETAIL_SDR_EVIDENCE.md +29 -0
- package/docs/PRINT_DETAIL_VALIDATION.md +36 -0
- package/docs/PRINT_PLANNING.md +75 -0
- package/docs/PRINT_REGION_STATISTICS.md +38 -0
- package/docs/PROCESSED_OUTPUT.md +1 -1
- package/docs/PRODUCTION_COMPOSITION.md +1 -1
- package/docs/PRODUCTION_ENVIRONMENT_CAPTURE.md +1 -1
- package/docs/PROVENANCE.md +1 -1
- package/docs/PSF_FOUNDATION.md +11 -1
- package/docs/RAW_FRAME_ENVELOPE.md +1 -1
- package/docs/RAW_FRAME_RECONSTRUCTION.md +1 -1
- package/docs/RELEASE_1_1_0.md +25 -0
- package/docs/RELEASE_1_2_0.md +51 -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 +1 -1
- 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 +1 -1
- 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 +1 -1
- package/docs/USAGE.md +9 -1
- package/docs/V1_COMPOSITION_MAP.md +1 -1
- 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 +2 -2
- 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 +267 -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 +7 -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-native-capture-sdr.md +150 -0
- package/docs/api/output-print-contrast-reference.md +82 -0
- package/docs/api/output-print-detail.md +147 -0
- package/docs/api/output-print-plan.md +165 -0
- package/docs/api/output-print-region-statistics.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/licenses/castleCSF-MIT.txt +21 -0
- package/docs/validation/native-capture-sdr-darwin-arm64-node26-review.jsonl +4 -0
- package/docs/validation/native-capture-sdr-darwin-arm64.jsonl +3 -0
- package/docs/validation/print-196-candidate-capabilities.json +28 -0
- package/docs/validation/print-196-candidate-evidence.json +356 -0
- package/docs/validation/print-196-engine-acceptance.json +81 -0
- package/docs/validation/print-detail-capabilities.json +103 -0
- package/docs/validation/print-detail-jpeg-evidence.json +116 -0
- package/docs/validation/print-detail-sdr-evidence.json +81 -0
- package/package.json +1 -1
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/** Bounded linear-region processing differences and repeat-capture statistics.
|
|
3
|
+
* @see docs/PRINT_REGION_STATISTICS.md for the model, protocol and exclusions.
|
|
4
|
+
*/
|
|
5
|
+
import { calculatedResult } from "../core/calculation-result.js";
|
|
6
|
+
import { InvalidConfigurationError } from "../core/configuration-error.js";
|
|
7
|
+
import { freezeOwnedData } from "../core/owned-data.js";
|
|
8
|
+
import { requireAllowlistedRecord, requirePublicOpaqueId } from "../core/record-validation.js";
|
|
9
|
+
import { ENGINE_API_VERSION } from "../core/version.js";
|
|
10
|
+
import { parsePrintDetailSource, parsePrintDetailRegion, MAX_PRINT_DETAIL_REGION_SAMPLES } from "./print-detail.js";
|
|
11
|
+
import { resolveCaptureGeometry } from "./capture-geometry.js";
|
|
12
|
+
import { calculatePrintPlan, parsePrintPlanInput } from "./print-plan.js";
|
|
13
|
+
/** Independent of the root distribution and coherent-detail protocol. */
|
|
14
|
+
export const PRINT_REGION_STATISTICS_MODEL_VERSION = "0.1.0";
|
|
15
|
+
/** Maximum scalar samples across every frame/reference in one request. */
|
|
16
|
+
export const MAX_PRINT_REGION_STATISTICS_SAMPLES = MAX_PRINT_DETAIL_REGION_SAMPLES;
|
|
17
|
+
function record(v, keys) {
|
|
18
|
+
return requireAllowlistedRecord(v, keys, "Invalid or unknown Print region statistics fields.");
|
|
19
|
+
}
|
|
20
|
+
function id(v) { return requirePublicOpaqueId(v, "Invalid public Print region statistics identity."); }
|
|
21
|
+
function finite(v) {
|
|
22
|
+
if (typeof v !== "number" || !Number.isFinite(v))
|
|
23
|
+
throw new InvalidConfigurationError("Print region statistics require finite numbers.");
|
|
24
|
+
return v;
|
|
25
|
+
}
|
|
26
|
+
function choice(v, options) {
|
|
27
|
+
if (typeof v !== "string" || !options.includes(v))
|
|
28
|
+
throw new InvalidConfigurationError("Unknown Print region statistics enum.");
|
|
29
|
+
return v;
|
|
30
|
+
}
|
|
31
|
+
function parseRaster(v) {
|
|
32
|
+
const r = record(v, ["print", "source", "region", "samples"]), source = parsePrintDetailSource(r.source);
|
|
33
|
+
const { region, samples } = parsePrintDetailRegion(r.region, source, r.samples);
|
|
34
|
+
return { print: parsePrintPlanInput(r.print), source, region, samples };
|
|
35
|
+
}
|
|
36
|
+
/** Parse/copy an untrusted paired scalar ROI request. */
|
|
37
|
+
export function parsePrintRegionDifferenceInput(v) {
|
|
38
|
+
const r = record(v, ["assessmentId", "before", "after", "purpose", "realizationPolicy", "referenceRange"]);
|
|
39
|
+
const before = parseRaster(r.before), after = parseRaster(r.after);
|
|
40
|
+
if (before.samples.length + after.samples.length > MAX_PRINT_REGION_STATISTICS_SAMPLES)
|
|
41
|
+
throw new InvalidConfigurationError("Print paired ROI sample budget exceeded.");
|
|
42
|
+
let referenceRange = null;
|
|
43
|
+
if (r.referenceRange !== null) {
|
|
44
|
+
const range = record(r.referenceRange, ["lowerRelativeLuminance", "upperRelativeLuminance"]);
|
|
45
|
+
referenceRange = { lowerRelativeLuminance: finite(range.lowerRelativeLuminance), upperRelativeLuminance: finite(range.upperRelativeLuminance) };
|
|
46
|
+
if (referenceRange.lowerRelativeLuminance >= referenceRange.upperRelativeLuminance)
|
|
47
|
+
throw new InvalidConfigurationError("Reference range must be strictly increasing.");
|
|
48
|
+
}
|
|
49
|
+
return { assessmentId: id(r.assessmentId), before, after, referenceRange,
|
|
50
|
+
purpose: choice(r.purpose, ["processing-change", "decoded-file-change"]),
|
|
51
|
+
realizationPolicy: choice(r.realizationPolicy, ["same-noise-realization", "deterministic-reference"]) };
|
|
52
|
+
}
|
|
53
|
+
/** Parse/copy an untrusted repeat-capture ensemble with a total scalar work bound. */
|
|
54
|
+
export function parsePrintRegionNoiseInput(v) {
|
|
55
|
+
const r = record(v, ["assessmentId", "ensembleId", "stationarySceneId", "repeatPolicy", "frames"]);
|
|
56
|
+
if (!Array.isArray(r.frames) || r.frames.length < 2 || r.frames.length > 256)
|
|
57
|
+
throw new InvalidConfigurationError("Print noise statistics require 2 to 256 repeat frames.");
|
|
58
|
+
const frames = [];
|
|
59
|
+
let count = 0;
|
|
60
|
+
for (let i = 0; i < r.frames.length; i++) {
|
|
61
|
+
if (!Object.hasOwn(r.frames, i))
|
|
62
|
+
throw new InvalidConfigurationError("Sparse Print noise ensembles are unsupported.");
|
|
63
|
+
const frame = parseRaster(r.frames[i]);
|
|
64
|
+
count += frame.samples.length;
|
|
65
|
+
if (count > MAX_PRINT_REGION_STATISTICS_SAMPLES)
|
|
66
|
+
throw new InvalidConfigurationError("Print noise ensemble sample budget exceeded.");
|
|
67
|
+
frames.push(frame);
|
|
68
|
+
}
|
|
69
|
+
return { assessmentId: id(r.assessmentId), ensembleId: id(r.ensembleId), stationarySceneId: id(r.stationarySceneId),
|
|
70
|
+
repeatPolicy: choice(r.repeatPolicy, ["independent-stationary-captures"]), frames };
|
|
71
|
+
}
|
|
72
|
+
function applicability(frame) {
|
|
73
|
+
const reasons = [], p = calculatePrintPlan(frame.print).value;
|
|
74
|
+
if (frame.source.domain !== "relative-linear-luminance")
|
|
75
|
+
reasons.push("linear-luminance-domain-required");
|
|
76
|
+
if (frame.source.registration !== "oriented-retained-unwarped")
|
|
77
|
+
reasons.push("correction-warp-registration-unqualified");
|
|
78
|
+
if (frame.print.source.kind !== "native-retained")
|
|
79
|
+
return [...reasons, "missing-authoritative-native-geometry"];
|
|
80
|
+
if (frame.source.captureId !== frame.print.source.captureId)
|
|
81
|
+
reasons.push("capture-identity-mismatch");
|
|
82
|
+
if (p.status === "unsupported" || p.status === "crop-confirmation-required")
|
|
83
|
+
reasons.push("print-geometry-unavailable");
|
|
84
|
+
const geometry = resolveCaptureGeometry(frame.print.source.geometry).value, crop = geometry.output.cropRect, raster = frame.source.raster;
|
|
85
|
+
if (raster.pixelWidth > crop.width || raster.pixelHeight > crop.height)
|
|
86
|
+
reasons.push("represented-native-upscale-unsupported");
|
|
87
|
+
if (BigInt(raster.pixelWidth) * BigInt(crop.height) !== BigInt(raster.pixelHeight) * BigInt(crop.width))
|
|
88
|
+
reasons.push("represented-retained-aspect-mismatch");
|
|
89
|
+
if (frame.source.stage === "native-retained-linear" && (raster.pixelWidth !== crop.width || raster.pixelHeight !== crop.height))
|
|
90
|
+
reasons.push("native-representation-raster-mismatch");
|
|
91
|
+
return reasons;
|
|
92
|
+
}
|
|
93
|
+
// Parsed records have canonical field order; the comparison deliberately retains every
|
|
94
|
+
// geometry/region/print condition, while allowing acquisition/processing identities to differ.
|
|
95
|
+
function registrationKey(frame) {
|
|
96
|
+
return JSON.stringify({ geometry: frame.print.source.kind === "native-retained" ? frame.print.source.geometry : null,
|
|
97
|
+
print: { ...frame.print, source: null }, raster: frame.source.raster, region: frame.region });
|
|
98
|
+
}
|
|
99
|
+
function base(assessmentId, input, frame) {
|
|
100
|
+
return { assessmentId, engineApiVersion: ENGINE_API_VERSION, modelVersion: PRINT_REGION_STATISTICS_MODEL_VERSION,
|
|
101
|
+
input, status: "blocked", blockers: [], print: calculatePrintPlan(frame.print).value, measurement: null,
|
|
102
|
+
sourceArtifactVerification: "caller-declared-unverified", acquisitionQualification: "unassessed",
|
|
103
|
+
uncertainty: "not-quantified", overallPrintVerdict: "not-offered" };
|
|
104
|
+
}
|
|
105
|
+
function finish(result) {
|
|
106
|
+
return freezeOwnedData(calculatedResult(result, "regional-linear-print-statistics", PRINT_REGION_STATISTICS_MODEL_VERSION, ["Scalar linear samples, exact source identities and registration are caller declarations.",
|
|
107
|
+
"Repeat stationarity/independence and deterministic or shared realization policies need independent acquisition evidence.",
|
|
108
|
+
"No clipping mechanism, artifact visibility, physical sensor noise or overall print pass is inferred."]));
|
|
109
|
+
}
|
|
110
|
+
class Sum {
|
|
111
|
+
total = 0;
|
|
112
|
+
correction = 0;
|
|
113
|
+
add(v) {
|
|
114
|
+
const next = this.total + v;
|
|
115
|
+
this.correction += Math.abs(this.total) >= Math.abs(v) ? (this.total - next) + v : (v - next) + this.total;
|
|
116
|
+
this.total = next;
|
|
117
|
+
}
|
|
118
|
+
get value() { return this.total + this.correction; }
|
|
119
|
+
}
|
|
120
|
+
function finiteMean(values) {
|
|
121
|
+
let scale = 0, subnormalTerms = false;
|
|
122
|
+
const raw = new Sum(), normalized = new Sum();
|
|
123
|
+
for (const v of values)
|
|
124
|
+
scale = Math.max(scale, Math.abs(v));
|
|
125
|
+
if (scale === 0)
|
|
126
|
+
return 0;
|
|
127
|
+
for (const v of values) {
|
|
128
|
+
if (v !== 0 && v / scale === 0)
|
|
129
|
+
return null;
|
|
130
|
+
const term = v / values.length;
|
|
131
|
+
raw.add(term);
|
|
132
|
+
normalized.add(v / scale / values.length);
|
|
133
|
+
if (v !== 0 && Math.abs(term) < 2 ** -1022)
|
|
134
|
+
subnormalTerms = true;
|
|
135
|
+
}
|
|
136
|
+
const mean = subnormalTerms ? normalized.value * scale : raw.value;
|
|
137
|
+
return Number.isFinite(mean) ? mean : null;
|
|
138
|
+
}
|
|
139
|
+
/** Measure registered processing changes; residual is not automatically compression/noise. */
|
|
140
|
+
export function calculatePrintRegionDifference(value) {
|
|
141
|
+
const input = parsePrintRegionDifferenceInput(value), { before, after } = input;
|
|
142
|
+
const result = base(input.assessmentId, input, after);
|
|
143
|
+
result.blockers.push(...applicability(before), ...applicability(after));
|
|
144
|
+
if (registrationKey(before) !== registrationKey(after))
|
|
145
|
+
result.blockers.push("paired-site-registration-mismatch");
|
|
146
|
+
if (before.source.captureId !== after.source.captureId)
|
|
147
|
+
result.blockers.push("paired-capture-identity-mismatch");
|
|
148
|
+
if (before.source.representationId === after.source.representationId && (before.source.contentSha256 !== after.source.contentSha256 || before.source.stage !== after.source.stage || JSON.stringify(before.source.processing) !== JSON.stringify(after.source.processing)))
|
|
149
|
+
result.blockers.push("representation-identity-conflict");
|
|
150
|
+
if (input.realizationPolicy === "same-noise-realization" && (before.source.noiseRealizationId === null || before.source.noiseRealizationId !== after.source.noiseRealizationId))
|
|
151
|
+
result.blockers.push("same-noise-realization-required");
|
|
152
|
+
if (input.realizationPolicy === "deterministic-reference" && (before.source.noiseRealizationId !== null || after.source.noiseRealizationId !== null))
|
|
153
|
+
result.blockers.push("deterministic-reference-has-noise-realization");
|
|
154
|
+
if (input.purpose === "decoded-file-change" && (before.source.stage !== "post-resampling-linear" || after.source.stage !== "post-encoding-decoded-linear"))
|
|
155
|
+
result.blockers.push("exact-pre-encode-and-decoded-stages-required");
|
|
156
|
+
if (result.blockers.length)
|
|
157
|
+
return finish(result);
|
|
158
|
+
let scale = 0;
|
|
159
|
+
for (const samples of [before.samples, after.samples])
|
|
160
|
+
for (const v of samples)
|
|
161
|
+
scale = Math.max(scale, Math.abs(v));
|
|
162
|
+
const sum = new Sum(), rawMeanSum = new Sum(), count = before.samples.length;
|
|
163
|
+
let finiteDifferences = true, subnormalMeanTerms = false;
|
|
164
|
+
let norm = 0, maximum = 0;
|
|
165
|
+
for (let i = 0; i < count; i++) {
|
|
166
|
+
const raw = after.samples[i] - before.samples[i];
|
|
167
|
+
if (Number.isFinite(raw)) {
|
|
168
|
+
rawMeanSum.add(raw / count);
|
|
169
|
+
if (raw !== 0 && Math.abs(raw / count) < 2 ** -1022)
|
|
170
|
+
subnormalMeanTerms = true;
|
|
171
|
+
}
|
|
172
|
+
else
|
|
173
|
+
finiteDifferences = false;
|
|
174
|
+
const d = scale === 0 ? 0 : Number.isFinite(raw) ? raw / scale : after.samples[i] / scale - before.samples[i] / scale;
|
|
175
|
+
if (raw !== 0 && d === 0) {
|
|
176
|
+
result.status = "unsupported";
|
|
177
|
+
result.blockers.push("difference-dynamic-range-unsupported");
|
|
178
|
+
return finish(result);
|
|
179
|
+
}
|
|
180
|
+
sum.add(d / count);
|
|
181
|
+
norm = Math.hypot(norm, d);
|
|
182
|
+
maximum = Math.max(maximum, Math.abs(d));
|
|
183
|
+
}
|
|
184
|
+
const measurement = { meanSignedDifferenceRelativeLuminance: finiteDifferences && !subnormalMeanTerms ? rawMeanSum.value : sum.value * scale,
|
|
185
|
+
rmsDifferenceRelativeLuminance: norm / Math.sqrt(count) * scale, maximumAbsoluteDifferenceRelativeLuminance: maximum * scale, rangeExcursions: null };
|
|
186
|
+
if (input.referenceRange) {
|
|
187
|
+
const { lowerRelativeLuminance: lo, upperRelativeLuminance: hi } = input.referenceRange;
|
|
188
|
+
const excursions = (samples) => {
|
|
189
|
+
let below = 0, above = 0, under = 0, over = 0;
|
|
190
|
+
for (const v of samples) {
|
|
191
|
+
if (v < lo) {
|
|
192
|
+
below++;
|
|
193
|
+
under = Math.max(under, lo - v);
|
|
194
|
+
}
|
|
195
|
+
if (v > hi) {
|
|
196
|
+
above++;
|
|
197
|
+
over = Math.max(over, v - hi);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return { below, above, under, over };
|
|
201
|
+
};
|
|
202
|
+
const b = excursions(before.samples), a = excursions(after.samples);
|
|
203
|
+
measurement.rangeExcursions = { beforeBelowRangeCount: b.below, beforeAboveRangeCount: b.above, afterBelowRangeCount: a.below, afterAboveRangeCount: a.above,
|
|
204
|
+
beforeMaximumUndershootRelativeLuminance: b.under, beforeMaximumOvershootRelativeLuminance: b.over,
|
|
205
|
+
afterMaximumUndershootRelativeLuminance: a.under, afterMaximumOvershootRelativeLuminance: a.over };
|
|
206
|
+
}
|
|
207
|
+
if (![measurement.meanSignedDifferenceRelativeLuminance, measurement.rmsDifferenceRelativeLuminance, measurement.maximumAbsoluteDifferenceRelativeLuminance,
|
|
208
|
+
...Object.values(measurement.rangeExcursions ?? {})].every(Number.isFinite) || (norm > 0 && measurement.rmsDifferenceRelativeLuminance === 0)) {
|
|
209
|
+
result.status = "unsupported";
|
|
210
|
+
result.blockers.push("difference-numeric-range-unsupported");
|
|
211
|
+
return finish(result);
|
|
212
|
+
}
|
|
213
|
+
result.status = "diagnostic-only";
|
|
214
|
+
result.measurement = measurement;
|
|
215
|
+
return finish(result);
|
|
216
|
+
}
|
|
217
|
+
/** Measure n-1 per-site temporal sample variance, independently of scene spatial texture. */
|
|
218
|
+
export function calculatePrintRegionNoise(value) {
|
|
219
|
+
const input = parsePrintRegionNoiseInput(value), first = input.frames[0];
|
|
220
|
+
const result = base(input.assessmentId, input, first);
|
|
221
|
+
const captureIds = new Set(), representations = new Set(), realizations = new Set();
|
|
222
|
+
for (const frame of input.frames) {
|
|
223
|
+
result.blockers.push(...applicability(frame));
|
|
224
|
+
if (registrationKey(frame) !== registrationKey(first) || frame.source.stage !== first.source.stage || JSON.stringify(frame.source.processing) !== JSON.stringify(first.source.processing))
|
|
225
|
+
result.blockers.push("repeat-acquisition-registration-or-processing-mismatch");
|
|
226
|
+
if (captureIds.has(frame.source.captureId) || representations.has(frame.source.representationId))
|
|
227
|
+
result.blockers.push("repeat-acquisition-identity-reused");
|
|
228
|
+
if (frame.source.noiseRealizationId === null || realizations.has(frame.source.noiseRealizationId))
|
|
229
|
+
result.blockers.push("distinct-repeat-noise-realizations-required");
|
|
230
|
+
captureIds.add(frame.source.captureId);
|
|
231
|
+
representations.add(frame.source.representationId);
|
|
232
|
+
if (frame.source.noiseRealizationId !== null)
|
|
233
|
+
realizations.add(frame.source.noiseRealizationId);
|
|
234
|
+
}
|
|
235
|
+
if (result.blockers.length)
|
|
236
|
+
return finish(result);
|
|
237
|
+
const frameCount = input.frames.length, siteCount = first.samples.length, means = [], variances = [];
|
|
238
|
+
let pooledRms = 0;
|
|
239
|
+
for (let site = 0; site < siteCount; site++) {
|
|
240
|
+
let scale = 0;
|
|
241
|
+
for (const frame of input.frames)
|
|
242
|
+
scale = Math.max(scale, Math.abs(frame.samples[site]));
|
|
243
|
+
const meanSum = new Sum(), rawMeanSum = new Sum(), normalizedMeanSum = new Sum(), anchor = first.samples[site], offsets = [];
|
|
244
|
+
let subnormalMeanTerms = false;
|
|
245
|
+
for (const frame of input.frames) {
|
|
246
|
+
const v = frame.samples[site];
|
|
247
|
+
rawMeanSum.add(v / frameCount);
|
|
248
|
+
if (v !== 0 && Math.abs(v / frameCount) < 2 ** -1022)
|
|
249
|
+
subnormalMeanTerms = true;
|
|
250
|
+
if (v !== 0 && v / scale === 0) {
|
|
251
|
+
result.status = "unsupported";
|
|
252
|
+
result.blockers.push("noise-dynamic-range-unsupported");
|
|
253
|
+
return finish(result);
|
|
254
|
+
}
|
|
255
|
+
normalizedMeanSum.add(scale === 0 ? 0 : v / scale / frameCount);
|
|
256
|
+
const raw = v - anchor;
|
|
257
|
+
const offset = scale === 0 ? 0 : Number.isFinite(raw) ? raw / scale : v / scale - anchor / scale;
|
|
258
|
+
if (raw !== 0 && offset === 0) {
|
|
259
|
+
result.status = "unsupported";
|
|
260
|
+
result.blockers.push("noise-dynamic-range-unsupported");
|
|
261
|
+
return finish(result);
|
|
262
|
+
}
|
|
263
|
+
offsets.push(offset);
|
|
264
|
+
meanSum.add(offset / frameCount);
|
|
265
|
+
}
|
|
266
|
+
// Center in the offset domain: rounding a restored large DC mean must not inflate
|
|
267
|
+
// variance when the mathematical mean lies between adjacent binary64 values.
|
|
268
|
+
const meanOffset = meanSum.value, mean = subnormalMeanTerms ? normalizedMeanSum.value * scale : rawMeanSum.value;
|
|
269
|
+
let norm = 0;
|
|
270
|
+
for (const offset of offsets)
|
|
271
|
+
norm = Math.hypot(norm, offset - meanOffset);
|
|
272
|
+
const rms = norm / Math.sqrt(frameCount - 1) * scale, variance = rms * rms;
|
|
273
|
+
if (![mean, rms, variance].every(Number.isFinite) || (norm > 0 && (rms === 0 || variance === 0))) {
|
|
274
|
+
result.status = "unsupported";
|
|
275
|
+
result.blockers.push("noise-numeric-range-unsupported");
|
|
276
|
+
return finish(result);
|
|
277
|
+
}
|
|
278
|
+
means.push(mean);
|
|
279
|
+
variances.push(variance);
|
|
280
|
+
pooledRms = Math.hypot(pooledRms, rms / Math.sqrt(siteCount));
|
|
281
|
+
}
|
|
282
|
+
const mean = finiteMean(means), variance = finiteMean(variances);
|
|
283
|
+
if (mean === null || variance === null || (pooledRms > 0 && variance === 0)) {
|
|
284
|
+
result.status = "unsupported";
|
|
285
|
+
result.blockers.push("noise-numeric-range-unsupported");
|
|
286
|
+
return finish(result);
|
|
287
|
+
}
|
|
288
|
+
const measurement = { frameCount, siteCount, meanRelativeLuminance: mean,
|
|
289
|
+
meanTemporalSampleVarianceRelativeLuminanceSquared: variance, temporalRmsRelativeLuminance: pooledRms,
|
|
290
|
+
perSiteMeansRelativeLuminance: means, perSiteSampleVariancesRelativeLuminanceSquared: variances };
|
|
291
|
+
if (![measurement.meanRelativeLuminance, measurement.meanTemporalSampleVarianceRelativeLuminanceSquared, pooledRms].every(Number.isFinite)) {
|
|
292
|
+
result.status = "unsupported";
|
|
293
|
+
result.blockers.push("noise-numeric-range-unsupported");
|
|
294
|
+
return finish(result);
|
|
295
|
+
}
|
|
296
|
+
result.status = "diagnostic-only";
|
|
297
|
+
result.measurement = measurement;
|
|
298
|
+
return finish(result);
|
|
299
|
+
}
|
|
300
|
+
//# sourceMappingURL=print-region-statistics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"print-region-statistics.js","sourceRoot":"","sources":["../../src/output/print-region-statistics.ts"],"names":[],"mapp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U,EAAE,SAAS,EAAE,qBAAqB,EAAE,IAAI;QACnG,kDAAkD,EAAE,QAAQ,EAAE,4BAA4B,EAAE,SAAS;QACrG,6BAA6B,EAAE,KAAK,EAAE,8CAA8C,EAAE,SAAS,EAAE,CAAC;IACpG,IAAI,CAAC,CAAC,WAAW,CAAC,qBAAqB,EAAE,WAAW,CAAC,kDAAkD,EAAE,SAAS,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;QAAC,MAAM,CAAC,MAAM,GAAG,aAAa,CAAC;QAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;QAAC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;IAAC,CAAC;IAC9P,MAAM,CAAC,MAAM,GAAG,iBAAiB,CAAC;IAAC,MAAM,CAAC,WAAW,GAAG,WAAW,CAAC;IAAC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC;AAC7F,CAAC"}
|
package/docs/API_REFERENCE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Public API reference
|
|
2
2
|
|
|
3
|
-
Generated from the exact root exports for **@photivra/engine 1.0
|
|
3
|
+
Generated from the exact root exports for **@photivra/engine 1.2.0 / root contract 1.2.0** by `node scripts/generate-api-reference.mjs`. No module deep import is supported.
|
|
4
4
|
|
|
5
5
|
Use [the developer guide](DEVELOPERS.md) for executable paths and scientific boundaries. Types are contracts, not runtime validation: parse untrusted data, preserve units/reference frames, read assessment blockers, and retain evidence/limitations. Optional properties do not imply a universal default. Model/schema IDs remain independent of the distribution.
|
|
6
6
|
|
|
@@ -1189,6 +1189,94 @@ Use [the developer guide](DEVELOPERS.md) for executable paths and scientific bou
|
|
|
1189
1189
|
| [`ResolvedLensCorrectionPlan`](api/output-lens-corrections.md#resolvedlenscorrectionplan) | Type |
|
|
1190
1190
|
| [`resolveLensCorrectionPlan`](api/output-lens-corrections.md#resolvelenscorrectionplan) | Runtime |
|
|
1191
1191
|
|
|
1192
|
+
## output/native-capture-sdr.ts
|
|
1193
|
+
|
|
1194
|
+
[Detailed contracts](api/output-native-capture-sdr.md) · [Source](https://github.com/Photivra/photivra/blob/main/src/output/native-capture-sdr.ts)
|
|
1195
|
+
|
|
1196
|
+
| Export | Kind |
|
|
1197
|
+
| --- | --- |
|
|
1198
|
+
| [`calculateNativeCaptureSdrPlan`](api/output-native-capture-sdr.md#calculatenativecapturesdrplan) | Runtime |
|
|
1199
|
+
| [`createNativeCaptureSdrTask`](api/output-native-capture-sdr.md#createnativecapturesdrtask) | Runtime |
|
|
1200
|
+
| [`NATIVE_CAPTURE_SDR_LIMITS`](api/output-native-capture-sdr.md#native_capture_sdr_limits) | Runtime |
|
|
1201
|
+
| [`NATIVE_CAPTURE_SDR_SCHEMA_VERSION`](api/output-native-capture-sdr.md#native_capture_sdr_schema_version) | Runtime |
|
|
1202
|
+
| [`NativeCaptureSdrInput`](api/output-native-capture-sdr.md#nativecapturesdrinput) | Type |
|
|
1203
|
+
| [`NativeCaptureSdrOutput`](api/output-native-capture-sdr.md#nativecapturesdroutput) | Type |
|
|
1204
|
+
| [`NativeCaptureSdrPlan`](api/output-native-capture-sdr.md#nativecapturesdrplan) | Type |
|
|
1205
|
+
| [`NativeCaptureSdrProvider`](api/output-native-capture-sdr.md#nativecapturesdrprovider) | Type |
|
|
1206
|
+
| [`NativeCaptureSdrTask`](api/output-native-capture-sdr.md#nativecapturesdrtask) | Type |
|
|
1207
|
+
| [`NativeCaptureSdrTaskState`](api/output-native-capture-sdr.md#nativecapturesdrtaskstate) | Type |
|
|
1208
|
+
| [`NativeCaptureSdrTile`](api/output-native-capture-sdr.md#nativecapturesdrtile) | Type |
|
|
1209
|
+
| [`NativeCaptureSdrTileRequest`](api/output-native-capture-sdr.md#nativecapturesdrtilerequest) | Type |
|
|
1210
|
+
|
|
1211
|
+
## output/print-contrast-reference.ts
|
|
1212
|
+
|
|
1213
|
+
[Detailed contracts](api/output-print-contrast-reference.md) · [Source](https://github.com/Photivra/photivra/blob/main/src/output/print-contrast-reference.ts)
|
|
1214
|
+
|
|
1215
|
+
| Export | Kind |
|
|
1216
|
+
| --- | --- |
|
|
1217
|
+
| [`calculatePrintContrastReference`](api/output-print-contrast-reference.md#calculateprintcontrastreference) | Runtime |
|
|
1218
|
+
| [`parsePrintContrastReferenceInput`](api/output-print-contrast-reference.md#parseprintcontrastreferenceinput) | Runtime |
|
|
1219
|
+
| [`PRINT_CONTRAST_REFERENCE_MODEL_VERSION`](api/output-print-contrast-reference.md#print_contrast_reference_model_version) | Runtime |
|
|
1220
|
+
| [`PRINT_CONTRAST_REFERENCE_UPSTREAM_REVISION`](api/output-print-contrast-reference.md#print_contrast_reference_upstream_revision) | Runtime |
|
|
1221
|
+
| [`PrintContrastReference`](api/output-print-contrast-reference.md#printcontrastreference) | Type |
|
|
1222
|
+
| [`PrintContrastReferenceInput`](api/output-print-contrast-reference.md#printcontrastreferenceinput) | Type |
|
|
1223
|
+
|
|
1224
|
+
## output/print-detail.ts
|
|
1225
|
+
|
|
1226
|
+
[Detailed contracts](api/output-print-detail.md) · [Source](https://github.com/Photivra/photivra/blob/main/src/output/print-detail.ts)
|
|
1227
|
+
|
|
1228
|
+
| Export | Kind |
|
|
1229
|
+
| --- | --- |
|
|
1230
|
+
| [`calculatePrintRegionDetail`](api/output-print-detail.md#calculateprintregiondetail) | Runtime |
|
|
1231
|
+
| [`MAX_PRINT_DETAIL_REGION_SAMPLES`](api/output-print-detail.md#max_print_detail_region_samples) | Runtime |
|
|
1232
|
+
| [`parsePrintRegionDetailInput`](api/output-print-detail.md#parseprintregiondetailinput) | Runtime |
|
|
1233
|
+
| [`PRINT_REGION_DETAIL_MODEL_VERSION`](api/output-print-detail.md#print_region_detail_model_version) | Runtime |
|
|
1234
|
+
| [`PrintDetailRegion`](api/output-print-detail.md#printdetailregion) | Type |
|
|
1235
|
+
| [`PrintDetailSource`](api/output-print-detail.md#printdetailsource) | Type |
|
|
1236
|
+
| [`PrintRegionDetailAssessment`](api/output-print-detail.md#printregiondetailassessment) | Type |
|
|
1237
|
+
| [`PrintRegionDetailInput`](api/output-print-detail.md#printregiondetailinput) | Type |
|
|
1238
|
+
| [`PrintSinusoidalMeasurement`](api/output-print-detail.md#printsinusoidalmeasurement) | Type |
|
|
1239
|
+
| [`PrintSinusoidalTarget`](api/output-print-detail.md#printsinusoidaltarget) | Type |
|
|
1240
|
+
|
|
1241
|
+
## output/print-plan.ts
|
|
1242
|
+
|
|
1243
|
+
[Detailed contracts](api/output-print-plan.md) · [Source](https://github.com/Photivra/photivra/blob/main/src/output/print-plan.ts)
|
|
1244
|
+
|
|
1245
|
+
| Export | Kind |
|
|
1246
|
+
| --- | --- |
|
|
1247
|
+
| [`calculatePrintPlan`](api/output-print-plan.md#calculateprintplan) | Runtime |
|
|
1248
|
+
| [`calculatePrintSizeLimit`](api/output-print-plan.md#calculateprintsizelimit) | Runtime |
|
|
1249
|
+
| [`parsePrintPlanInput`](api/output-print-plan.md#parseprintplaninput) | Runtime |
|
|
1250
|
+
| [`PrintedImageSize`](api/output-print-plan.md#printedimagesize) | Type |
|
|
1251
|
+
| [`PrintLength`](api/output-print-plan.md#printlength) | Type |
|
|
1252
|
+
| [`PrintNativeSource`](api/output-print-plan.md#printnativesource) | Type |
|
|
1253
|
+
| [`PrintPlan`](api/output-print-plan.md#printplan) | Type |
|
|
1254
|
+
| [`PrintPlanInput`](api/output-print-plan.md#printplaninput) | Type |
|
|
1255
|
+
| [`PrintProviderConstraints`](api/output-print-plan.md#printproviderconstraints) | Type |
|
|
1256
|
+
| [`PrintRasterSampling`](api/output-print-plan.md#printrastersampling) | Type |
|
|
1257
|
+
| [`PrintSamplingCriterion`](api/output-print-plan.md#printsamplingcriterion) | Type |
|
|
1258
|
+
| [`PrintSizeLimit`](api/output-print-plan.md#printsizelimit) | Type |
|
|
1259
|
+
| [`PrintSizeLimitInput`](api/output-print-plan.md#printsizelimitinput) | Type |
|
|
1260
|
+
|
|
1261
|
+
## output/print-region-statistics.ts
|
|
1262
|
+
|
|
1263
|
+
[Detailed contracts](api/output-print-region-statistics.md) · [Source](https://github.com/Photivra/photivra/blob/main/src/output/print-region-statistics.ts)
|
|
1264
|
+
|
|
1265
|
+
| Export | Kind |
|
|
1266
|
+
| --- | --- |
|
|
1267
|
+
| [`calculatePrintRegionDifference`](api/output-print-region-statistics.md#calculateprintregiondifference) | Runtime |
|
|
1268
|
+
| [`calculatePrintRegionNoise`](api/output-print-region-statistics.md#calculateprintregionnoise) | Runtime |
|
|
1269
|
+
| [`MAX_PRINT_REGION_STATISTICS_SAMPLES`](api/output-print-region-statistics.md#max_print_region_statistics_samples) | Runtime |
|
|
1270
|
+
| [`parsePrintRegionDifferenceInput`](api/output-print-region-statistics.md#parseprintregiondifferenceinput) | Runtime |
|
|
1271
|
+
| [`parsePrintRegionNoiseInput`](api/output-print-region-statistics.md#parseprintregionnoiseinput) | Runtime |
|
|
1272
|
+
| [`PRINT_REGION_STATISTICS_MODEL_VERSION`](api/output-print-region-statistics.md#print_region_statistics_model_version) | Runtime |
|
|
1273
|
+
| [`PrintRegionDifferenceInput`](api/output-print-region-statistics.md#printregiondifferenceinput) | Type |
|
|
1274
|
+
| [`PrintRegionDifferenceMeasurement`](api/output-print-region-statistics.md#printregiondifferencemeasurement) | Type |
|
|
1275
|
+
| [`PrintRegionNoiseInput`](api/output-print-region-statistics.md#printregionnoiseinput) | Type |
|
|
1276
|
+
| [`PrintRegionNoiseMeasurement`](api/output-print-region-statistics.md#printregionnoisemeasurement) | Type |
|
|
1277
|
+
| [`PrintRegionRaster`](api/output-print-region-statistics.md#printregionraster) | Type |
|
|
1278
|
+
| [`PrintRegionStatisticsAssessment`](api/output-print-region-statistics.md#printregionstatisticsassessment) | Type |
|
|
1279
|
+
|
|
1192
1280
|
## output/sdr-rendering.ts
|
|
1193
1281
|
|
|
1194
1282
|
[Detailed contracts](api/output-sdr-rendering.md) · [Source](https://github.com/Photivra/photivra/blob/main/src/output/sdr-rendering.ts)
|
package/docs/API_STYLE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Public API Style
|
|
2
2
|
|
|
3
|
-
Release context: **package 1.0
|
|
3
|
+
Release context: **package 1.2.0 candidate / root API 1.2.0**. Subsystem/model versions and dated introduction or measurement records below are independent historical identities; they are not distribution versions. See [developer navigation](DEVELOPERS.md) and [release contract](RELEASE_1_2_0.md).
|
|
4
4
|
|
|
5
5
|
The open engine should feel like one coherent library.
|
|
6
6
|
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Architecture
|
|
2
2
|
|
|
3
|
-
Release context: **package 1.0
|
|
3
|
+
Release context: **package 1.2.0 candidate / root API 1.2.0**. Subsystem/model versions and dated introduction or measurement records below are independent historical identities; they are not distribution versions. See [developer navigation](DEVELOPERS.md) and [release contract](RELEASE_1_2_0.md).
|
|
4
4
|
|
|
5
5
|
Photivra separates a reusable scientific core from optional composition and transport layers.
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Public-engine automation coordination
|
|
2
2
|
|
|
3
|
-
Release context: **package 1.0
|
|
3
|
+
Release context: **package 1.2.0 candidate / root API 1.2.0**. Subsystem/model versions and dated introduction or measurement records below are independent historical identities; they are not distribution versions. See [developer navigation](DEVELOPERS.md) and [release contract](RELEASE_1_2_0.md).
|
|
4
4
|
|
|
5
5
|
This document coordinates the two recurring automation lanes that work only in the public
|
|
6
6
|
`Photivra/photivra` repository. It is process guidance, not a scientific roadmap. Open issues and
|
package/docs/CAPTURE_COLOR.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Virtual-camera linear color: #15B
|
|
2
2
|
|
|
3
|
-
Release context: **package 1.0
|
|
3
|
+
Release context: **package 1.2.0 candidate / root API 1.2.0**. Subsystem/model versions and dated introduction or measurement records below are independent historical identities; they are not distribution versions. See [developer navigation](DEVELOPERS.md) and [release contract](RELEASE_1_2_0.md).
|
|
4
4
|
|
|
5
5
|
`resolveCaptureColorModel()` defines an ideal CIE 1931 2-degree colorimetric camera: co-sited red/green/blue channels are an invertible encoding of XYZ in the linear-sRGB primary basis, with D65 reference white. They are relative linear values, not electrons, spectral response measurements or commercial-camera RGB. Choosing this profile is an upstream producer assertion about sample meaning; naming arbitrary sensor data with its ID does not establish validity.
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Capture-bound corrections and SDR: #112 integration slice
|
|
2
2
|
|
|
3
|
-
Release context: **package 1.0
|
|
3
|
+
Release context: **package 1.2.0 candidate / root API 1.2.0**. Subsystem/model versions and dated introduction or measurement records below are independent historical identities; they are not distribution versions. See [developer navigation](DEVELOPERS.md) and [release contract](RELEASE_1_2_0.md).
|
|
4
4
|
|
|
5
5
|
`calculateCaptureCorrectedSdr()` consumes the same immutable `SimulatedCapture` and explicit source/color/WB choice as `calculateCaptureSdr()`, then executes existing #117/#118 corrections before the existing SDR renderer. This bounded reference bridge does not replace the #111 composer, activate production stages, or complete #112/V1.
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Capture export metadata foundation (#16B)
|
|
2
2
|
|
|
3
|
-
Release context: **package 1.0
|
|
3
|
+
Release context: **package 1.2.0 candidate / root API 1.2.0**. Subsystem/model versions and dated introduction or measurement records below are independent historical identities; they are not distribution versions. See [developer navigation](DEVELOPERS.md) and [release contract](RELEASE_1_2_0.md).
|
|
4
4
|
|
|
5
5
|
`createCaptureExportMetadataPair()` is a browser-safe, deterministic **semantic metadata projection**, not an image exporter or proof of RAW/JPEG pixel derivation. Both future writers consume its single shared object; each resource has a distinct caller-owned document UUID and saved-incarnation UUID. `imageDataPairing = "not-verified"` prevents metadata agreement being mistaken for image agreement.
|
|
6
6
|
|
package/docs/CAPTURE_SDR.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Capture-to-SDR adapter
|
|
2
2
|
|
|
3
|
-
Release context: **package 1.0
|
|
3
|
+
Release context: **package 1.2.0 candidate / root API 1.2.0**. Subsystem/model versions and dated introduction or measurement records below are independent historical identities; they are not distribution versions. See [developer navigation](DEVELOPERS.md) and [release contract](RELEASE_1_2_0.md).
|
|
4
4
|
|
|
5
5
|
Current integration: [processed camera output](PROCESSED_OUTPUT.md) documents
|
|
6
6
|
the shared preview/export path and explicit plan 0.6.0 post-RAW activation.
|
|
@@ -18,3 +18,5 @@ The result exposes optional color and SDR calculation envelopes separately, with
|
|
|
18
18
|
This is #112B, not full #112 closure. It does not execute correction profiles or activate production stages. Corrected planes may retain their explicit upstream transform history; no correction is inferred. #117/#118 execution and #111 ordered production integration require their own bound handoff. #16 remains the serializer owner and must not invent color/WB/quantization semantics.
|
|
19
19
|
|
|
20
20
|
Implementation and fixtures are independently authored orchestration of existing Photivra APIs; no new equation, calibration, third-party material, dependency, service, IO or cost is introduced.
|
|
21
|
+
|
|
22
|
+
For external megapixel masters already in resolved linear sRGB/D65, see the separate [bounded native SDR contract](NATIVE_CAPTURE_SDR.md). The reference limits above remain unchanged.
|
package/docs/DEVELOPERS.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
# Developer guide
|
|
2
2
|
|
|
3
|
-
This is the entry point for **@photivra/engine 1.0
|
|
3
|
+
This is the entry point for **@photivra/engine 1.2.0 candidate**, root API contract **1.2.0**. The candidate becomes an installable 1.2.0 distribution only after the owner tags and publishes it. Repository `main` may later describe newer development; use a published release's packaged docs or its exact tag for the stable contract. [Release notes and migration](RELEASE_1_2_0.md) explain the transition to aligned package/root versions.
|
|
4
4
|
|
|
5
5
|
Photivra is an Apache-2.0 ESM TypeScript calculation library with no runtime npm dependencies. It exposes explicit units, deterministic data, provenance and bounded scientific approximations. The package supplies no hosted API, renderer installation, UI, commercial camera calibration or automatic agent service. [Photivra's public site](https://photivra.com) is separate from the engine's license; public engine documentation is available here without an application account.
|
|
6
6
|
|
|
7
7
|
## Install and calculate
|
|
8
8
|
|
|
9
|
-
After publication, install `npm install @photivra/engine@1.0
|
|
9
|
+
After publication, install `npm install @photivra/engine@1.2.0`. During candidate review, use the verified tarball described in [release preparation](RELEASE_1_2_0.md).
|
|
10
10
|
|
|
11
11
|
```ts
|
|
12
12
|
import { calculateFieldOfView, ENGINE_API_VERSION } from "@photivra/engine";
|
|
13
13
|
|
|
14
14
|
const horizontal = calculateFieldOfView({ focalLengthMm: 50, sensorDimensionMm: 36 });
|
|
15
|
-
console.log(ENGINE_API_VERSION); // 1.0
|
|
15
|
+
console.log(ENGINE_API_VERSION); // 1.2.0: matches the package version
|
|
16
16
|
console.log(horizontal.value.degrees); // approximately 39.60, ideal infinity-focus geometry
|
|
17
17
|
console.log(horizontal.provenance); // read assumptions/status with the value
|
|
18
18
|
```
|
|
@@ -23,7 +23,7 @@ Primitive calculations normally return `CalculationResult<T>` with `value`, `pro
|
|
|
23
23
|
|
|
24
24
|
## Find the operation by scientific task
|
|
25
25
|
|
|
26
|
-
Every row applies to package/root API 1.0.
|
|
26
|
+
Every row applies to package/root API 1.2.0. Direct calculations are synchronous/browser-safe unless the row says otherwise. A listed primitive is not automatically an app feature or supported in every production combination. The [API reference](API_REFERENCE.md) resolves all root exports and exact signatures; the linked guides own equations, inputs, defaults, errors and limits.
|
|
27
27
|
|
|
28
28
|
| Task | Start here / executable evidence | Qualified boundary |
|
|
29
29
|
| --- | --- | --- |
|
|
@@ -58,3 +58,11 @@ Malformed configurations/non-finite values throw the established domain errors.
|
|
|
58
58
|
See [provenance](PROVENANCE.md), [license](../LICENSE), [NOTICE](../NOTICE), [third-party inventory](../THIRD_PARTY.md), [contributing](../CONTRIBUTING.md) and [security reporting](../SECURITY.md). Engine code/docs do not license the commercial application or its private assets. Report reproducible engine defects through [public issues](https://github.com/Photivra/photivra/issues).
|
|
59
59
|
|
|
60
60
|
Website navigation/documentation hosting belongs to [the app-side discovery ticket #45](https://github.com/Photivra/photivra-apps/issues/45), with navigation #298 and environments #300. Handoff: link the public engine repository, this developer guide, the verified npm release package and capability examples from the public site. No unpublished `/developers` destination is linked here. Website launch is not an engine release prerequisite; access to the site returned HTTP 403 during this audit, so its content/navigation was not verified.
|
|
61
|
+
|
|
62
|
+
## Print planning
|
|
63
|
+
|
|
64
|
+
The 1.2.0 candidate adds [registered linear statistics](PRINT_REGION_STATISTICS.md) and a separate [static contrast model reference](PRINT_CONTRAST_REFERENCE.md). The [combined #195/#196 review](PRINT_195_196_REVIEW.md) and [candidate ledger](validation/print-196-candidate-capabilities.json) list executed public-backend experiments and the remaining full release gates. None of these diagnostics supplies a universal quality score.
|
|
65
|
+
|
|
66
|
+
Use [native-only Print planning](PRINT_PLANNING.md) for independently specified image size/viewing distance, explicit angular conventions, confirmed native crop and lab constraints. It returns no upscale recommendation and does not certify perceived quality or activate an exporter.
|
|
67
|
+
|
|
68
|
+
The [regional Print detail diagnostic](PRINT_DETAIL_ASSESSMENT.md) measures one declared coherent sinusoidal fundamental in a selected linear-luminance ROI and records its exact source stage. Its [validation protocol](PRINT_DETAIL_VALIDATION.md) and [capability ledger](validation/print-detail-capabilities.json) distinguish mathematical conformance from blocked acquired-image, renderer and perceived-quality qualification.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Stray light and digital lens correction foundations
|
|
2
2
|
|
|
3
|
-
Release context: **package 1.0
|
|
3
|
+
Release context: **package 1.2.0 candidate / root API 1.2.0**. Subsystem/model versions and dated introduction or measurement records below are independent historical identities; they are not distribution versions. See [developer navigation](DEVELOPERS.md) and [release contract](RELEASE_1_2_0.md).
|
|
4
4
|
|
|
5
5
|
Issues #114, #118 and #117 add standalone browser-safe primitives. They do not enable a production-plan stage, change the POC, or supply a calibrated camera/lens preset. The public root API advances from 0.94.0 to 0.95.0; each new profile/prepared-map schema is 0.1.0. Package, POC, production-plan and PSF versions are unchanged. This branch incorporates merged polygon-diffraction PR #157 and reconciles the root API increment with that predecessor.
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Executed environment capture to native RAW
|
|
2
2
|
|
|
3
|
-
Release context: **package 1.0
|
|
3
|
+
Release context: **package 1.2.0 candidate / root API 1.2.0**. Subsystem/model versions and dated introduction or measurement records below are independent historical identities; they are not distribution versions. See [developer navigation](DEVELOPERS.md) and [release contract](RELEASE_1_2_0.md).
|
|
4
4
|
|
|
5
5
|
`calculateEnvironmentSensorPhotoSignal()` executes one destination site's
|
|
6
6
|
bounded environment exposure. `simulateEnvironmentSensorRawFrame()` applies that
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Simulated Sensor RAW DNG / JPEG acceptance
|
|
2
2
|
|
|
3
|
-
Release context: **package 1.0
|
|
3
|
+
Release context: **package 1.2.0 candidate / root API 1.2.0**. Subsystem/model versions and dated introduction or measurement records below are independent historical identities; they are not distribution versions. See [developer navigation](DEVELOPERS.md) and [release contract](RELEASE_1_2_0.md).
|
|
4
4
|
|
|
5
5
|
This record separates implemented export behavior, reproducible independent
|
|
6
6
|
checks and external application acceptance for #16. The files are synthetic
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Generic equipment tier reference assets
|
|
2
2
|
|
|
3
|
-
Release context: **package 1.0
|
|
3
|
+
Release context: **package 1.2.0 candidate / root API 1.2.0**. Subsystem/model versions and dated introduction or measurement records below are independent historical identities; they are not distribution versions. See [developer navigation](DEVELOPERS.md) and [release contract](RELEASE_1_2_0.md).
|
|
4
4
|
|
|
5
5
|
`resolveGenericEquipmentTierCatalog({ presetVersion: "1.0.0" })` returns immutable
|
|
6
6
|
Consumer, Prosumer and Professional body/lens reference bundles. These are
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Call-local geometry preparation reuse: #43
|
|
2
2
|
|
|
3
|
-
Release context: **package 1.0
|
|
3
|
+
Release context: **package 1.2.0 candidate / root API 1.2.0**. Subsystem/model versions and dated introduction or measurement records below are independent historical identities; they are not distribution versions. See [developer navigation](DEVELOPERS.md) and [release contract](RELEASE_1_2_0.md).
|
|
4
4
|
|
|
5
5
|
`calculateGeometricSamplingPlan()` already parses and copies a complete transform
|
|
6
6
|
list at its public boundary. It previously called the public scalar mapping API
|
package/docs/IMAGE_FORMATION.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Image-Formation Contract
|
|
2
2
|
|
|
3
|
-
Release context: **package 1.0
|
|
3
|
+
Release context: **package 1.2.0 candidate / root API 1.2.0**. Subsystem/model versions and dated introduction or measurement records below are independent historical identities; they are not distribution versions. See [developer navigation](DEVELOPERS.md) and [release contract](RELEASE_1_2_0.md).
|
|
4
4
|
|
|
5
5
|
Photivra's image-formation contract defines **scientific ownership, coordinate semantics, and dependency/coupling boundaries** for current and future camera effects.
|
|
6
6
|
|