Size

data class Size(width: Dimension, height: Dimension)

Represents the target size of an image request.

Each Size is composed of two Dimensions, width and height. Each dimension determines by how much the source image should be scaled. A Dimension can either be a fixed pixel value or Dimension.Undefined. Examples:

  • Given Size(400, 600), the image should be loaded to fit/fill a width of 400 pixels and a height of 600 pixels.

  • Given Size(400, Dimension.Undefined), the image should be loaded to fit/fill a width of 400 pixels.

  • Given Size(Dimension.Undefined, Dimension.Undefined), the image should not be scaled to fit/fill either width or height. i.e. it will be loaded at its original width/height.

See also

Constructors

Size
Link copied to clipboard
fun Size(width: Dimension, height: Dimension)

Types

Companion
Link copied to clipboard
object Companion

Properties

height
Link copied to clipboard
val height: Dimension
width
Link copied to clipboard
val width: Dimension

Extensions

isOriginal
Link copied to clipboard
val Size.isOriginal: Boolean
Return true if this size is equal to Size.ORIGINAL.