pub fn to_data_indices(&self, tile_size: Vec2<usize>, max: Vec2<usize>) -> Result<IntegerBounds> {
        let x = self.tile_index.x() * tile_size.width();
        let y = self.tile_index.y() * tile_size.height();

        if x >= max.x() || y >= max.y() {
            Err(Error::invalid("tile index"))
        }
        else {
            Ok(IntegerBounds {
                position: Vec2(usize_to_i32(x), usize_to_i32(y)),
                size: Vec2(
                    calculate_block_size(max.x(), tile_size.width(), x)?,
                    calculate_block_size(max.y(), tile_size.height(), y)?,
                ),
            })
        }
    }
/// The indices which can be used to index into the arrays of a data window.
/// These coordinates are only valid inside the corresponding one header.
/// Will start at 0 and always be positive.
The indices which can be used to index into the arrays of a data window.
These coordinates are only valid inside the corresponding one header.
Will start at 0 and always be positive.
The indices which can be used to index into the arrays of a data window . These coordinates are only valid inside the corresponding one header . Will start at 0 and always be positive .
pub fn to_data_indices(&self, tile_size: Vec2<usize>, max: Vec2<usize>) -> Result<IntegerBounds> {
        let x = self.tile_index.x() * tile_size.width();
        let y = self.tile_index.y() * tile_size.height();
        if x >= max.x() || y >= max.y() {
            Err(Error::invalid("tile index"))
        }
        else {
            Ok(IntegerBounds {
                position: Vec2(usize_to_i32(x), usize_to_i32(y)),
                size: Vec2(
                    calculate_block_size(max.x(), tile_size.width(), x)?,
                    calculate_block_size(max.y(), tile_size.height(), y)?,
                ),
            })
        }
    }
pub fn to_data_indices ( & self , tile_size : Vec2 < usize > , max : Vec2 < usize > ) -> Result < IntegerBounds > { let x = self . tile_index . x ( ) * tile_size . width ( ) ; let y = self . tile_index . y ( ) * tile_size . height ( ) ; if x >= max . x ( ) || y >= max . y ( ) { Err ( Error :: invalid ( " " ) ) } else { Ok ( IntegerBounds { position : Vec2 ( usize_to_i32 ( x ) , usize_to_i32 ( y ) ) , size : Vec2 ( calculate_block_size ( max . x ( ) , tile_size . width ( ) , x ) ? , calculate_block_size ( max . y ( ) , tile_size . height ( ) , y ) ? , ) , } ) } }
The indices which can be used to index into the arrays of a data window.
The indices which can be used to index into the arrays of a data window .
&self
tile_size
Vec2<usize>
max
Vec2<usize>
&self
tile_size
Vec2<usize>
max
Vec2<usize>