pub struct Parameter {Show 18 fields
pub width: u32,
pub height: u32,
pub blocks_x: u32,
pub blocks_y: u32,
pub channel_order: u32,
pub channel_bytes: u32,
pub image_channels: u32,
pub pixel_bytes: u32,
pub image_offset: u32,
pub image_pixel_bytes: u32,
pub image_row_bytes: u32,
pub alpha_pixel_bytes: u32,
pub alpha_row_bytes: u32,
pub block_pixels: u32,
pub block_width: u32,
pub block_height: u32,
pub block_shift_x: u32,
pub block_shift_y: u32,
}Expand description
The fields of the Parameter section, named after VOffscreen.
Fields§
§width: u32Width in pixels.
height: u32Height in pixels.
blocks_x: u32Blocks per row.
blocks_y: u32Block rows.
channel_order: u32BlockDataChannelOrder: 0x21 colour (BGRA), 0x11 gray, 0x01 alpha only.
channel_bytes: u32BlockDataChannelBytes (1).
image_channels: u32BlockDataChannelImageCount: image channels besides alpha (4, 1, 0).
pixel_bytes: u32BlockDataPixelBytes: bytes per pixel over all planes (5, 2, 1).
image_offset: u32BlockDataOffsetImageBlockBytes: where the image plane starts in a block.
image_pixel_bytes: u32BlockDataOffsetImagePixelBytes: bytes per pixel of the image plane.
image_row_bytes: u32BlockDataOffsetImageRowBytes: bytes per row of the image plane.
alpha_pixel_bytes: u32BlockDataOffsetAlphaPixelBytes.
alpha_row_bytes: u32BlockDataOffsetAlphaRowBytes: bytes per row of the alpha plane.
block_pixels: u32BlockDataOffsetImageBlock: pixels per block (65 536).
block_width: u32Block width in pixels (256).
block_height: u32Block height in pixels (256).
block_shift_x: u32log2 of the block width (8).
block_shift_y: u32log2 of the block height (8).
Implementations§
Source§impl Parameter
impl Parameter
Sourcepub fn new(kind: PixelKind, width: u32, height: u32) -> Self
pub fn new(kind: PixelKind, width: u32, height: u32) -> Self
The layout CSP uses for a new offscreen of the given kind.
Sourcepub fn block_count(&self) -> usize
pub fn block_count(&self) -> usize
Number of blocks in the grid.
Sourcepub fn block_bytes(&self) -> usize
pub fn block_bytes(&self) -> usize
Bytes of one decompressed block.
Sourcepub fn block_origin(&self, index: usize) -> (u32, u32)
pub fn block_origin(&self, index: usize) -> (u32, u32)
Top-left pixel of block index (blocks are numbered row by row).
Trait Implementations§
impl Copy for Parameter
impl Eq for Parameter
impl StructuralPartialEq for Parameter
Auto Trait Implementations§
impl Freeze for Parameter
impl RefUnwindSafe for Parameter
impl Send for Parameter
impl Sync for Parameter
impl Unpin for Parameter
impl UnsafeUnpin for Parameter
impl UnwindSafe for Parameter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.