Liking cljdoc? Tell your friends :D

libmooncat.image.pixels


*debug-print*clj/s


+max-dim+clj/s


gen-pixel-dataclj/s

(gen-pixel-data pixels)
(gen-pixel-data pixels remap-palette scale-factor)

Takes a pixels vector which contains vectors of triples [x y i] with x-coordinate x y-coordinate y and palette-index i

e.g. [[4 4 1] [3 1 2] ...]

It computes the minimum bounding rectangle and evaluates to a map containing: :pixels - the supplied pixels vec :width - the (minimized) image width :height - the (minimized) image height :offset-x - translation offset for raw x coord to minimized x coord :offset-y - translation offset for raw y coord to minimized y coord :palette-mapping - mapping of compressed and sorted palette-indexes {old-index0 new-index0, old-index1 new-index1, ...} :idat - a zlib compressed PNG IDAT compatible pixel data array :idat-hex - the PNG IDAT data in hexidecimal

Takes a `pixels` vector which contains vectors of triples
`[x y i]` with x-coordinate `x` y-coordinate `y` and
palette-index `i`

e.g.
`[[4 4 1]
  [3 1 2]
  ...]`


It computes the minimum bounding rectangle and evaluates
to a map containing:
  :pixels - the supplied `pixels` vec
  :width - the (minimized) image width
  :height - the (minimized) image height
  :offset-x - translation offset for raw `x` coord to minimized `x` coord
  :offset-y - translation offset for raw `y` coord to minimized `y` coord
  :palette-mapping - mapping of compressed and sorted palette-indexes
                      `{old-index0 new-index0, old-index1 new-index1, ...}`
  :idat - a zlib compressed PNG IDAT compatible pixel data array
  :idat-hex - the PNG IDAT data in hexidecimal
raw docstring

minimize-imageclj/s

(minimize-image pixels)

Takes a pixels vector which contains vectors of triples [x y i] with x-coordinate x y-coordinate y and palette-index i

e.g. [[4 4 1] [3 1 2] ...]

It computes the minimum bounding rectangle and evaluates to a pipeline map containing:

:pixels - the supplied pixels vector :width - the (minimized) image width :height - the (minimized) image height :offset-x - translation offset for raw x coord to minimized x coord :offset-y - translation offset for raw y coord to minimized y coord

Takes a `pixels` vector which contains vectors of triples
`[x y i]` with x-coordinate `x` y-coordinate `y` and
palette-index `i`

e.g.
`[[4 4 1]
  [3 1 2]
  ...]`

It computes the minimum bounding rectangle and evaluates
to a `pipeline` map containing:

  :pixels - the supplied pixels vector
  :width - the (minimized) image width
  :height - the (minimized) image height
  :offset-x - translation offset for raw `x` coord to minimized `x` coord
  :offset-y - translation offset for raw `y` coord to minimized `y` coord
raw docstring

read-pixel-dataclj/s

(read-pixel-data {:as pixel-data
                  :keys [width height idat-hex idat offset-x offset-y palette-fn
                         mirror]
                  :or {offset-x 0 offset-y 0 palette-fn identity}})

Takes a pixel-data map which must contain the keys: :width - width of the image :height - height of the image :idat-hex - hex encoded (compressed) IDAT byte array

and the optional keys: :offset-x - added to x coordinates :offset-y - added to y coordinates :palette-fn - run on the palette index :mirror - if true flip pixels horizontally

Evaluates to a pixels vec which contains vectors of triples [x y i] with x-coordinate x y-coordinate y and palette-index i

Takes a `pixel-data` map which must contain the keys:
  :width - width of the image
  :height - height of the image
  :idat-hex - hex encoded (compressed) IDAT byte array

and the optional keys:
  :offset-x - added to `x` coordinates
  :offset-y - added to `y` coordinates
  :palette-fn - run on the palette index
  :mirror - if true flip pixels horizontally

Evaluates to a `pixels` vec which contains vectors of triples
`[x y i]` with x-coordinate `x` y-coordinate `y` and
palette-index `i`
raw docstring

scale-pixel-bytesclj/s

(scale-pixel-bytes {:as pipeline :keys [pixel-byte-array width height]}
                   scale-factor)

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close