fix
This commit is contained in:
parent
181db4e881
commit
4cc5663070
1 changed files with 7 additions and 7 deletions
|
@ -142,12 +142,12 @@ pub fn merge(base: Pixmap, data: Pixmap, settings: &TileRequestOptions) -> Pixma
|
||||||
|
|
||||||
let ur = colorf64(upper.red);
|
let ur = colorf64(upper.red);
|
||||||
let ug = colorf64(upper.green);
|
let ug = colorf64(upper.green);
|
||||||
let ub = colorf64(lower.blue);
|
let ub = colorf64(upper.blue);
|
||||||
|
|
||||||
new.set(x, y, Color {
|
new.set(x, y, Color {
|
||||||
red: coloru8(lr + (lr - ur * a).abs()),
|
red: coloru8(lr - (lr - ur) * a),
|
||||||
green: coloru8(lg + (lg - ug * a).abs()),
|
green: coloru8(lg - (lg - ug) * a),
|
||||||
blue: coloru8(lb + (lb - ub * a).abs()),
|
blue: coloru8(lb - (lb - ub) * a),
|
||||||
alpha: 255
|
alpha: 255
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -178,7 +178,7 @@ pub async fn source(path: actix_web::web::Path<(i32, u32, u32)>, req: Query<Quer
|
||||||
let mut map = Pixmap::new();
|
let mut map = Pixmap::new();
|
||||||
for x in 0..256_usize {
|
for x in 0..256_usize {
|
||||||
for y in 0..256_usize {
|
for y in 0..256_usize {
|
||||||
let pix = rgb.get_pixel(255 - x as u32, y as u32);
|
let pix = rgb.get_pixel(y as u32, x as u32);
|
||||||
map.set(x, y, Color {
|
map.set(x, y, Color {
|
||||||
red: pix[0],
|
red: pix[0],
|
||||||
green: pix[1],
|
green: pix[1],
|
||||||
|
@ -223,8 +223,8 @@ pub async fn source(path: actix_web::web::Path<(i32, u32, u32)>, req: Query<Quer
|
||||||
return HttpResponse::new(StatusCode::NOT_FOUND)
|
return HttpResponse::new(StatusCode::NOT_FOUND)
|
||||||
};
|
};
|
||||||
|
|
||||||
//let image = merge(base_layer, data_layer, &settings);
|
let image = merge(base_layer, data_layer, &settings);
|
||||||
let image = base_layer;
|
//let image = base_layer;
|
||||||
|
|
||||||
let mut buf: Vec<u8> = vec![];
|
let mut buf: Vec<u8> = vec![];
|
||||||
// borrow checker insanity
|
// borrow checker insanity
|
||||||
|
|
Loading…
Reference in a new issue