-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
df85f88
commit add67bd
Showing
12 changed files
with
50 additions
and
47 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
mod debug; | ||
mod feature; | ||
mod geometry_type; | ||
mod layer; | ||
mod property_manager; | ||
mod tile; | ||
mod value; | ||
|
||
pub use debug::create_debug_vector_tile; | ||
pub use layer::VectorTileLayer; | ||
pub use tile::VectorTile; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
versatiles_pipeline/src/operations/read/from_debug/image.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
use ab_glyph::{FontArc, PxScale}; | ||
use imageproc::{ | ||
drawing::draw_text_mut, | ||
image::{DynamicImage, Rgb, RgbImage}, | ||
}; | ||
use versatiles_core::types::TileCoord3; | ||
|
||
static mut FONT: Option<FontArc> = None; | ||
|
||
pub fn create_debug_image(coord: &TileCoord3) -> DynamicImage { | ||
let font = unsafe { | ||
if FONT.is_none() { | ||
FONT.insert(FontArc::try_from_slice(include_bytes!("./trim.ttf")).unwrap()) | ||
} else { | ||
FONT.as_ref().unwrap() | ||
} | ||
}; | ||
|
||
let br = ((coord.x + coord.y) % 2) as u8 * 16 + 224; | ||
let mut image1 = RgbImage::from_pixel(512, 512, Rgb::from([br, br, br])); | ||
|
||
let mut draw = |y: i32, c: Rgb<u8>, text: String| { | ||
draw_text_mut(&mut image1, c, 220, y, PxScale::from(40f32), font, &text) | ||
}; | ||
|
||
draw(195, Rgb([127, 30, 16]), format!("z: {}", coord.z)); | ||
draw(225, Rgb([0, 92, 45]), format!("x: {}", coord.x)); | ||
draw(255, Rgb([30, 23, 98]), format!("y: {}", coord.y)); | ||
|
||
DynamicImage::ImageRgb8(image1) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters