RedApparat / Fotoapparat

Making Camera for Android more friendly. 📸
Apache License 2.0
3.82k stars 405 forks source link

Add Size getter for pixels and megapixels #141

Closed ezaquarii closed 6 years ago

ezaquarii commented 6 years ago

Number of pixels is used in some UI logic to sort available sizes. It's tedious to multiply it on each occasion. Megapixels count is useful for presentation, the same as aspect ratio.

Diolor commented 6 years ago

Hey @ezaquarii, thanks !

Size is meant to not have units. We actually use it everywhere as Resolution with pixels as units. Renaming this to Resolution will create breaking changes. Renaming docs only (about the units) and keeping the Size name will feel incomplete.

So let's keep only the width * height operation under the name getArea().

Fun fact: According to google 1MP = 1,048,576 pixels :D

ezaquarii commented 6 years ago

Fair enough. Here you go.

Diolor commented 6 years ago

Thanks!