Basic color operations
Basic color operations
(alpha c)
Returns alpha value.
Returns alpha value.
(blue c)
Returns blue (third channel) value. See also [[ch2]].
Returns blue (third channel) value. See also [[ch2]].
(green c)
Returns green (second channel) value. See also [[ch1]].
Returns green (second channel) value. See also [[ch1]].
(luma c)
Returns luma
Returns luma
(red c)
Returns red (first channel) value. See also [[ch0]].
Returns red (first channel) value. See also [[ch0]].
(to-awt-color c)
Convert any color representation to java.awt.Color
.
Convert any color representation to `java.awt.Color`.
(to-color c)
Convert any color representation to Vec4
vector.
Convert any color representation to `Vec4` vector.
Image Protocol
Image Protocol
(convolve i t)
Convolve with Java ConvolveOp. See [[convolution-matrices]] for kernel names.
Convolve with Java ConvolveOp. See [[convolution-matrices]] for kernel names.
(get-image i)
Return BufferedImage
Return BufferedImage
(height i)
Height of the image.
Height of the image.
(resize i w h)
Resize image.
Resize image.
(save i n)
Save image i
to a file n
.
Save image `i` to a file `n`.
(subimage i x y w h)
Return part of the image.
Return part of the image.
(width i)
Width of the image.
Width of the image.
Access to key event data
Access to key event data
(key-char e)
Key as char.
Key as char.
(key-code e)
Keycode mapped to keyword. See java.awt.event.KeyEvent
documentation. Eg. VK_LEFT
is mapped to :left
.
Keycode mapped to keyword. See `java.awt.event.KeyEvent` documentation. Eg. `VK_LEFT` is mapped to `:left`.
(key-raw e)
Raw value for pressed key (as integer).
Raw value for pressed key (as integer).
Get state of keyboard modifiers.
Get state of keyboard modifiers.
(alt-down? e)
ALT key state as boolean.
ALT key state as boolean.
(alt-gr-down? e)
ALT-GR key state as boolean.
ALT-GR key state as boolean.
(control-down? e)
CONTROL key state as boolean.
CONTROL key state as boolean.
(meta-down? e)
META key state as boolean.
META key state as boolean.
(shift-down? e)
SHIFT key state as boolean.
SHIFT key state as boolean.
Get pressed mouse button status.
Get pressed mouse button status.
(mouse-button m)
Get mouse pressed button status: :left :right :center or :none
Get mouse pressed button status: :left :right :center or :none
Mouse position.
Mouse position.
(mouse-pos m)
Mouse position as [[Vec2]] type. [0,0] - top left, [-1,-1] outside window.
Mouse position as [[Vec2]] type. [0,0] - top left, [-1,-1] outside window.
(mouse-x m)
Mouse horizontal position within window. 0 - left side. -1 outside window.
Mouse horizontal position within window. 0 - left side. -1 outside window.
(mouse-y m)
Mouse vertical position. 0 - top, -1 outside window.
Mouse vertical position. 0 - top, -1 outside window.
Functions for accessing and setting channel values or colors. PixelsProto is used in following types:
Pixels
- all functionsImage
, Canvas
, Window
- Only [[get-value]] and [[get-color]] for given position and conversion to Pixels. Accessing color or channel value is slow.Log density renderer
- Only [[set-color!]], [[get-color]] and conversion to Pixels.Functions for accessing and setting channel values or colors. PixelsProto is used in following types: * `Pixels` - all functions * `Image`, `Canvas`, `Window` - Only [[get-value]] and [[get-color]] for given position and conversion to Pixels. Accessing color or channel value is slow. * `Log density renderer` - Only [[set-color!]], [[get-color]] and conversion to Pixels.
(get-channel pixels ch)
Return whole ints
array with chosen channel
Return whole `ints` array with chosen channel
(get-color pixels idx)
(get-color pixels x y)
Get color by index or position. In case of low density rendering returns current average color without alpha value.
Get color by index or position. In case of low density rendering returns current average color without alpha value.
(get-value pixels ch idx)
(get-value pixels ch x y)
Get channel value by index or position.
Get channel value by index or position.
(set-channel! pixels ch v)
Set whole channel (as ints
array)
Set whole channel (as `ints` array)
(set-color! pixels idx v)
(set-color! pixels x y v)
Set color value by index or position.
Set color value by index or position.
(set-value! pixels ch idx v)
(set-value! pixels ch x y v)
Set channel value by index or position
Set channel value by index or position
(to-pixels pixels)
(to-pixels pixels cfg)
Convert to Pixels. For low density rendering provide configuration. Works with Image/Canvas/Window and low density renderer.
Convert to Pixels. For low density rendering provide configuration. Works with Image/Canvas/Window and low density renderer.
Key or mouse pressed status.
Key or mouse pressed status.
(key-pressed? w)
Any key pressed? (boolean)
Any key pressed? (boolean)
(mouse-pressed? w)
Any mouse button pressed? (boolean)
Any mouse button pressed? (boolean)
(add-pixel! r x y)
(add-pixel! r x y c)
(get-pixel r x y)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close