Snapshot

@JsonClass(generateAdapter = true)
data class Snapshot(@Json(name = "identifier") val identifier: String, @Json(name = "width") val width: Int, @Json(name = "height") val height: Int, @Json(name = "orientation") val orientation: Orientation, @Json(name = "scale") val scale: Double, @Json(name = "density") val density: Float, @Json(name = "textScale") val textScale: Double, @Json(name = "screenshot") val screenshot: Screenshot? = null, @Json(name = "windows") val windows: List<SemanticWindow>, @Json(name = "elements") val elements: List<SemanticElement>) : Codable, Scalable<Snapshot>

Constructors

Link copied to clipboard
constructor(@Json(name = "identifier") identifier: String, @Json(name = "width") width: Int, @Json(name = "height") height: Int, @Json(name = "orientation") orientation: Orientation, @Json(name = "scale") scale: Double, @Json(name = "density") density: Float, @Json(name = "textScale") textScale: Double, @Json(name = "screenshot") screenshot: Screenshot? = null, @Json(name = "windows") windows: List<SemanticWindow>, @Json(name = "elements") elements: List<SemanticElement>)

Properties

Link copied to clipboard

Returns all elements, including children.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val height: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val screenshot: Screenshot? = null
Link copied to clipboard
Link copied to clipboard
val width: Int
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
open override fun height(): Int

Returns the height to be used when scaling

Link copied to clipboard
Link copied to clipboard
open fun scale(maxWidth: Int, maxHeight: Int): Snapshot

Scale T to fit within the given maxWidth and maxHeight.

open override fun scale(factor: Double): Snapshot

Scale Snapshot using the given factor. Affects: width, height, scale, screenshot and elements.

Link copied to clipboard
open fun toJSON(): String

Helper method to convert an object to JSON

Link copied to clipboard
open override fun width(): Int

Returns the width to be used when scaling