(a, ts, eps=1e-4)
| 3 | |
| 4 | # computation |
| 5 | def get_h_w(a, ts, eps=1e-4): |
| 6 | h = (ts * a)**0.5 |
| 7 | h = h + eps |
| 8 | h = math.ceil(h) if math.ceil(h) % 2 == 0 else math.floor(h) |
| 9 | w = h / a |
| 10 | w = w + eps |
| 11 | w = math.ceil(w) if math.ceil(w) % 2 == 0 else math.floor(w) |
| 12 | return h, w |
| 13 | |
| 14 | |
| 15 | def get_aspect_ratios_dict(ars, ts=360 * 640): |
no outgoing calls
no test coverage detected