Class: Tile

Tile

Represents a single tile in an image tiling system. Tiles are fundamental units used to manage large images through regular grid subdivision. Supports both traditional pyramid tiling and specialized formats like RTI/BRDF.

Features:

  • Multi-channel texture support
  • Cache management properties
  • Format-specific byte positioning
  • Flexible layout compatibility
  • Priority-based loading

Usage Contexts:

  1. Tiled Layouts:

    • Part of zoom level pyramid
    • Grid-based positioning (x, y, level)
  2. Image Layouts:

    • Direct image subdivision
    • Dimensional specification (w, h)
  3. Specialized Formats:

    • RTI (Reflectance Transformation Imaging)
    • BRDF (Bidirectional Reflectance Distribution Function)
    • TAR-based formats (tarzoom, itarzoom)

Implementation Details

Property Categories:

  1. Identification:
{
    index: number,    // Unique tile ID
    bbox: number[],   // Spatial bounds
}
  1. Positioning:
{
    // Tiled Layout Properties
    level: number,    // Zoom level
    x: number,        // Grid X
    y: number,        // Grid Y
    
    // Image Layout Properties
    w: number,        // Width
    h: number,        // Height
}
  1. Data Access:
{
    start: number,    // Byte start
    end: number,      // Byte end
    tex: WebGLTexture[], // Channel textures
    missing: number,  // Pending channels
}
  1. Cache Management:
{
    time: number,     // Creation time
    priority: number, // Load priority
    size: number      // Memory size
}

Format-Specific Considerations:

  1. Standard Tiling:
  • Uses level, x, y for pyramid positioning
  • Single texture per tile
  1. RTI/BRDF:
  • Multiple textures per tile (channels)
  • Missing counter tracks channel loading
  1. TAR Formats:
  • Uses start/end for byte positioning
  • Enables direct data access in archives

Cache Management:

  • time: Used for LRU (Least Recently Used) calculations
  • priority: Influences loading order
  • size: Helps manage memory constraints

new Tile()

Creates a new Tile instance with default properties

Source:
Examples
```javascript
// Create a basic tile
const tile = new Tile();
tile.level = 2;
tile.x = 3;
tile.y = 4;
tile.priority = 1;
```
```javascript
// Create a multi-channel tile
const tile = new Tile();
tile.tex = new Array(3); // For RGB channels
tile.missing = 3; // Waiting for all channels
```