Skip to main content
API Reference SwiftyNsdk

RawImage

A raw image containing pixel data for NSDK operations....

Declaration

struct RawImage

Summary

A raw image containing pixel data for NSDK operations. RawImage provides access to image data in various formats (RGB, grayscale, depth, etc.) used by NSDK features like depth processing, semantic segmentation, and image analysis.

Overview

Raw images are used throughout NSDK for:

  • Camera frame processing
  • Depth map representation
  • Semantic segmentation results
  • Image format conversions
  • Computer vision operations

Example Usage

let (status, depthResult) = depthSession.getDepth()
if status.isOk() {
let image = depthResult.image
print("Image size: \(image.width) x \(image.height)")
print("Image type: \(image.type)")

// Access pixel data
let pixelData = image.data
// Process pixel data based on image type
}

Memory Management

This object's pointers are only valid when the NSDK objects that holds it are still in scope.


Constructors

init(ptr: UnsafeMutableRawPointer, width: UInt, height: UInt, type: ImageType)

Properties

NameTypeSummary
let dataUnsafeMutableRawPointer
Pointer to the raw pixel data.
This provides direct access to the image's pixel data. The format and
interpretation of the data depends on the type property.
let heightUInt
Height of the image in pixels.
This represents the number of rows in the image.
let typeImageType
Format and type of the image data.
This indicates how the pixel data should be interpreted, including
the number of channels, data type, and color space.
let widthUInt
Width of the image in pixels.
This represents the number of pixels in each row of the image.