ArImage
Provides access to CPU camera images.
Summary
Enumerations
ArImageFormat
{
AR_IMAGE_FORMAT_INVALID
= 0,
AR_IMAGE_FORMAT_YUV_420_888
= 0x23,
AR_IMAGE_FORMAT_DEPTH16
= 0x44363159,
AR_IMAGE_FORMAT_D_16
= 0x00000030,
AR_IMAGE_FORMAT_Y8
= 0x20203859,
AR_IMAGE_FORMAT_RGBA_FP16
= 0x16
}
Functions
ArImage_getFormat
(const ArSession
*session, const ArImage
*image, ArImageFormat
*out_format)
void
ArImage_getHeight
(const ArSession
*session, const ArImage
*image, int32_t *out_height)
void
ArImage_getNumberOfPlanes
(const ArSession
*session, const ArImage
*image, int32_t *out_num_planes)
void
ArImage_getPlaneData
(const ArSession
*session, const ArImage
*image, int32_t plane_index, const uint8_t **out_data, int32_t *out_data_length)
void
ArImage_getPlanePixelStride
(const ArSession
*session, const ArImage
*image, int32_t plane_index, int32_t *out_pixel_stride)
void
ArImage_getPlaneRowStride
(const ArSession
*session, const ArImage
*image, int32_t plane_index, int32_t *out_row_stride)
void
ArImage_getTimestamp
(const ArSession
*session, const ArImage
*image, int64_t *out_timestamp_ns)
void
ArImage_getWidth
(const ArSession
*session, const ArImage
*image, int32_t *out_width)
void
ArImage_release
( ArImage
*image)
void
Enumerations
ArImageFormat
ArImageFormat
Image formats produced by ARCore.
Produced by ArFrame_acquireDepthImage
and ArFrame_acquireRawDepthImage
.
Integer value equal to DEPTH16 .
Produced by ArFrame_acquireDepthImage16Bits
and ArFrame_acquireRawDepthImage16Bits
.
Depth range values in units of millimeters. Integer value equal to D_16 .
Invalid image format.
Produced by ARCore when an invalid session/image is given to ArImage_getFormat
.
Produced by ArLightEstimate_acquireEnvironmentalHdrCubemap
.
Integer value equal to Android NDK AIMAGE_FORMAT_RGBA_FP16
.
Produced by ArFrame_acquireRawDepthConfidenceImage
.
Integer value equal to Y8
.
Produced by ArFrame_acquireCameraImage
.
Integer value equal to Android NDK AIMAGE_FORMAT_YUV_420_888
and
YUV_420_888
.
Typedefs
ArImage
struct ArImage_ ArImage
Accessing CPU image from the camera ( reference type, large data ).
- Acquire with:
ArFrame_acquireCameraImage
- Release with:
ArImage_release
.
ArImageCubemap
ArImage * ArImageCubemap[6]
Convenient definition for cubemap image storage where it is a fixed size array of 6 ArImage
.
Functions
ArImage_getFormat
void ArImage_getFormat ( const ArSession * session , const ArImage * image , ArImageFormat * out_format )
Gets the image format of the provided ArImage
.
session
|
The ARCore session.
|
image
|
|
out_format
|
ArImage_getHeight
void ArImage_getHeight ( const ArSession * session , const ArImage * image , int32_t * out_height )
ArImage_getNumberOfPlanes
void ArImage_getNumberOfPlanes ( const ArSession * session , const ArImage * image , int32_t * out_num_planes )
Gets the number of planes in the provided ArImage
.
The number of planes and format of data in each plane is format dependent. Use ArImage_getFormat
to determine the format.
session
|
The ARCore session.
|
image
|
|
out_num_planes
|
The number of planes in the image.
|
ArImage_getPlaneData
void ArImage_getPlaneData ( const ArSession * session , const ArImage * image , int32_t plane_index , const uint8_t ** out_data , int32_t * out_data_length )
Gets the data pointer of the provided image for direct application access.
Note that once the ArImage
data is released with ArImage_release
, the data pointer from the corresponding ArImage_getPlaneData
call becomes invalid. Do NOT use it after the ArImage
is released.
session
|
The ARCore session.
|
image
|
|
plane_index
|
The index of the plane, between 0 and n-1, where n is number of planes for this image.
|
out_data
|
The data pointer to the image.
|
out_data_length
|
The length of data in bytes.
|
ArImage_getPlanePixelStride
void ArImage_getPlanePixelStride ( const ArSession * session , const ArImage * image , int32_t plane_index , int32_t * out_pixel_stride )
Gets the byte distance between the start of two consecutive pixels in the image.
The pixel stride is always greater than 0.
session
|
The ARCore session.
|
image
|
|
plane_index
|
The index of the plane, between 0 and n-1, where n is number of planes for this image.
|
out_pixel_stride
|
The plane stride of the image in bytes.
|
ArImage_getPlaneRowStride
void ArImage_getPlaneRowStride ( const ArSession * session , const ArImage * image , int32_t plane_index , int32_t * out_row_stride )
Gets the number of bytes between the start of two consecutive rows of pixels in the image.
The row stride is always greater than 0.
session
|
The ARCore session.
|
image
|
|
plane_index
|
The index of the plane, between 0 and n-1, where n is number of planes for this image.
|
out_row_stride
|
The row stride of the image in bytes.
|
ArImage_getTimestamp
void ArImage_getTimestamp ( const ArSession * session , const ArImage * image , int64_t * out_timestamp_ns )
Gets the source-specific timestamp of the provided ArImage
in nanoseconds.
The timestamp is normally monotonically increasing. The timestamps for the images from different sources may have different timebases and should not be compared with each other. The specific meaning and timebase of the returned timestamp depends on the source providing images.
session
|
The ARCore session.
|
image
|
|
out_timestamp_ns
|
The timestamp of the image in nanoseconds.
|
ArImage_getWidth
void ArImage_getWidth ( const ArSession * session , const ArImage * image , int32_t * out_width )
ArImage_release
void ArImage_release( ArImage *image )
Releases an instance of ArImage
returned by ArFrame_acquireCameraImage
.