MCPcopy
hub / github.com/nodeca/pica / clampTo8

Function clampTo8

src/mm_resize/convolve.ts:6–6  ·  view source on GitHub ↗
(i: number)

Source from the content-addressed store, hash-verified

4// var FIXED_FRAC_BITS = 14;
5
6function clampTo8 (i: number): number { return i < 0 ? 0 : (i > 255 ? 255 : i) }
7function clampNegative (i: number): number { return i >= 0 ? i : 0 }
8
9import type { MathImageBuffer } from '../mathlib'

Callers 2

convolveVertFunction · 0.85
convolveVertWithPreFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…