#[repr(i32)]
pub enum TestPatternMode { Off, SolidColor, ColorBars, ColorBarsFadeToGray, Pn9, Custom1, }
Expand description

Control to select the test pattern mode. Currently identical to ANDROID_SENSOR_TEST_PATTERN_MODE.

Variants§

§

Off

No test pattern mode is used. The camera device returns frames from the image sensor.

§

SolidColor

Each pixel in [R, G_even, G_odd, B] is replaced by its respective color channel provided in test pattern data. \todo Add control for test pattern data.

§

ColorBars

All pixel data is replaced with an 8-bar color pattern. The vertical bars (left-to-right) are as follows; white, yellow, cyan, green, magenta, red, blue and black. Each bar should take up 1/8 of the sensor pixel array width. When this is not possible, the bar size should be rounded down to the nearest integer and the pattern can repeat on the right side. Each bar’s height must always take up the full sensor pixel array height.

§

ColorBarsFadeToGray

The test pattern is similar to TestPatternModeColorBars, except that each bar should start at its specified color at the top and fade to gray at the bottom. Furthermore each bar is further subdevided into a left and right half. The left half should have a smooth gradient, and the right half should have a quantized gradient. In particular, the right half’s should consist of blocks of the same color for 1/16th active sensor pixel array width. The least significant bits in the quantized gradient should be copied from the most significant bits of the smooth gradient. The height of each bar should always be a multiple of 128. When this is not the case, the pattern should repeat at the bottom of the image.

§

Pn9

All pixel data is replaced by a pseudo-random sequence generated from a PN9 512-bit sequence (typically implemented in hardware with a linear feedback shift register). The generator should be reset at the beginning of each frame, and thus each subsequent raw frame with this test pattern should be exactly the same as the last.

§

Custom1

The first custom test pattern. All custom patterns that are available only on this camera device are at least this numeric value. All of the custom test patterns will be static (that is the raw image must not vary from frame to frame).

Trait Implementations§

source§

impl Clone for TestPatternMode

source§

fn clone(&self) -> TestPatternMode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl ControlEntry for TestPatternMode

source§

const ID: u32 = 48u32

source§

impl Debug for TestPatternMode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<TestPatternMode> for ControlValue

source§

fn from(val: TestPatternMode) -> Self

Converts to this type from the input type.
source§

impl From<TestPatternMode> for i32

source§

fn from(enum_value: TestPatternMode) -> Self

Converts to this type from the input type.
source§

impl PartialEq<TestPatternMode> for TestPatternMode

source§

fn eq(&self, other: &TestPatternMode) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<ControlValue> for TestPatternMode

§

type Error = ControlValueError

The type returned in the event of a conversion error.
source§

fn try_from(value: ControlValue) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<i32> for TestPatternMode

§

type Error = TryFromPrimitiveError<TestPatternMode>

The type returned in the event of a conversion error.
source§

fn try_from(number: i32) -> Result<Self, TryFromPrimitiveError<Self>>

Performs the conversion.
source§

impl TryFromPrimitive for TestPatternMode

§

type Primitive = i32

source§

const NAME: &'static str = _

source§

fn try_from_primitive( number: Self::Primitive ) -> Result<Self, TryFromPrimitiveError<Self>>

source§

impl Control for TestPatternMode

source§

impl Copy for TestPatternMode

source§

impl Eq for TestPatternMode

source§

impl StructuralEq for TestPatternMode

source§

impl StructuralPartialEq for TestPatternMode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> DynControlEntry for Twhere T: ControlEntry,

source§

fn id(&self) -> u32

source§

fn value(&self) -> ControlValue

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.