Skip to content

Commit

Permalink
updated libraries s.t. it compiles again
Browse files Browse the repository at this point in the history
  • Loading branch information
Constantin Berhard committed Aug 10, 2016
1 parent 8985405 commit cb3405d
Show file tree
Hide file tree
Showing 5 changed files with 179 additions and 42 deletions.
205 changes: 171 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

name = "sdfgen"
version = "0.2.1"
version = "0.2.2"
authors = [ "Constantin Berhard <[email protected]>" ]

[[bin]]
Expand All @@ -13,4 +13,4 @@ image="*"
getopts="*"
byteorder="*"
num="*"
simple_parallel="*"
simple_parallel={git="https://github.com/ConnyOnny/simple_parallel.git"}
6 changes: 3 additions & 3 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ fn main() {
if verbose {
println!("Saving signed distance field image in png format as '{}'.", output_image_name);
}
let mut outf = File::create(output_image_name).unwrap();
let mut pngenc = image::png::PNGEncoder::<std::fs::File>::new(&mut outf);
let outf = File::create(output_image_name).unwrap();
let pngenc = image::png::PNGEncoder::<std::fs::File>::new(outf);
let (w,h) = sdf_u8.dimensions();
pngenc.encode(sdf_u8.into_raw().as_ref(), w, h, image::ColorType::Gray(8)).unwrap();
//sdf_u8.save(output_image_name).unwrap();
Expand Down Expand Up @@ -149,4 +149,4 @@ fn main() {
}
};

}
}
2 changes: 1 addition & 1 deletion src/mipmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ impl Mipmap {
let d = bigimg.get_pixel(x*2+1,y*2+1).data[0];
image::Luma{data:[compressor(a,b,c,d)]}
};
ImageBuffer::<image::Luma<u8>>::from_fn(1<<smallsizelog as u32, 1<<smallsizelog as u32,smallifier)
ImageBuffer::from_fn(1<<smallsizelog as u32, 1<<smallsizelog as u32,smallifier)
};
ret.images.push(smallimg);
}
Expand Down
4 changes: 2 additions & 2 deletions src/sdf_algorithm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub fn sdf_to_grayscale_image(src: &SDFImage, max_expressable_dst: DstT) -> Box<
let v:u8 = (dst as i32 + 127) as u8;
image::Luma{data:[v]}
};
Box::new(ImageBuffer::<image::Luma<u8>>::from_fn(width, height, fun))
Box::new(ImageBuffer::from_fn(width, height, fun))
}

#[inline]
Expand Down Expand Up @@ -188,4 +188,4 @@ pub fn calculate_sdf(mm: Arc<Mipmap>, size: u32, n_threads: usize) -> Box<SDFIma
pool.for_(args, worker);
}
Box::new(SDFImage::from_raw(size,size,results).unwrap())
}
}

0 comments on commit cb3405d

Please sign in to comment.