XIMR remapping - Feature Requests - CHDK Forum

XIMR remapping

  • 3 Replies
  • 2173 Views
XIMR remapping
« on: 04 / November / 2022, 13:34:01 »
Advertisements
@philmoz

This is just a thought and it may be stupid…or maybe not?

My thought is to have a Lua function that remaps the XIMR drawing to the portrait orientation. For example draw.​remap(y_offset) will take all the drawing objects that are enabled and remap them from the landscape orientation to the portrait.

Obviously, the aspect ratio is different and hence remapping might ‘simply’ be restricted to the same aspect ratio, ie scaled, but positioned in the remapped y direction, ie at the top or bottom of the portrait area, user definable y_offset variable.

As I say, it’s just a thought and I would welcome your views. If you think it has merit and you [:-)] could see yourself coding it, I could add some more thoughts.

The above idea would go well if we could detect landscape or portrait orientation, but it would also work well with a scripted button press to force the change.

The idea could be extended to cover other remapping needs, ie upside down etc.

The use case being where a script is giving the user info, eg as on my depth of field script.

Cheers

Garry
« Last Edit: 04 / November / 2022, 14:25:01 by pigeonhill »

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: XIMR remapping
« Reply #1 on: 04 / November / 2022, 17:19:36 »
@pigeonhill


CHDK already supports upside down orientation - you can set this with the 'rotate_osd' variable (from cnf_osd.lua).
This is a manual switch - we don't have anything that detects the camera orientation sensor (that I can remember).


Portrait orientation is a bit tougher.
Drawing the UI rotated 90 degrees (left or right) could be done with a bit of work. We just have to adjust the X & Y co-ordinates before converting to the screen buffer address.
The messy part is how to reposition things so they are still onscreen, if we wanted to rotate all the CHDK UI. Scaling might work but would not look very good - I don't think text would be readable.


Rotating just the stuff drawn with the drawings.lua library might be feasible, thought I'm not sure how much it would complicate the existing CHDK drawing code. I need to think about this more.



CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: XIMR remapping
« Reply #2 on: 04 / November / 2022, 17:48:23 »
@philmoz


I nearly didn’t post as I thought it might be too much effort, but in the end I thought it worth flagging as an idea.


I was thinking that, deep in the CHDK code, there was a pixel level function that draws stuff, ie turning a pixel on or off, and this was where one could remap. It would only work at the screen level, ie redraw by removing all drawing first.


BTW I was only thinking about the drawings.lib.


But I’m most probably being too ignorant about things  ;)
« Last Edit: 04 / November / 2022, 17:58:10 by pigeonhill »

*

Offline Caefix

  • *****
  • 947
  • Sorry, busy deleting test shots...
Re: XIMR remapping
« Reply #3 on: 07 / November / 2022, 08:33:10 »

Portrait orientation is a bit tougher.
Drawing the UI rotated 90 degrees (left or right) could be done with a bit of work. We just have to adjust the X & Y co-ordinates before converting to the screen buffer address.
The messy part is how to reposition things so they are still onscreen, if we wanted to rotate all the CHDK UI.

Maybe a predefined 90°-OSD-layout?  :)
Then could some other info be displayed, too.
All lifetime is a loan from eternity.


 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal