Skip to main content
API Reference SwiftyNsdk

PlaybackDatasetLoader

Base class for loading playback dataset data from various sources....

Declaration

class PlaybackDatasetLoader

Summary

Base class for loading playback dataset data from various sources. This class provides a base implementation that must be subclassed. Subclasses must override loadCaptureJSON(), loadImage(imageName:), loadDepthData(depthFileName:), and loadDepthConfidence(confidenceFileName:) to provide concrete implementations. The loader uses on-demand loading - only the capture JSON is loaded upfront, and frame images/depth data are loaded when requested by PlaybackDataset.

  • Note: This class acts as an abstract base class. Do not instantiate directly.

Constructors

init()

Methods

NameTypeSummary
infoString
Returns details about the loader configuration.
- Returns: A string describing the loader configuration
loadCaptureJSONData?
Loads the capture JSON data from the data source.
This method must be overridden by subclasses. The base implementation will crash if called.
- Returns: The JSON data as Data, or nil if loading fails
- Important: Subclasses must override this method. Do not call the base implementation.
loadDatasetPlaybackDataset?
Loads a dataset from the data source.
This method only loads the capture JSON metadata upfront. Frame images and depth data
are loaded on-demand when requested, reducing memory pressure for large datasets.
- Returns: A PlaybackDataset configured for on-demand loading, or nil if loading fails
loadDepthConfidenceData?
Loads depth confidence data from the data source.
This method must be overridden by subclasses. The base implementation will crash if called.
Called on-demand when confidence data is requested.
- Parameter confidenceFileName: The filename of the confidence data file (e.g., "confidence_00000000.bin")
- Returns: The confidence data as Data, or nil if loading fails or confidence data is not available
- Important: Subclasses must override this method. Do not call the base implementation.
loadDepthDataData?
Loads depth data from the data source.
This method must be overridden by subclasses. The base implementation will crash if called.
Called on-demand when depth data is requested.
- Parameter depthFileName: The filename of the depth data file (e.g., "depth_00000000.bin")
- Returns: The depth data as Data, or nil if loading fails or depth data is not available
- Important: Subclasses must override this method. Do not call the base implementation.
loadImageCGImage?
Loads an image from the data source.
This method must be overridden by subclasses. The base implementation will crash if called.
Called on-demand when a frame image is requested.
- Parameter imageName: The filename of the image (e.g., "frame_00000000.jpg")
- Returns: The image as a CGImage, or nil if loading fails
- Important: Subclasses must override this method. Do not call the base implementation.

Relationships

conforms to: PlaybackDatasetSource
derived: BundlePlaybackDatasetLoader