pi-top-Python-SDK
pi-top-Python-SDK copied to clipboard
Provide simple interface for selecting pi-top camera resolution profile
Something like this:
camera = Camera(resolution="720p")
For these values:
720p480p360p240p
But without strings. Discuss.
I don't think there's a better way to do this than using a string, the fact the names start with a number makes any other method difficult. Other options:
- Use names like HD, SD, QVGA etc - cumbersome and non-specific, they have a one-to-many relationship with actual resolutions
- Large/medium/small/smallest - simple but lacks direct relationship, completely ambiguous as to what resolution is actually being used.
I also don't think it's a good idea to use a string like "720p" either as even those are one-to-many: 720p can mean 1280×720, 1360×768 and 366×768 according to Wikipedia. I'd prefer to stick to the tuple method so that users know exactly what the width and height of the image are - they generally need this information even when doing simple challenges on Further.
Instead, we should just add a check to make sure that a valid resolution has been passed, and if it is invalid provide clear instructions on what resolutions they can use.