PROTOCOL
PlaybackDatasetSource
public protocol PlaybackDatasetSource
Protocol for loading playback dataset data from various sources.
This protocol abstracts base retrieval, allowing for different implementations such as bundle loading, file system loading, remote loading, or mock data for testing.
Methods
loadCaptureJSON()
func loadCaptureJSON() -> Data?
Loads the capture JSON data from the data source.
- Parameter location: The location identifier/path for the dataset (e.g., a directory path, URL path, or dataset identifier)
- Returns: The JSON data as
Data, ornilif loading fails
Parameters
| Name | Description |
|---|---|
| location | The location identifier/path for the dataset (e.g., a directory path, URL path, or dataset identifier) |
loadImage(imageName:)
func loadImage(imageName: String) -> CGImage?
Loads an image from the data source.
- Parameters:
- imageName: The filename of the image (e.g., "frame_00000000.jpg")
- location: The location identifier/path for the dataset (e.g., a directory path, URL path, or dataset identifier)
- Returns: The image as a
CGImage, ornilif loading fails
Parameters
| Name | Description |
|---|---|
| imageName | The filename of the image (e.g., “frame_00000000.jpg”) |
| location | The location identifier/path for the dataset (e.g., a directory path, URL path, or dataset identifier) |
info()
func info() -> String
Returns details about the loader configuration.
- Returns: A string describing the loader configuration