Image.Options.Compose (image v0.62.0)
View SourceThis module processes the options for
Image.compose/3.
Since x,y can be relative or absolution, can be symbolic or numeric and can even by a function this becomes more complex that it might initially seem
Summary
Types
When composing an image on a base image, these options drive how the composition proceeds.
Image compoositions options
Types
@type composition_option() :: {:x, non_neg_integer() | nil | :left | :center | :right} | {:y, non_neg_integer() | nil | :top | :middle | :bottom} | {:dx, integer()} | {:dy, integer()} | {:blend_mode, Image.BlendMode.t()} | {:x_baseline, nil | :left | :center | :right} | {:y_baseline, nil | :top | :middle | :bottom}
When composing an image on a base image, these options drive how the composition proceeds.
:xdescribes the absolutexoffset on the base image where this image will be placed. If this option is set to:left,:centeror:rightthen thexposition will be calculated relative to the base image. If:xis nil (the default) then the image will be placed according to the relative offset of the previously composed image using:dx.:ydescribes the absoluteyoffset on the base image where this image will be placed. If this option is set to:top,:middleor:bottomthen theyposition will be calculated relative to the base image. If:yis nil (the default) then the image will be placed according to the relative offset of the previously composed image using:dy.:dxdescribes the relative offset used to calculate thexvalue.:dxis an integer offset from the edge of the previously composed image. Which edge is determined by the:x_baselineoption. If:xis also specified then:xis first calculated, then:dxis added to it. In this case,:x_baselineis ignored.:dydescribes the relative offset used to calculate theyvalue.:dyis an integer offset from the edge of the previously composed image. Which edge is determined by the:y_baselineoption. If:yis also specified then:yis first calculated, then:dyis added to it. In this case,:x_baselineis ignored.:blend_modeis theImage.BlendMode.t/0used when composing this image over its base image. The default is:overwhich is appropriate for most use cases.:x_baselineestablishes the baseline on the previously composed image from which:dxis calculated. The default is:right.:y_baselineestablishes the baseline on the previously composed image from which:dyis calculated. The default is:bottom.
@type t() :: [composition_option()]
Image compoositions options