Skip to content
This repository has been archived by the owner on Dec 2, 2022. It is now read-only.

Add option to rotate display by 90, -90, 180 for different orientations #7

Closed
txoof opened this issue Oct 7, 2020 · 8 comments
Closed

Comments

@txoof
Copy link
Owner

txoof commented Oct 7, 2020

This will likely impact the epdlib.Screen class.

  • 180 rotations should be trivial as it won't affect much other than adding a line to rotate the final output image
  • 90 and -90 rotations will be more complex epdlib.Layout will probably need some work because the width and height are hard-coded as a tuple of (epd.width, epd.height)
@tmmorin
Copy link

tmmorin commented Oct 7, 2020

Indeed, 180 is easily achieved by a little bit of class overloading (my proposed change), while 90/-90 will require interactions with the layout.

For 90/-90 my feeling is that it will be better to try to achieve this by:

  • adding an option to rotate a given block in a layout
  • adding an option to rotate all blocks in a layout
  • then new layouts dedicated to a 90 or -90 orientation can be added, which will use these options

@txoof
Copy link
Owner Author

txoof commented Oct 8, 2020

@tmmorin
I'm thinking that it would be best to rotate everything in the layout. This might be as simple as adding a parameter to the screen class that adjust the rotation.

The Block classes don't really care what the dimensions of the screen are, they just need to know the X and Y values.

Are you on Discord/Google/some other platform to chat?

I just discovered Discord: txoof#0376

@txoof
Copy link
Owner Author

txoof commented Oct 8, 2020

@tmmorin
Can you test out commit 8a7d5b0 on the development branch? I've got it working for 0, 90, -90 and 180 degree rotations.

There's some proof of concept code attached in the Screen library it should run with python Screen.py
PXL_20201008_185838395
PXL_20201008_185734790
PXL_20201008_185809221

@txoof
Copy link
Owner Author

txoof commented Oct 10, 2020

@tmmorin this commit should do the job with the option

I think it's all good, but if you have a moment to test it out and confirm that it runs OK, I'd appreciate it.

@txoof
Copy link
Owner Author

txoof commented Oct 10, 2020

the version above is built against the development branch of the epdlib

@txoof
Copy link
Owner Author

txoof commented Oct 10, 2020

Should actually be commit 3440b64

@tmmorin
Copy link

tmmorin commented Oct 12, 2020

Are you on Discord/Google/some other platform to chat?
I just discovered Discord: txoof#0376

tm.morin@gmail.com on hangouts will work quite well for me, if you want :)

I'm going to try the rotation code ; I'm lost in your commits to be honest ... but that's no big deal ! ;)

@txoof txoof closed this as completed Jul 7, 2021
@txoof
Copy link
Owner Author

txoof commented Jul 7, 2021

I've implented this and it appears to work as expected.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants