import { IDataLayer } from '@farmmaps/common';

export interface IColor {
  red: number,
  green: number,
  blue: number,
  alpha: number,
}

export interface IColorEntry {
   value: number,
   color: IColor,
   label: string
}

export interface IHistogramEntry {
  value: number,
  freqency: number
}

export interface IHistogram {
  min: number,
  max: number,
  mean: number,
  stddev: number,
  classes: number,
  entries: IHistogramEntry[],
  confidence?: number;
}

export interface IStatistics {
  min: number;
  max: number;
  mean: number;
  stddev: number;
  populationCount: number;
  minPlus: number;
  maxMinus: number;
  mode: number;
  median: number;
  curtosis: number;
  skewness: number;
  variance: number;
  variationCoefficient: number;
  confidenceIntervalErrorMargin: number;
  confidenceIntervalLow: number;
  confidenceIntervalHigh: number;
}

export interface IGradientstop {
  relativestop: number,
  color: IColor
}

export interface IColorMap {
  gradient: IGradientstop[],
  noValue: IColor,
  entries: IColorEntry[],
  colormapType: string
}

export interface IBand {
  histogram: IHistogram;
  statistics: IStatistics;
}


export interface IRenderer {
  band:IBand,
  colorMap: IColorMap,
  renderType:string
}

export interface IRenderoutput {
  renderoutputType: string
}

export interface IRenderoutputTiles {
  renderoutputType: string,
  minzoom: number,
  maxzoom: number
}

export interface IRenderoutputImage {
  renderoutputType: string,
  extent: [number,number,number,number]
}

export interface ILayer extends IDataLayer {
  renderer: IRenderer,
  rendering: IRenderoutput,
  minzoom: number,
  maxzoom: number
}
