std.image.base.common
base-map
added in 3.0
(base-map image)color->standard-color
added in 3.0
(color->standard-color {:keys [size model], :as image})convert
added in 3.0
(convert image)(convert image to-model)convert-base
added in 3.0
(convert-base {:keys [data size], :as image} model)copy
added in 3.0
(copy {:keys [model data size], :as image})create-channels
added in 3.0
(create-channels model length)creates channels based on the image
(-> (create-channels (model/model :int-argb) 4) first vec) => 0 0 0 0
display-standard-data
added in 3.0
(display-standard-data data)empty
added in 3.0
(empty size model)creates an empty image
(empty 100 100(model/model :int-argb)) => (contains {:size {:width 100, :height 100} :model map? :data #(-> % count (= 10000))})
gray->standard-gray
added in 3.0
(gray->standard-gray {:keys [size], :as image})converts a gray image to the standard gray image
(->> {:model (model/model :ushort-gray) :size 2 1 :data (short-array 256 (* 8 256))} (gray->standard-gray) :data :raw vec) => 1 8
mask-value
added in 3.0
(mask-value v start mask)gets a value out according to the mask applied
(mask-value 20 ;; 010100 2 ;; ||| 7 ;; 111 ) ;; ||| => 5 ;; 101
retrieve-all
added in 3.0
(retrieve-all {:keys [model data], :as image} length)retrieve-single
added in 3.0
(retrieve-single from to name model length)set-all
added in 3.0
(set-all from-channels to-channels to-model length)sets all channels according to the given model
(-> (set-all [(byte-array 255 255) (byte-array 10 40) (byte-array 20 50) (byte-array 30 60)] (byte-array 4) (short-array 2) {:type :color :label :custom :meta {:type Byte/TYPE, :span 2} {:type Short/TYPE, :span 1} :channel {:count 2 :fn identity :inv identity} :data {:alpha {:type Byte/TYPE :channel 0 :index 0} :red {:type Byte/TYPE :channel 0 :index 1}, :green {:type Byte/TYPE :channel 1 :index 0 :access 8 8}, :blue {:type Byte/TYPE :channel 1 :index 0 :access 0 8}}} 2) ((fn barr iarr [(vec barr) (util/>> iarr 8 8)]))) => [-1 10 -1 40 [20 30 50 60]]
set-single
added in 3.0
(set-single from-channels to-channel to-channel-model table length)set-single-val
added in 3.0
(set-single-val data entries from-size to-size)shift-value
added in 3.0
(shift-value v scale)shifts the value according to the scaling
(shift-value 4 2) => 16
(shift-value 4 -2) => 1
slice
added in 3.0
(slice {:keys [size model data], :as image} name)standard-color->standard-gray
added in 3.0
(standard-color->standard-gray {:keys [size data], :as image})standard-color-data->standard-gray
added in 3.0
(standard-color-data->standard-gray {:keys [alpha red green blue]} to-bytes length)standard-gray->standard-color
added in 3.0
(standard-gray->standard-color {:keys [size data], :as image})standard-type->standard-type
added in 3.0
(standard-type->standard-type {:keys [model], :as image} type)converts between standard types
(-> {:model (model/model :standard-argb) :size 2 1 :data {:alpha (byte-array -1 -1) :red (byte-array 1 2) :green (byte-array 3 4) :blue (byte-array 5 6)}} ;; Does not change (standard-type->standard-type :color) ;; Converts to gray (standard-type->standard-type :gray) :data display-standard-data) => {:raw 3 4}
standard-type->type
added in 3.0
(standard-type->type {:keys [data size], :as standard} model)subimage
added in 3.0
(subimage {:keys [model data size], :as image} x y w h)returns a subimage of an original image
(-> (subimage {:model (model/model :standard-argb) :size 2 2 :data {:alpha (byte-array 255 255 255 255) :red (byte-array 10 20 30 40) :green (byte-array 50 60 70 80) :blue (byte-array 90 100 110 120)}} 0 0 1 2) :data display-standard-data) => {:alpha -1 -1, :red 10 30, :green 50 70, :blue 90 110}
type->standard-type
added in 3.0
(type->standard-type {:keys [model], :as image})converts a color image to the standard color image
(->> {:model (model/model :ushort-gray) :size 2 1 :data (short-array 256 (* 8 256))} (type->standard-type) :data :raw vec) => 1 8