[−][src]Enum grr::Format
The Format
enum represents a sized internal format of texture
storage. The naming convention closely follows that of Vulkan, but
it has a close correspondence with OpenGL.
-
The '_UNORM' suffix denotes unsigned normalized formats. They are represented as unsigned integers internally, remapped to the [0.0, 1.0] floating point range in shaders. These are equivalent to the constants with no suffix in OpenGL.
-
The '_SNORM' suffix denotes signed normalized formats. They are represented as signed integers, remapped to the [-1.0, 1.0] floating point range in shaders. This suffix is the same as in OpenGL.
-
The '_SFLOAT' suffix denotes floating point formats, equivalent to the OpenGL 'F' suffix.
-
The '_SINT' suffix denotes signed integer formats, exposed to shaders unmodified as integers. This is equivalent to the OpenGL 'I' suffix.
-
The '_UINT' suffix denotes unsigned integer formats, exposed to shaders as unsigned integers. This is equivalent to the OpenGL 'UI' suffix.
-
The '_SRGB' suffix denotes sRGB formats, which are all unsigned normalized integers. Textures in this format are assumed to be in the sRGB color space. Shaders reading from this format will automatically convert the color components to a linear color space, so the shader will only see linear values. Because
GL_FRAMEBUFFER_SRGB
is enabled by default ingrr
, when outputting from a shader to a render target with an '_SRGB' format, OpenGL will convert the color components to an sRGB color space automatically. Alpha components, if they exist, are treated as linear throughout.
Each component is followed by the number of bits used to represent it.
Variants
sRGB8 color space with a linear alpha
Implementations
impl Format
[src]
pub fn num_components(self) -> u32
[src]
Return the number of components of the pixel format.
pub fn base_format(self) -> BaseFormat
[src]
Return the corresponding base format for this format.
Trait Implementations
impl Clone for Format
[src]
impl Copy for Format
[src]
impl Debug for Format
[src]
impl Eq for Format
[src]
impl PartialEq<Format> for Format
[src]
impl StructuralEq for Format
[src]
impl StructuralPartialEq for Format
[src]
Auto Trait Implementations
impl RefUnwindSafe for Format
impl Send for Format
impl Sync for Format
impl Unpin for Format
impl UnwindSafe for Format
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,