Skip to main content
API Reference SwiftyNsdk

BundlePlaybackDatasetLoader

↳ inherits from PlaybackDatasetLoader
A loader that retrieves playback dataset data from the app bundle....

Declaration

class BundlePlaybackDatasetLoader

Summary

A loader that retrieves playback dataset data from the app bundle. This is the default implementation for loading datasets from Bundle.main. Frame images and depth data are loaded on-demand when requested.


Constructors

init(directory: String, bundle: Bundle = .main)

Summary

Initializes a bundle loader with the specified bundle.
- Parameters:
- directory: The subdirectory within the bundle containing the dataset
- bundle: The bundle to load resources from (defaults to Bundle.main)


Methods

NameTypeSummary
override infoString
Returns details about the loader configuration.
- Returns: A string describing the loader configuration
override 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.
override 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.
override 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.
override 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