Skip to main content

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, or nil if loading fails

Parameters​

NameDescription
locationThe 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, or nil if loading fails

Parameters​

NameDescription
imageNameThe filename of the image (e.g., “frame_00000000.jpg”)
locationThe 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