pub struct NativeWindow { /* private fields */ }
Expand description

It is the C counterpart of the android.view.Surface object in Java, and can be converted both ways. Depending on the consumer, images submitted to NativeWindow can be shown on the display or sent to other consumers, such as video encoders.

Implementations

Assumes ownership of ptr

Safety

ptr must be a valid pointer to an Android ffi::ANativeWindow.

Acquires ownership of ptr

Safety

ptr must be a valid pointer to an Android ffi::ANativeWindow.

Return the current pixel format (HardwareBufferFormat) of the window surface.

Change the format and size of the window buffers.

The width and height control the number of pixels in the buffers, not the dimensions of the window on screen. If these are different than the window’s physical size, then its buffer will be scaled to match that size when compositing it to the screen. The width and height must be either both zero or both non-zero.

For all of these parameters, if 0 or None is supplied then the window’s base value will come back in force.

Return the NativeWindow associated with a JNI android.view.Surface pointer.

Safety

By calling this function, you assert that env is a valid pointer to a JNIEnv and surface is a valid pointer to an android.view.Surface.

Available on crate feature api-level-26 only.

Return a JNI android.view.Surface pointer derived from this NativeWindow.

Safety

By calling this function, you assert that env is a valid pointer to a JNIEnv.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.