@image-marker/web 0.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.
Files changed (124) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +100 -0
  3. package/api-contract.json +224 -0
  4. package/lib/commonjs/core/batch.d.ts +32 -0
  5. package/lib/commonjs/core/batch.js +85 -0
  6. package/lib/commonjs/core/content-credentials.d.ts +53 -0
  7. package/lib/commonjs/core/content-credentials.js +96 -0
  8. package/lib/commonjs/core/image-info.d.ts +30 -0
  9. package/lib/commonjs/core/image-info.js +348 -0
  10. package/lib/commonjs/core/index.d.ts +1014 -0
  11. package/lib/commonjs/core/index.js +92 -0
  12. package/lib/commonjs/core/invisible-watermark.d.ts +102 -0
  13. package/lib/commonjs/core/invisible-watermark.js +913 -0
  14. package/lib/commonjs/core/job.d.ts +57 -0
  15. package/lib/commonjs/core/job.js +151 -0
  16. package/lib/commonjs/core/layout.d.ts +19 -0
  17. package/lib/commonjs/core/layout.js +75 -0
  18. package/lib/commonjs/core/marker.d.ts +1 -0
  19. package/lib/commonjs/core/marker.js +11 -0
  20. package/lib/commonjs/core/recipe.d.ts +44 -0
  21. package/lib/commonjs/core/recipe.js +175 -0
  22. package/lib/commonjs/core/result.d.ts +34 -0
  23. package/lib/commonjs/core/result.js +41 -0
  24. package/lib/commonjs/core/trace-runtime.d.ts +43 -0
  25. package/lib/commonjs/core/trace-runtime.js +92 -0
  26. package/lib/commonjs/core/validate.d.ts +4 -0
  27. package/lib/commonjs/core/validate.js +192 -0
  28. package/lib/commonjs/core/web/browser.d.ts +105 -0
  29. package/lib/commonjs/core/web/browser.js +434 -0
  30. package/lib/commonjs/core/web/helpers.d.ts +41 -0
  31. package/lib/commonjs/core/web/helpers.js +264 -0
  32. package/lib/commonjs/core/web/index.d.ts +59 -0
  33. package/lib/commonjs/core/web/index.js +724 -0
  34. package/lib/commonjs/core/web/invisible-worker-client.d.ts +13 -0
  35. package/lib/commonjs/core/web/invisible-worker-client.js +140 -0
  36. package/lib/commonjs/core/web/renderer.d.ts +20 -0
  37. package/lib/commonjs/core/web/renderer.js +665 -0
  38. package/lib/commonjs/core/web/runtime.d.ts +106 -0
  39. package/lib/commonjs/core/web/runtime.js +2 -0
  40. package/lib/commonjs/editor/adapter.d.ts +26 -0
  41. package/lib/commonjs/editor/adapter.js +102 -0
  42. package/lib/commonjs/editor/controller.d.ts +106 -0
  43. package/lib/commonjs/editor/controller.js +919 -0
  44. package/lib/commonjs/editor/core-contract.d.ts +2 -0
  45. package/lib/commonjs/editor/core-contract.js +23 -0
  46. package/lib/commonjs/editor/geometry.d.ts +8 -0
  47. package/lib/commonjs/editor/geometry.js +109 -0
  48. package/lib/commonjs/editor/headless.d.ts +5 -0
  49. package/lib/commonjs/editor/headless.js +22 -0
  50. package/lib/commonjs/editor/presets.d.ts +19 -0
  51. package/lib/commonjs/editor/presets.js +64 -0
  52. package/lib/commonjs/editor/projection.d.ts +12 -0
  53. package/lib/commonjs/editor/projection.js +195 -0
  54. package/lib/commonjs/editor/types.d.ts +166 -0
  55. package/lib/commonjs/editor/types.js +2 -0
  56. package/lib/commonjs/editor-adapter.d.ts +7 -0
  57. package/lib/commonjs/editor-adapter.js +17 -0
  58. package/lib/commonjs/headless.d.ts +2 -0
  59. package/lib/commonjs/headless.js +26 -0
  60. package/lib/commonjs/index.d.ts +5 -0
  61. package/lib/commonjs/index.js +27 -0
  62. package/lib/commonjs/package.json +1 -0
  63. package/lib/module/core/batch.d.ts +32 -0
  64. package/lib/module/core/batch.js +82 -0
  65. package/lib/module/core/content-credentials.d.ts +53 -0
  66. package/lib/module/core/content-credentials.js +92 -0
  67. package/lib/module/core/image-info.d.ts +30 -0
  68. package/lib/module/core/image-info.js +343 -0
  69. package/lib/module/core/index.d.ts +1014 -0
  70. package/lib/module/core/index.js +56 -0
  71. package/lib/module/core/invisible-watermark.d.ts +102 -0
  72. package/lib/module/core/invisible-watermark.js +897 -0
  73. package/lib/module/core/job.d.ts +57 -0
  74. package/lib/module/core/job.js +143 -0
  75. package/lib/module/core/layout.d.ts +19 -0
  76. package/lib/module/core/layout.js +70 -0
  77. package/lib/module/core/marker.d.ts +1 -0
  78. package/lib/module/core/marker.js +4 -0
  79. package/lib/module/core/recipe.d.ts +44 -0
  80. package/lib/module/core/recipe.js +169 -0
  81. package/lib/module/core/result.d.ts +34 -0
  82. package/lib/module/core/result.js +38 -0
  83. package/lib/module/core/trace-runtime.d.ts +43 -0
  84. package/lib/module/core/trace-runtime.js +89 -0
  85. package/lib/module/core/validate.d.ts +4 -0
  86. package/lib/module/core/validate.js +187 -0
  87. package/lib/module/core/web/browser.d.ts +105 -0
  88. package/lib/module/core/web/browser.js +427 -0
  89. package/lib/module/core/web/helpers.d.ts +41 -0
  90. package/lib/module/core/web/helpers.js +251 -0
  91. package/lib/module/core/web/index.d.ts +59 -0
  92. package/lib/module/core/web/index.js +709 -0
  93. package/lib/module/core/web/invisible-worker-client.d.ts +13 -0
  94. package/lib/module/core/web/invisible-worker-client.js +137 -0
  95. package/lib/module/core/web/renderer.d.ts +20 -0
  96. package/lib/module/core/web/renderer.js +661 -0
  97. package/lib/module/core/web/runtime.d.ts +106 -0
  98. package/lib/module/core/web/runtime.js +1 -0
  99. package/lib/module/editor/adapter.d.ts +26 -0
  100. package/lib/module/editor/adapter.js +99 -0
  101. package/lib/module/editor/controller.d.ts +106 -0
  102. package/lib/module/editor/controller.js +915 -0
  103. package/lib/module/editor/core-contract.d.ts +2 -0
  104. package/lib/module/editor/core-contract.js +2 -0
  105. package/lib/module/editor/geometry.d.ts +8 -0
  106. package/lib/module/editor/geometry.js +103 -0
  107. package/lib/module/editor/headless.d.ts +5 -0
  108. package/lib/module/editor/headless.js +4 -0
  109. package/lib/module/editor/presets.d.ts +19 -0
  110. package/lib/module/editor/presets.js +57 -0
  111. package/lib/module/editor/projection.d.ts +12 -0
  112. package/lib/module/editor/projection.js +188 -0
  113. package/lib/module/editor/types.d.ts +166 -0
  114. package/lib/module/editor/types.js +1 -0
  115. package/lib/module/editor-adapter.d.ts +7 -0
  116. package/lib/module/editor-adapter.js +10 -0
  117. package/lib/module/headless.d.ts +2 -0
  118. package/lib/module/headless.js +2 -0
  119. package/lib/module/index.d.ts +5 -0
  120. package/lib/module/index.js +3 -0
  121. package/lib/module/package.json +1 -0
  122. package/lib/source-manifest.json +34 -0
  123. package/lib/worker/invisible-watermark.js +1 -0
  124. package/package.json +85 -0
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.updateWatermarkRecipeLayer = exports.ungroupWatermarkRecipeLayers = exports.reorderWatermarkRecipeLayer = exports.removeWatermarkRecipeLayer = exports.groupWatermarkRecipeLayers = exports.duplicateWatermarkRecipeLayer = exports.addWatermarkRecipeLayer = void 0;
18
+ __exportStar(require("./editor/headless.js"), exports);
19
+ var recipe_1 = require("@image-marker/recipe");
20
+ Object.defineProperty(exports, "addWatermarkRecipeLayer", { enumerable: true, get: function () { return recipe_1.addWatermarkRecipeLayer; } });
21
+ Object.defineProperty(exports, "duplicateWatermarkRecipeLayer", { enumerable: true, get: function () { return recipe_1.duplicateWatermarkRecipeLayer; } });
22
+ Object.defineProperty(exports, "groupWatermarkRecipeLayers", { enumerable: true, get: function () { return recipe_1.groupWatermarkRecipeLayers; } });
23
+ Object.defineProperty(exports, "removeWatermarkRecipeLayer", { enumerable: true, get: function () { return recipe_1.removeWatermarkRecipeLayer; } });
24
+ Object.defineProperty(exports, "reorderWatermarkRecipeLayer", { enumerable: true, get: function () { return recipe_1.reorderWatermarkRecipeLayer; } });
25
+ Object.defineProperty(exports, "ungroupWatermarkRecipeLayers", { enumerable: true, get: function () { return recipe_1.ungroupWatermarkRecipeLayers; } });
26
+ Object.defineProperty(exports, "updateWatermarkRecipeLayer", { enumerable: true, get: function () { return recipe_1.updateWatermarkRecipeLayer; } });
@@ -0,0 +1,5 @@
1
+ export { default } from './core/index.js';
2
+ export * from './core/index.js';
3
+ export { createWebMarker, Marker, WebMarker } from './core/web/index.js';
4
+ export type * from './core/web/runtime.js';
5
+ export type { WebResourceAdapter } from './core/web/browser.js';
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ var __importDefault = (this && this.__importDefault) || function (mod) {
17
+ return (mod && mod.__esModule) ? mod : { "default": mod };
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.WebMarker = exports.Marker = exports.createWebMarker = exports.default = void 0;
21
+ var index_js_1 = require("./core/index.js");
22
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(index_js_1).default; } });
23
+ __exportStar(require("./core/index.js"), exports);
24
+ var index_js_2 = require("./core/web/index.js");
25
+ Object.defineProperty(exports, "createWebMarker", { enumerable: true, get: function () { return index_js_2.createWebMarker; } });
26
+ Object.defineProperty(exports, "Marker", { enumerable: true, get: function () { return index_js_2.Marker; } });
27
+ Object.defineProperty(exports, "WebMarker", { enumerable: true, get: function () { return index_js_2.WebMarker; } });
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,32 @@
1
+ export interface WatermarkBatchFulfilledResult<Result> {
2
+ status: 'fulfilled';
3
+ value: Result;
4
+ }
5
+ export interface WatermarkBatchRejectedResult {
6
+ status: 'rejected';
7
+ reason: unknown;
8
+ }
9
+ export interface WatermarkBatchAbortedResult {
10
+ status: 'aborted';
11
+ reason: Error;
12
+ }
13
+ export type WatermarkBatchResult<Result> = WatermarkBatchFulfilledResult<Result> | WatermarkBatchRejectedResult | WatermarkBatchAbortedResult;
14
+ export interface WatermarkBatchProgress<Result> {
15
+ total: number;
16
+ settled: number;
17
+ succeeded: number;
18
+ failed: number;
19
+ aborted: number;
20
+ /** Index of the item that produced this progress update. */
21
+ index: number;
22
+ result: WatermarkBatchResult<Result>;
23
+ }
24
+ export interface WatermarkBatchOptions<Result> {
25
+ /** Requested worker count. Web is capped at 4 and native targets at 1. */
26
+ concurrency?: number;
27
+ /** Stops new items from starting. Already-running items are allowed to finish. */
28
+ signal?: AbortSignal;
29
+ /** Called once when each item is fulfilled, rejected, or skipped after abort. */
30
+ onProgress?: (progress: WatermarkBatchProgress<Result>) => void;
31
+ }
32
+ export declare function runWatermarkBatch<Input, Result>(inputs: readonly Input[], task: (input: Input, index: number) => Promise<Result>, batchOptions?: WatermarkBatchOptions<Result>, maximumConcurrency?: number, inputLabel?: string): Promise<Array<WatermarkBatchResult<Result>>>;
@@ -0,0 +1,82 @@
1
+ function abortResult() {
2
+ const reason = new Error('Batch item was not started because the operation was aborted.');
3
+ reason.name = 'AbortError';
4
+ return { status: 'aborted', reason };
5
+ }
6
+ export async function runWatermarkBatch(inputs, task, batchOptions = {}, maximumConcurrency = 1, inputLabel = 'batch') {
7
+ if (!Array.isArray(inputs)) {
8
+ throw new Error(`${inputLabel} inputs must be an array.`);
9
+ }
10
+ const requestedConcurrency = batchOptions.concurrency ?? 1;
11
+ if (!Number.isFinite(requestedConcurrency) ||
12
+ !Number.isInteger(requestedConcurrency) ||
13
+ requestedConcurrency <= 0) {
14
+ throw new Error('concurrency must be a positive finite integer.');
15
+ }
16
+ if (inputs.length === 0) {
17
+ return [];
18
+ }
19
+ const concurrency = Math.min(requestedConcurrency, maximumConcurrency, inputs.length);
20
+ const results = new Array(inputs.length);
21
+ let cursor = 0;
22
+ let settled = 0;
23
+ let succeeded = 0;
24
+ let failed = 0;
25
+ let aborted = 0;
26
+ const report = (index, result) => {
27
+ settled += 1;
28
+ if (result.status === 'fulfilled')
29
+ succeeded += 1;
30
+ else if (result.status === 'rejected')
31
+ failed += 1;
32
+ else
33
+ aborted += 1;
34
+ try {
35
+ batchOptions.onProgress?.({
36
+ total: inputs.length,
37
+ settled,
38
+ succeeded,
39
+ failed,
40
+ aborted,
41
+ index,
42
+ result,
43
+ });
44
+ }
45
+ catch {
46
+ // Progress observers must not interrupt the batch or change results.
47
+ }
48
+ };
49
+ const worker = async () => {
50
+ while (!batchOptions.signal?.aborted) {
51
+ const index = cursor;
52
+ cursor += 1;
53
+ if (index >= inputs.length) {
54
+ return;
55
+ }
56
+ if (batchOptions.signal?.aborted) {
57
+ return;
58
+ }
59
+ let result;
60
+ try {
61
+ result = {
62
+ status: 'fulfilled',
63
+ value: await task(inputs[index], index),
64
+ };
65
+ }
66
+ catch (reason) {
67
+ result = { status: 'rejected', reason };
68
+ }
69
+ results[index] = result;
70
+ report(index, result);
71
+ }
72
+ };
73
+ await Promise.all(Array.from({ length: concurrency }, worker));
74
+ for (let index = 0; index < inputs.length; index += 1) {
75
+ if (!results[index]) {
76
+ const result = abortResult();
77
+ results[index] = result;
78
+ report(index, result);
79
+ }
80
+ }
81
+ return results;
82
+ }
@@ -0,0 +1,53 @@
1
+ import type { EmbedInvisibleWatermarkOptions } from './invisible-watermark.js';
2
+ import { INVISIBLE_WATERMARK_ALGORITHM } from './invisible-watermark.js';
3
+ import type { MarkerResult } from './result.js';
4
+ export interface ContentCredentialsClaim {
5
+ /** Human-readable asset title included in the signed manifest. */
6
+ title: string;
7
+ /** Encoded image type. WebP is supported when the selected adapter accepts it. */
8
+ format?: 'image/jpeg' | 'image/png' | 'image/webp';
9
+ /** Claim generator name shown by Content Credentials readers. */
10
+ generator?: string;
11
+ /** Adapter-specific public metadata. Never include signing secrets. */
12
+ metadata?: Readonly<Record<string, unknown>>;
13
+ }
14
+ export interface ContentCredentialsSignRequest {
15
+ /** Image already containing the invisible locator. */
16
+ image: string;
17
+ /** Locator used to correlate the signed record. */
18
+ locator: string;
19
+ /** Pixel algorithm that wrote the locator. */
20
+ algorithm: typeof INVISIBLE_WATERMARK_ALGORITHM;
21
+ claim: ContentCredentialsClaim;
22
+ }
23
+ export interface ContentCredentialsSignResult {
24
+ /** Image containing the signed Content Credential. */
25
+ image: string;
26
+ manifestId?: string;
27
+ }
28
+ export interface ContentCredentialsVerificationResult {
29
+ valid: boolean;
30
+ manifestId?: string;
31
+ validationStatus?: readonly string[];
32
+ manifest?: unknown;
33
+ }
34
+ export interface ContentCredentialsAdapter {
35
+ sign(request: ContentCredentialsSignRequest): Promise<ContentCredentialsSignResult>;
36
+ verify(image: string): Promise<ContentCredentialsVerificationResult>;
37
+ }
38
+ export interface EmbedInvisibleWithCredentialsOptions {
39
+ watermark: EmbedInvisibleWatermarkOptions;
40
+ adapter: ContentCredentialsAdapter;
41
+ claim: ContentCredentialsClaim;
42
+ }
43
+ export interface EmbedInvisibleWithCredentialsResult {
44
+ watermarkedImage: MarkerResult;
45
+ signedImage: string;
46
+ manifestId?: string;
47
+ }
48
+ export interface VerifyContentCredentialsOptions {
49
+ image: string;
50
+ adapter: ContentCredentialsAdapter;
51
+ }
52
+ export declare function embedInvisibleWithCredentials(embed: (options: EmbedInvisibleWatermarkOptions) => Promise<MarkerResult>, options: EmbedInvisibleWithCredentialsOptions): Promise<EmbedInvisibleWithCredentialsResult>;
53
+ export declare function verifyContentCredentials(options: VerifyContentCredentialsOptions): Promise<ContentCredentialsVerificationResult>;
@@ -0,0 +1,92 @@
1
+ import { INVISIBLE_WATERMARK_ALGORITHM } from './invisible-watermark.js';
2
+ function validateAdapter(adapter) {
3
+ if (!adapter ||
4
+ typeof adapter.sign !== 'function' ||
5
+ typeof adapter.verify !== 'function') {
6
+ throw new Error('Content Credentials adapter must provide sign() and verify() functions.');
7
+ }
8
+ return adapter;
9
+ }
10
+ function snapshotClaim(claim) {
11
+ if (!claim || typeof claim.title !== 'string' || !claim.title.trim()) {
12
+ throw new Error('Content Credentials claim title must not be empty.');
13
+ }
14
+ if (claim.format !== undefined &&
15
+ claim.format !== 'image/jpeg' &&
16
+ claim.format !== 'image/png' &&
17
+ claim.format !== 'image/webp') {
18
+ throw new Error('Content Credentials claim format must be image/jpeg, image/png, or image/webp.');
19
+ }
20
+ if (claim.generator !== undefined &&
21
+ (typeof claim.generator !== 'string' || !claim.generator.trim())) {
22
+ throw new Error('Content Credentials claim generator must be a non-empty string.');
23
+ }
24
+ if (claim.metadata !== undefined &&
25
+ (!claim.metadata ||
26
+ typeof claim.metadata !== 'object' ||
27
+ Array.isArray(claim.metadata))) {
28
+ throw new Error('Content Credentials claim metadata must be an object.');
29
+ }
30
+ return {
31
+ title: claim.title.trim(),
32
+ format: claim.format,
33
+ generator: claim.generator?.trim(),
34
+ metadata: claim.metadata ? { ...claim.metadata } : undefined,
35
+ };
36
+ }
37
+ function validateSignResult(result) {
38
+ if (!result || typeof result.image !== 'string' || !result.image) {
39
+ throw new Error('Content Credentials adapter returned an invalid signed image.');
40
+ }
41
+ if (result.manifestId !== undefined &&
42
+ typeof result.manifestId !== 'string') {
43
+ throw new Error('Content Credentials adapter returned an invalid manifest ID.');
44
+ }
45
+ return result;
46
+ }
47
+ function validateVerificationResult(result) {
48
+ if (!result || typeof result.valid !== 'boolean') {
49
+ throw new Error('Content Credentials adapter returned an invalid verification result.');
50
+ }
51
+ if (result.manifestId !== undefined &&
52
+ typeof result.manifestId !== 'string') {
53
+ throw new Error('Content Credentials adapter returned an invalid manifest ID.');
54
+ }
55
+ if (result.validationStatus !== undefined &&
56
+ (!Array.isArray(result.validationStatus) ||
57
+ result.validationStatus.some((status) => typeof status !== 'string'))) {
58
+ throw new Error('Content Credentials adapter returned invalid validation status data.');
59
+ }
60
+ return result;
61
+ }
62
+ export async function embedInvisibleWithCredentials(embed, options) {
63
+ const adapter = validateAdapter(options?.adapter);
64
+ const claim = snapshotClaim(options?.claim);
65
+ const watermark = {
66
+ ...options.watermark,
67
+ image: { ...options.watermark?.image },
68
+ };
69
+ const locator = watermark.payload;
70
+ const watermarkedImage = await embed(watermark);
71
+ const signed = validateSignResult(await adapter.sign({
72
+ image: watermarkedImage.uri,
73
+ locator,
74
+ algorithm: INVISIBLE_WATERMARK_ALGORITHM,
75
+ claim,
76
+ }));
77
+ const result = {
78
+ watermarkedImage,
79
+ signedImage: signed.image,
80
+ };
81
+ if (signed.manifestId !== undefined) {
82
+ result.manifestId = signed.manifestId;
83
+ }
84
+ return result;
85
+ }
86
+ export async function verifyContentCredentials(options) {
87
+ const adapter = validateAdapter(options?.adapter);
88
+ if (typeof options?.image !== 'string' || !options.image) {
89
+ throw new Error('Content Credentials image must not be empty.');
90
+ }
91
+ return validateVerificationResult(await adapter.verify(options.image));
92
+ }
@@ -0,0 +1,30 @@
1
+ export type ImageOrientation = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
2
+ export type MarkerImageFormat = 'jpeg' | 'png' | 'webp' | 'gif' | 'heif' | 'bmp' | 'unknown';
3
+ export interface MarkerImageInfo {
4
+ /** Display width after applying the encoded orientation. */
5
+ width: number;
6
+ /** Display height after applying the encoded orientation. */
7
+ height: number;
8
+ /** Width stored in the encoded pixel data before orientation is applied. */
9
+ encodedWidth: number;
10
+ /** Height stored in the encoded pixel data before orientation is applied. */
11
+ encodedHeight: number;
12
+ format: MarkerImageFormat;
13
+ mimeType?: string;
14
+ orientation: ImageOrientation;
15
+ rotationDegrees: 0 | 90 | 180 | 270;
16
+ mirrored: boolean;
17
+ requiresNormalization: boolean;
18
+ }
19
+ interface EncodedImageMetadata {
20
+ width: number;
21
+ height: number;
22
+ format: MarkerImageFormat;
23
+ mimeType?: string;
24
+ orientation?: ImageOrientation;
25
+ }
26
+ export declare function createMarkerImageInfo(metadata: EncodedImageMetadata): MarkerImageInfo;
27
+ /** Parse encoded metadata without decoding the image pixels. */
28
+ export declare function parseEncodedImageInfo(input: ArrayBuffer | ArrayBufferView): MarkerImageInfo;
29
+ export declare function parseNativeImageInfo(serialized: string): MarkerImageInfo;
30
+ export {};