One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

PhotogrammetrySession

class · iOS 17.0+ · SDK 27.1

class PhotogrammetrySession

Manages the creation of a 3D model from a set of images. For more information on using ``PhotogrammetrySession``, see <doc://com.apple.documentation/documentation/realitykit/creating-3d-objects-from-photographs>.

Members (11)

get · iOS 17.0+

isSupported

TypeScript
static get isSupported(): boolean
Swift declaration
static var isSupported: Bool { get }

Returns `true` if the current hardware supports Object Capture.

get · iOS 17.0+

isProcessing

TypeScript
get isProcessing(): boolean
Swift declaration
var isProcessing: Bool { get }

The session is actively processing requests.

get · iOS 17.0+

configuration

TypeScript
get configuration(): PhotogrammetrySession_Configuration
Swift declaration
var configuration: PhotogrammetrySession.Configuration { get }

Readonly property containing the session configuration set in the construction.

get · iOS 17.0+

activeRequests

TypeScript
get activeRequests(): Array<PhotogrammetrySession_Request>
Swift declaration
var activeRequests: [PhotogrammetrySession.Request] { get }

The session’s active request objects. This property provides read-only access to the requests that the session actively processes.

get · iOS 17.0+

id

TypeScript
get id(): string
Swift declaration
var id: UUID { get }

The stable identity of the entity associated with this instance.

init · iOS 17.0+

init

TypeScript
static initInputConfiguration(input: string, configuration?: PhotogrammetrySession_Configuration): PhotogrammetrySession
Swift declaration
convenience init(input: URL, configuration: PhotogrammetrySession.Configuration = Configuration()) throws

Creates a session from a specified directory of images. Creates a new session instance using all images in the specified <doc://com.apple.documentation/documentation/foundation/url> input directory <doc://com.apple.documentation/documentation/foundation/url> as samples for reconstruction. - Parameter input: the directory <doc://com.apple.documentation/documentation/foundation/url> containing a folder of images to use as reconstruction inputs. - Parameter configuration: the configuration to use for this session. - Throws: if `input` is not a file <doc://com.apple.documentation/documentation/foundation/url>.

init · iOS 17.0+

init

TypeScript
static initInputConfiguration8932(input: Array<PhotogrammetrySample>, configuration?: PhotogrammetrySession_Configuration): PhotogrammetrySession
Swift declaration
convenience init<S>(input: S, configuration: PhotogrammetrySession.Configuration = Configuration()) throws where S : Sequence, S.Element == PhotogrammetrySample

Creates a session from a sequence of samples. Creates a new session instance from a custom sequence of ``PhotogrammetrySample`` objects by iterating over the provided <doc://com.apple.documentation/documentation/swift/sequence> object. The constructor will only use `makeIterator()` on `input` and will then iterate through the sequence only once. A provided iterator should be lazy, or a lazy <doc://com.apple.documentation/documentation/swift/sequence> and map used. - Parameter input: the input `Sequence` that will be iterated once to yield all input data. - Parameter configuration: the session-wide configuration to use for this session. - Note: To minimize memory usage, use lazy sequences that only create a ``PhotogrammetrySample`` as it iterates by making calls to `next()` on its associated <doc://com.apple.documentation/documentation/swift/iteratorprotocol>.

method · iOS 17.0+

cancel

TypeScript
cancel(): void
Swift declaration
func cancel()

Requests cancellation of any running requests. When cancellation has completed, a `.processingCancelled` message will be output and `isProcessing` will be `false`. Calling this method has no effect if `!isProcessing`. - Note: This call is asynchronous and it may take some time before the pipeline fully stops, resources are reclaimed, and the error is actually produced, so callers should monitor `output` for the message before making a new session.

get · iOS 17.0+

limits

TypeScript
static get limits(): PhotogrammetrySession_Limits
Swift declaration
static let limits: PhotogrammetrySession.Limits

Observer for the device-specific constant hardware limits for reconstruction.

get · iOS 17.0+

outputs

TypeScript
get outputs(): PhotogrammetrySession_Outputs
Swift declaration
var outputs: PhotogrammetrySession.Outputs { get }

Returns the outputs message stream which can be asynchronously iterated on.

method · iOS 17.0+

process

TypeScript
process(requests: Array<PhotogrammetrySession_Request>): void
Swift declaration
func process(requests: [PhotogrammetrySession.Request]) throws

Starts processing of the provided processing `requests`. Messages begin to be produced to the `output` publisher. On the first `process()`call the data in the input source will be ingested entirely and `inputComplete` produced on the `output` stream before any request processing progress will begin. Before `inputComplete`, warnings about samples will be published, if any. - Throws: if `isProcessing` another batch still, the session is invalid (an Error was produced on `output` or if one of the requests is invalid.

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →