-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PIXEL Unit is fixed at 72 #18
Comments
That's an interesting question, but if 72 PPI means Pixel per Inch, then somehow it should be able to get to the inch (similar to telling how many hours it takes travelling at X km/h or mph for a given distance) and from Inch to Metre it'll be a second step. |
How would we get the hours from X km/h? After reading the NonSI-class, here is how I could imagine an static final Unit PIXEL = addUnit(BYTE.multiply(4.0)); With "Resolution" being a new Quantity information/length. Unfortunately, I cannot tell how to proceed. How to extend the See my failed attempt here : https://github.com/flasheater/uom-systems/ java8/src/test/java/systems/uom/common/PixelTest.javaOliver Jan Krylow [email protected] |
The demo I developed for DevoXX to try what's in the slides https://github.com/unitsofmeasurement/uom-demos/blob/master/console/systems/common/src/main/java/tec/uom/demo/systems/common/AirplaneDemo.java shows how to get from a plane's speed and distance to travel time. At the moment, ISO80000 has |
@keilw Thank you for the hint. I have tested a successful conversion from Pixel to Metre now here . Are you suggesting PIXEL and PIXEL_PER_INCH should be defined in ISO80000? Btw, good talk at Devoxx! It gave me an overview of UOM, thanks. |
As long as they are in scope of ISO 80000 I would imagine. Thanks for attending the talk, glad you liked it (and weren't lured by the "CSI Cyber" like session as many others ;-) Would you like to create a PR for above conversion example? As for the right unit system, let's track and discuss it here. I could think of either "common" with a few additional other systems something to replace the only internal "NonSI" which has a far too broad name (all other systems are "Non SI" if you want;-) |
It goes along this already existing ticket for units like FRAMES_PER_SECOND. Whatever system is defined for that, PIXEL or PPI seem quite a good match there, too: #16 |
I agree. Those seem to fit together. Even though "common" is still too broad a term. PPI and FPS are quite specific to the domain "digital imagery". Have you decided how to "grow" systems over time? I am eluding to the following problem. Imagine we had this "common" system ( or Miscellaneous or NoSystem ...), then two years from now we realise a subset of units should be moved to its own or a different system. Do those moved units now get deprecated in common etc...? |
I merged the PR and everything still builds fine. I am not entirely sure, if this PIXEL and what was previously defined as are really the same thing. http://www.translatorscafe.com/cafe/EN/units-converter/length/105-110/nautical_mile_(US_Customary)-pixel/ shows a direct conversion of e.g. INCH -> PIXEL with 1 inch = 96.00120946406 pixel. There the quantity is clearly length, not information. |
This is very interesting: http://stackoverflow.com/questions/2025282/difference-between-px-dp-dip-and-sp-in-android |
Especially for those we moved and quickly deleted from the RI at that point (after a final 1.0 standard it would no longer be possible;-) we did exactly that. |
Yes, every Platform has its own ideas about what a Pixel is. While I admit, that my implementation of PIXEL could also be named COLOR (and start a whole new discussion on color systems), it is also true, that every Pixel in the length dimension can be expressed as final Unit<Length> CSS_PIXEL = NonSI.PIXEL_PER_INCH.inverse().multiply( NonSI.PIXEL ).divide( 96 ).asType( Length.class ); or something similar. |
Google also has some interesting thoughts on that in their Material Design: http://www.google.com/design/spec/layout/units-measurements.html |
This should probably move somewhere else. |
Since Unicode CLDR 36 (#157) introduced a PIXEL, we might have to revisit that. |
A Pixel however is a relative unit as defined by PPI (Pixel per Inch). How would we define the Unit "PPI" in such a way, that a conversion path leads back to METRE?
The text was updated successfully, but these errors were encountered: