Skip to main content

RasterDataType

Enum RasterDataType 

Source
#[repr(u8)]
pub enum RasterDataType { UInt8 = 1, Int8 = 2, UInt16 = 3, Int16 = 4, UInt32 = 5, Int32 = 6, UInt64 = 7, Int64 = 8, Float32 = 9, Float64 = 10, CFloat32 = 11, CFloat64 = 12, }
Expand description

Raster data types representing pixel values

Variants§

§

UInt8 = 1

Unsigned 8-bit integer (0-255)

§

Int8 = 2

Signed 8-bit integer (-128 to 127)

§

UInt16 = 3

Unsigned 16-bit integer (0-65535)

§

Int16 = 4

Signed 16-bit integer

§

UInt32 = 5

Unsigned 32-bit integer

§

Int32 = 6

Signed 32-bit integer

§

UInt64 = 7

Unsigned 64-bit integer

§

Int64 = 8

Signed 64-bit integer

§

Float32 = 9

32-bit floating point

§

Float64 = 10

64-bit floating point

§

CFloat32 = 11

Complex 32-bit floating point (real + imaginary)

§

CFloat64 = 12

Complex 64-bit floating point (real + imaginary)

Implementations§

Source§

impl RasterDataType

Source

pub const fn size_bytes(self) -> usize

Returns the size in bytes of this data type

Source

pub const fn size_bits(self) -> usize

Returns the size in bits of this data type

Source

pub const fn is_signed(self) -> bool

Returns true if this is a signed type

Source

pub const fn is_floating_point(self) -> bool

Returns true if this is a floating-point type

Source

pub const fn is_complex(self) -> bool

Returns true if this is a complex type

Source

pub const fn is_integer(self) -> bool

Returns true if this is an integer type

Source

pub const fn min_value(self) -> f64

Returns the minimum value for this data type as f64

Source

pub const fn max_value(self) -> f64

Returns the maximum value for this data type as f64

Source

pub const fn from_tiff_sample_format( sample_format: u16, bits_per_sample: u16, ) -> Option<RasterDataType>

Converts from TIFF sample format and bits per sample

§Arguments
  • sample_format - TIFF sample format tag value (1=unsigned, 2=signed, 3=float)
  • bits_per_sample - Bits per sample
§Returns

The corresponding RasterDataType, or None if the combination is not supported

Source

pub const fn to_tiff_sample_format(self) -> (u16, u16)

Converts to TIFF sample format

§Returns

A tuple of (sample_format, bits_per_sample)

Source

pub const fn name(self) -> &'static str

Returns the name of this data type

Trait Implementations§

Source§

impl Clone for RasterDataType

Source§

fn clone(&self) -> RasterDataType

Returns a duplicate 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 Debug for RasterDataType

Source§

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

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

impl Default for RasterDataType

Source§

fn default() -> RasterDataType

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for RasterDataType

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<RasterDataType, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for RasterDataType

Source§

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

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

impl Hash for RasterDataType

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

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

impl PartialEq for RasterDataType

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for RasterDataType

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for RasterDataType

Source§

impl Eq for RasterDataType

Source§

impl StructuralPartialEq for RasterDataType

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where 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 T
where T: Clone,

Source§

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,