@micrio/client 7.0.9 → 7.0.11

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/micrio.min.d.ts CHANGED
@@ -711,7 +711,7 @@ declare module '@micrio/client' {
711
711
  archive?: string;
712
712
  archiveLayerOffset?: number;
713
713
  revisions?: Record<string, Record<string, any>>;
714
- settings?: Partial<ImageInfo.Settings>;
714
+ settings?: Record<string, any>;
715
715
  id?: string;
716
716
  name?: string;
717
717
  grid?: {
@@ -1852,6 +1852,10 @@ declare module '@micrio/client' {
1852
1852
  export const VIEWPORT_MARGIN_PCT = 0.05;
1853
1853
  /** Default camera polar angle in radians (0 = side view, π/2 = directly overhead) */
1854
1854
  export const DEFAULT_CAMERA_PHI: number;
1855
+ /** When true, page margins without a texture are discarded instead of drawn as
1856
+ * transparent: they no longer block the pages behind them and you can see
1857
+ * through to the underlying spread. */
1858
+ export const SEE_THROUGH_MARGINS = false;
1855
1859
  /** RGB tint for the front face of each page */
1856
1860
  export const FRONT_COLOR: [number, number, number];
1857
1861
  /** RGB tint for the back face of each page */
@@ -2029,11 +2033,20 @@ declare module '@micrio/client' {
2029
2033
  export class PaperRenderer {
2030
2034
  #private;
2031
2035
  _tiltShiftEnabled: boolean;
2036
+ /** When true, page margins without a texture are discarded (see-through) instead of drawn as transparent, so pages behind remain visible. */
2037
+ _seeThroughMargins: boolean;
2032
2038
  constructor(gl: WebGL2RenderingContext);
2033
2039
  _initialize(meshes: PaperMesh[]): void;
2034
2040
  _setPageTextures(pageIndex: number, frontBitmap: TexImageSource, backBitmap: TexImageSource): void;
2035
2041
  _setPageHiResTexture(pageIdx: number, side: 0 | 1, slot: 0 | 1, bitmap: ImageBitmap): void;
2036
2042
  _setPageBlend(pageIdx: number, frontBlendA: number, frontBlendB: number, backBlendA: number, backBlendB: number): void;
2043
+ /**
2044
+ * Sets the per-page texture regions (see the fragment shader): each page's
2045
+ * front/back texture only occupies a sub-rectangle `[uMin, vMin, fU, fV]` of
2046
+ * the page UV space. Pass regions of `(0, 0, 1, 1)` to stretch textures over
2047
+ * the whole page. Each array has `4 · pageCount` floats.
2048
+ */
2049
+ _setAspectRegions(frontRegions: Float32Array, backRegions: Float32Array): void;
2037
2050
  _evictPageHiRes(pageIdx: number, side: 0 | 1, slot: 0 | 1): void;
2038
2051
  _getCanvas(): HTMLCanvasElement;
2039
2052
  _setLightingPreset(name: string, params: Record<string, number>): void;
@@ -2143,8 +2156,8 @@ declare module '@micrio/client' {
2143
2156
  _gravity: number;
2144
2157
  _gravityEnabled: boolean;
2145
2158
  }
2146
- export function isWasmReady(): boolean;
2147
- export function initWasmSolver(meshes: PaperMesh[], pageCount: number): Promise<void>;
2159
+ export function isSolverReady(): boolean;
2160
+ export function initSolver(meshes: PaperMesh[], pageCount: number): Promise<void>;
2148
2161
  export function dispatchSolve(subDt: number, activeIndices: number[], substeps: number, solverSettings: SolverSettings, meshes: PaperMesh[], progress: Float32Array, totalStackHeight: number, pageCount: number, pageThickness: number): void;
2149
2162
 
2150
2163
  export class IIIFTextureManager {
@@ -2184,6 +2197,18 @@ declare module '@micrio/client' {
2184
2197
  /** World-space direction of increasing image v (not normalized). */
2185
2198
  _tangentV: Vec3;
2186
2199
  }
2200
+ /**
2201
+ * The sub-rectangle of a page's UV space in which a texture is displayed with
2202
+ * its native aspect ratio. `uMin`/`vMin` are the lower-left corner and
2203
+ * `fU`/`fV` the fraction of the page's u/v range the texture occupies. A region
2204
+ * of `(0, 0, 1, 1)` stretches the texture over the whole page.
2205
+ */
2206
+ export interface TexRegion {
2207
+ uMin: number;
2208
+ vMin: number;
2209
+ fU: number;
2210
+ fV: number;
2211
+ }
2187
2212
  /**
2188
2213
  * Returns the world-space position, surface normal and UV tangents of a
2189
2214
  * relative texture coordinate (u, v) on a page mesh, using the mesh's *current*
@@ -2194,14 +2219,18 @@ declare module '@micrio/client' {
2194
2219
  * 1 = back face (sampled with the U axis mirrored on a single-grid PaperMesh,
2195
2220
  * or on the separate back-face grid of a CoverMesh).
2196
2221
  *
2222
+ * `region` restricts the image to a sub-rectangle of the page (see
2223
+ * {@link TexRegion}); the tangents are scaled accordingly. When omitted the
2224
+ * image is stretched over the whole page.
2225
+ *
2197
2226
  * Returns null when (u, v) falls outside [0, 1].
2198
2227
  */
2199
- export function uvToWorldPosition(mesh: PaperMesh, u: number, v: number, side: 0 | 1): UvWorldResult | null;
2228
+ export function uvToWorldPosition(mesh: PaperMesh, u: number, v: number, side: 0 | 1, region?: TexRegion | null): UvWorldResult | null;
2200
2229
  /**
2201
2230
  * Like `uvToWorldPosition` but returns only the interpolated world-space
2202
2231
  * position, skipping the surface normal and tangent computation.
2203
2232
  */
2204
- export function sampleMeshPosition(mesh: PaperMesh, u: number, v: number, side: 0 | 1): Vec3 | null;
2233
+ export function sampleMeshPosition(mesh: PaperMesh, u: number, v: number, side: 0 | 1, region?: TexRegion | null): Vec3 | null;
2205
2234
  /**
2206
2235
  * Projects a world-space point through the given view-projection matrix to CSS
2207
2236
  * pixel coordinates relative to the canvas top-left. Returns null when the point
@@ -2237,6 +2266,10 @@ declare module '@micrio/client' {
2237
2266
  _tiltShift?: boolean;
2238
2267
  _lightingPreset?: string;
2239
2268
  _useIndividualAspects?: boolean;
2269
+ /** When true, page margins without a texture are discarded instead of drawn as
2270
+ * transparent: they no longer block the pages behind them and you can see
2271
+ * through to the underlying spread. */
2272
+ _seeThroughMargins?: boolean;
2240
2273
  _startPageIdx?: number;
2241
2274
  /** Base URL for the IIIF image server (hi-res streaming). */
2242
2275
  _iiifBaseUrl?: string;