# Class Histogram

直方图

- Defined in lib/five/texture/histogram.ts:100

##### Index

### Constructors

constructor

### Properties

max
mean
min
peak

### Methods

formPixels
toArray
toJSON
toString

## Constructors

### constructor

- new Histogram(
  peak?: number,
  mean?: number,
  min?: number,
  max?: number,
  ): Histogram

  #### Parameters

  - `Optional` peak: number
  - `Optional` mean: number
  - `Optional` min: number
  - `Optional` max: number

  #### Returns Histogram

  - Defined in lib/five/texture/histogram.ts:111

## Properties

### max

max: number

最大值

- Defined in lib/five/texture/histogram.ts:109

### mean

mean: number

平均值

- Defined in lib/five/texture/histogram.ts:105

### min

min: number

最小值

- Defined in lib/five/texture/histogram.ts:107

### peak

peak: number

峰值

- Defined in lib/five/texture/histogram.ts:103

## Methods

### formPixels

- formPixels(
  ...rgbaArray: (
  Uint8Array<ArrayBufferLike>
  | Uint8ClampedArray<ArrayBufferLike>
  )[],
  ): Histogram

  从图像获取直方图

  #### Parameters

  - ...rgbaArray: (Uint8Array<ArrayBufferLike> | Uint8ClampedArray<ArrayBufferLike>)[]

    像素数组，像素 rgba 排列

  #### Returns Histogram

  - Defined in lib/five/texture/histogram.ts:122

### toArray

- toArray(): number[]

  导出直方图参数为数组 [peak, mean, min, max]

  #### Returns number[]

  - Defined in lib/five/texture/histogram.ts:145

### toJSON

- toJSON(): { max: number; mean: number; min: number; peak: number }

  #### Returns { max: number; mean: number; min: number; peak: number }

  - Defined in lib/five/texture/histogram.ts:133

### toString

- toString(): string

  导出直方图参数为字符串 peak mean min max

  #### Returns string

  - Defined in lib/five/texture/histogram.ts:152