(->array img)
(->array img rect)
(->array img rect dest-array)
Copy a rect from the image into an array.
Copy a rect from the image into an array.
(array-> img source-array)
(array-> img rect source-array)
Copy an array of data into a rect in the image.
Copy an array of data into a rect in the image.
(array-matches-image? img array-data)
(array-matches-image? img rect array-data)
(buffered-image-> buffered-image)
(buffered-image-> img buffered-image)
Convert a buffered image into a new image. If no implementation image is provided then one is created using the default image implementation.
Convert a buffered image into a new image. If no implementation image is provided then one is created using the default image implementation.
(clip-rect item-rect clip-rect)
clip item rect such that it fits within clip-rect
clip item rect such that it fits within clip-rect
(clone source-image)
Copy the image producing a new image of the same type.
Copy the image producing a new image of the same type.
(convert source-img dst-image-type)
Convert a source image to the desired image type. Always returns a new image even in the case where a new image is not required.
Convert a source image to the desired image type. Always returns a new image even in the case where a new image is not required.
(copy-to source-img dest-img)
(copy-to source-img source-rect dest-img dest-x dest-y)
Copy a sub-rect of the source image to a sub-rect of the destination image. This function does not coerce types so the types of the images must match exactly.
Copy a sub-rect of the source image to a sub-rect of the destination image. This function does not coerce types so the types of the images must match exactly.
(draw-rect img bbox int-color)
Given an input image, draw a bounding box in the color defined by a packed int color. Return a new image
Given an input image, draw a bounding box in the color defined by a packed int color. Return a new image
(ensure-buffered-image img)
As cheaply as possible, convert to buffered image.
As cheaply as possible, convert to buffered image.
(ensure-valid-bounding-rect bbox width height)
Ensure this rect contains enough of an image to mean something and make sure it is within the bounds of the image.
Ensure this rect contains enough of an image to mean something and make sure it is within the bounds of the image.
(fill img int-color)
(fill img rect int-color)
Fill a rect of the image with a solid color
Fill a rect of the image with a solid color
(fixed-sized-matrix source-matrix
content-bbox
inner-bbox-seq
background-color
dest-width
dest-height
&
{:keys [widen-ratio ignore-background]})
(get-height-from-aspect-width aspect width)
aspect defined as width/height
aspect defined as width/height
(get-larger-target-dims src-width src-height dest-aspect)
Get the target width,height if you want a new image with the destination aspect ratio by enlarging (no cropping)
Get the target width,height if you want a new image with the destination aspect ratio by enlarging (no cropping)
(get-width-from-aspect-height aspect height)
aspect defined as width/height
aspect defined as width/height
(grayscale-pixels img)
Return a byte array of grayscale pixels for the image.
Return a byte array of grayscale pixels for the image.
(image->mask-image img)
Given an image, take pixels that have any non-black color at all and make them a mask.
Given an image, take pixels that have any non-black color at all and make them a mask.
(image-type img)
Return one of [:rgba :rgb :gray]
Return one of [:rgba :rgb :gray]
(new-image new-width new-height)
(new-image img new-width new-height)
(new-image img new-width new-height image-type)
Create a new image potentially using the default image implementation and the default image type.
Create a new image potentially using the default image implementation and the default image type.
(new-image-from-prototype prototype)
(new-image-from-prototype prototype image-type)
Create a new image using the height, width, and possibly the image type of the prototype image.
Create a new image using the height, width, and possibly the image type of the prototype image.
(pad-or-resize img dest-width background-color)
(pad-or-resize img dest-width background-color bounding-rect-seq)
Either pad or resize an image using background color when padding. When resize by a small enough amount, it is better quality-wise to pad. The function also optionally takes a sequence of bounding boxes that pertain to the image and adjusts them so they are in the same relative location on the new image. Returns either the image or a tuple of the image and the resized bounding boxes.
Either pad or resize an image using background color when padding. When resize by a small enough amount, it is better quality-wise to pad. The function also optionally takes a sequence of bounding boxes that pertain to the image and adjusts them so they are in the same relative location on the new image. Returns either the image or a tuple of the image and the resized bounding boxes.
(release source-img)
Release a given image. Optional operations and systems that require this should use the resource system (thinktopic/resource).
Release a given image. Optional operations and systems that require this should use the resource system (thinktopic/resource).
(resize img new-width)
(resize img new-width new-height)
Resize (scale) the image return a new image of the same type.
Resize (scale) the image return a new image of the same type.
(set-alpha-mask source-img alpha-bytes)
Given a source image set it's alpha mask to be these mask bytes. Produces a new rgba image.
Given a source image set it's alpha mask to be these mask bytes. Produces a new rgba image.
(shrink-if-same-dimensions img bounding-rect)
Shrink the bounding rect if it is the same dimensions as the image.
Shrink the bounding rect if it is the same dimensions as the image.
(sub-image img)
(sub-image img rect)
Create a new sub-image from an existing image
Create a new sub-image from an existing image
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close