integer_scaling/
integer_scaling.rs

1/*! IntegerScaling by Marat Tanalin | http://tanalin.com/en/projects/integer-scaling/ */
2
3#![allow(non_snake_case)]
4
5pub fn calculate_ratio(area_width : u32, area_height : u32,
6	image_width : u32, image_height : u32) -> u32
7{
8	IntegerScaling::calculateRatio(area_width, area_height, image_width, image_height)
9}
10
11pub fn calculate_ratios(area_width : u32, area_height : u32,
12	image_width : u32, image_height : u32,
13	aspect_x : f64, aspect_y : f64) -> IntegerScaling::Ratios
14{
15	IntegerScaling::calculateRatios(area_width, area_height, image_width, image_height, aspect_x, aspect_y)
16}
17
18pub fn calculate_size(area_width : u32, area_height : u32,
19	image_width : u32, image_height : u32) -> IntegerScaling::Size
20{
21	IntegerScaling::calculateSize(area_width, area_height, image_width, image_height)
22}
23
24pub fn calculate_size_corrected(area_width : u32, area_height : u32,
25	image_width : u32, image_height : u32,
26	aspect_x : f64, aspect_y : f64) -> IntegerScaling::Size
27{
28	IntegerScaling::calculateSizeCorrected(area_width, area_height, image_width, image_height, aspect_x, aspect_y)
29}
30
31pub fn calculate_size_corrected_perfect_y(area_width : u32, area_height : u32,
32	image_height : u32,
33	aspect_x : f64, aspect_y : f64) -> IntegerScaling::Size
34{
35	IntegerScaling::calculateSizeCorrectedPerfectY(area_width, area_height, image_height, aspect_x, aspect_y)
36}