Counts number of values in a vector that are different from the 'background'.

inked(v, bg, tol = 1/(2^32))

Arguments

v

A vector of pixels. It will generally be either a row or column from a text canvas.

bg

The background value.

tol

A tolerance around the background value. Defaults to 1/(2^32).

Value

A numeric value corresponding to the number of non-background values in v.

Details

Counts number of values in a vector that are different from the 'background'. Intended to be apply()ed to the rows or columns of a matrix (a color plane in a text canvas).

Not necessarily intended to be called by the end user.

Author

Dave Braze <davebraze@gmail.com>