pub struct CogMetadata {Show 19 fields
pub width: usize,
pub height: usize,
pub tile_width: usize,
pub tile_height: usize,
pub bands: usize,
pub data_type: CogDataType,
pub compression: Compression,
pub predictor: u16,
pub little_endian: bool,
pub tile_offsets: Vec<u64>,
pub tile_byte_counts: Vec<u64>,
pub tiles_across: usize,
pub tiles_down: usize,
pub is_tiled: bool,
pub geo_transform: GeoTransform,
pub crs_code: Option<i32>,
pub stats_min: Option<f32>,
pub stats_max: Option<f32>,
pub nodata: Option<f64>,
}Expand description
COG metadata - read from IFD without loading tile data
Fields§
§width: usizeImage dimensions
height: usize§tile_width: usizeTile dimensions (COG requirement)
tile_height: usize§bands: usizeNumber of bands/samples
data_type: CogDataTypeData type
compression: CompressionCompression method
predictor: u16Predictor (1=none, 2=horizontal differencing, 3=floating point)
little_endian: boolByte order
tile_offsets: Vec<u64>Tile byte offsets in the file
tile_byte_counts: Vec<u64>Tile byte counts (compressed sizes)
tiles_across: usizeNumber of tiles across
tiles_down: usizeNumber of tiles down
is_tiled: boolWhether this is a tiled TIFF (true) or stripped TIFF (false) Tiled TIFFs are COG-optimized, stripped TIFFs are not
geo_transform: GeoTransformGeographic transform
crs_code: Option<i32>Detected CRS (EPSG code)
stats_min: Option<f32>Min/max values from GDAL statistics (if present)
stats_max: Option<f32>§nodata: Option<f64>NoData value
Implementations§
Source§impl CogMetadata
impl CogMetadata
Sourcepub fn tile_index_for_pixel(&self, px: usize, py: usize) -> Option<usize>
pub fn tile_index_for_pixel(&self, px: usize, py: usize) -> Option<usize>
Get tile index for a pixel coordinate
Sourcepub fn pixel_range_in_tile(
&self,
tile_index: usize,
) -> (usize, usize, usize, usize)
pub fn pixel_range_in_tile( &self, tile_index: usize, ) -> (usize, usize, usize, usize)
Get pixel range within a tile
Sourcepub fn tile_pixel_count(&self, tile_index: usize) -> usize
pub fn tile_pixel_count(&self, tile_index: usize) -> usize
Get number of valid pixels in a tile (handles edge tiles)
Trait Implementations§
Source§impl Clone for CogMetadata
impl Clone for CogMetadata
Source§fn clone(&self) -> CogMetadata
fn clone(&self) -> CogMetadata
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CogMetadata
impl RefUnwindSafe for CogMetadata
impl Send for CogMetadata
impl Sync for CogMetadata
impl Unpin for CogMetadata
impl UnwindSafe for CogMetadata
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more