Skip to content

class ImageSize

A container for image size data.

Parameters:

Name Type Description Default
width Int the width of the image -
height Int the height of the image -
channel Int the channel of the image -
ignoreInvalidChannel Boolean - false
Stub code in ImageSize.sdsstub
class ImageSize(
    width: Int,
    height: Int,
    channel: Int,
    @PythonName("_ignore_invalid_channel") ignoreInvalidChannel: Boolean = false
) {
    /**
     * Get the width of this `ImageSize` in pixels.
     */
    attr width: Int
    /**
     * Get the height of this `ImageSize` in pixels.
     */
    attr height: Int
    /**
     * Get the channel of this `ImageSize` in pixels.
     */
    attr channel: Int

    /**
     * Create a `ImageSize` of a given image.
     *
     * @param image the given image for the `ImageSize`
     *
     * @result imageSize the calculated `ImageSize`
     */
    @Pure
    @PythonName("from_image")
    static fun fromImage(
        image: Image
    ) -> imageSize: ImageSize
}

attr channel

Get the channel of this ImageSize in pixels.

Type: Int

attr height

Get the height of this ImageSize in pixels.

Type: Int

attr width

Get the width of this ImageSize in pixels.

Type: Int

static fun fromImage

Create a ImageSize of a given image.

Parameters:

Name Type Description Default
image Image the given image for the ImageSize -

Results:

Name Type Description
imageSize ImageSize the calculated ImageSize
Stub code in ImageSize.sdsstub
@Pure
@PythonName("from_image")
static fun fromImage(
    image: Image
) -> imageSize: ImageSize