/**
 * Spritesheet splitting types
 */

/** A detected sprite region with bounds and position */
export interface SpriteRegion {
  x: number;
  y: number;
  width: number;
  height: number;
  pixelCount?: number;
}

/** A sprite preview with data URL for display */
export interface SpritePreview {
  url: string;
  x: number;
  y: number;
  width: number;
  height: number;
  isEmpty: boolean;
}

/** Detection mode for sprite splitting */
export type DetectionMode = 'grid' | 'auto';

/** Options for grid-based splitting */
export interface GridSplitOptions {
  cellWidth: number;
  cellHeight: number;
  preserveCellSize: boolean;
  removeEmpty: boolean;
}

/** Options for auto-detection splitting */
export interface AutoDetectOptions {
  sensitivity: number;
  removeEmpty: boolean;
}

/** Worker message for irregular sprite detection */
export interface SpriteWorkerMessage {
  type: 'detectIrregularSprites';
  imageData: ImageData;
  sensitivity: number;
  maxSize?: number;
}

/** Worker response with detected sprites */
export interface SpriteWorkerResponse {
  type: 'spritesDetected';
  sprites: SpriteRegion[];
  backgroundColor: [number, number, number, number];
}
