Module native_image

Module native_image 

Source
Available on crate feature native_image only.
Expand description

Bindings to native_image

The native image module is used for associating a surface with an OpenGL external texture. It functions as the consumer of a graphics queue. You can use the APIs of this module to obtain and use a buffer, and output the buffer content to an OpenGL external texture.

The following scenario is common for native image development:

Use the native image APIs to create an OH_NativeImage instance as the consumer and obtain the corresponding OHNativeWindow instance (functioning as the producer). Use the native window APIs to fill in and flush the buffer, and then use the native image APIs to update the buffer content to an OpenGL ES texture.

Source: Official Native Image documentation

Structs§

OH_OnFrameAvailableListenerapi-11
A listener for native image, use OH_NativeImage_SetOnFrameAvailableListener to register

Functions§

OH_ConsumerSurface_Createapi-12
Create a OH_NativeImage as a consumerSurface.
OH_ConsumerSurface_SetDefaultSizeapi-13
Set the default size of the OH_NativeImage.
OH_ConsumerSurface_SetDefaultUsageapi-13
Set the default usage of the OH_NativeImage.
OH_NativeImage_AcquireNativeWindow
Acquire the OHNativeWindow for the OH_NativeImage.
OH_NativeImage_AcquireNativeWindowBufferapi-12
Acquire an OHNativeWindowBuffer through an OH_NativeImage instance for content consumer.
OH_NativeImage_AttachContext
Attach the OH_NativeImage to Opengl ES context, and the Opengl ES texture is bound to the
OH_NativeImage_Create
Create a OH_NativeImage related to an Opengl ES texture and target.
OH_NativeImage_Destroy
Destroy the OH_NativeImage created by OH_NativeImage_Create, and the pointer to OH_NativeImage will be null after this operation.
OH_NativeImage_DetachContext
Detach the OH_NativeImage from the Opengl ES context.
OH_NativeImage_GetBufferMatrixapi-15
Obtains the transform matrix that combines with crop rect.
OH_NativeImage_GetSurfaceIdapi-11
Return the native image’s surface id.
OH_NativeImage_GetTimestamp
Get the timestamp of the texture image set by the most recent call to OH_NativeImage_UpdateSurfaceImage.
OH_NativeImage_GetTransformMatrixDeprecated
Return the transform matrix of the texture image set by the most recent call to
OH_NativeImage_GetTransformMatrixV2api-12
Obtains the transform matrix of the texture image by producer transform type.
OH_NativeImage_ReleaseNativeWindowBufferapi-12
Release the OHNativeWindowBuffer to the buffer queue through an OH_NativeImage instance for reuse.
OH_NativeImage_SetDropBufferModeapi-17
Set the rendering in drop buffer mode of the OH_NativeImage.
OH_NativeImage_SetOnFrameAvailableListenerapi-11
Set the frame available callback.
OH_NativeImage_UnsetOnFrameAvailableListenerapi-11
Unset the frame available callback.
OH_NativeImage_UpdateSurfaceImage
Update the related Opengl ES texture with the OH_NativeImage acquired buffer.

Type Aliases§

OH_OnFrameAvailableapi-11
The callback function of frame available.