# GridThumbnail Class

    public class GridThumbnail

GridThumbnail

Used to define a request to download images and slice them into multiple thumbnails in a grid pattern. Each image will be sliced into smaller segments based on the `gridWidth` and `gridHeight`. E.g. if these are both set to `2`, then the image will be divided into a 2 x 2 grid producing 4 equal sized thumbnails per image. The grid cells are ordered from left to right, then top to bottom.

Single or multiple images may be downloaded using this object. If `maxIndex` is greater than 1 and the `pathTemplate` contains the token index then multiple image urls can be specified. The final image urls which will be downloaded are specified by the baseUrl + the result of the pathTemplate substitution. The index token in pathTemplate will be substituted with the index 1 up to and including maxIndex. E.g. if `pathTemplate` where `image_$index$.jpg` and maxIndex were 3, then `image_1.jpg`, `image_2.jpg`, `image_3.jpg` would be generated from the substitution.

Each thumbnail will be displayed for `durationMs` with no gabs in between. Therefore thumbnails will cover a total timerange of `durationMs` multiplied by the total number of thumbnails generated.

### Public

- `baseUrl`

  Grid image Url (excluding path).

  #### Declaration

  Swift

      public var baseUrl: URL

- `pathTemplate`

  Url path template (may include index variables).

  #### Declaration

  Swift

      public var pathTemplate: String

- `gridHeight`

  Number of columns.

  #### Declaration

  Swift

      public var gridHeight: Int

- `gridWidth`

  Number of rows.

  #### Declaration

  Swift

      public var gridWidth: Int

- `durationMs`

  Grid elements time difference / Thumbnail duration in milliseconds.

  #### Declaration

  Swift

      public var durationMs: Int64

- `maxIndex`

  Number of grid images to download.

  #### Declaration

  Swift

      public var maxIndex: Int