Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader > Kobo Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 11-11-2020, 05:48 PM   #1
nihilazo
Member
nihilazo began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Apr 2019
Device: Kobo Aura HD
Graphics from go on the kobo?

Hi,
I'd like to write an application (a browser for the gemini protocol) for the kobo in go, but the only way I have found to draw to the screen from a go program is through fbink (which is great but a little limited for what I'd like).
Is there some other way to draw to the screen/get touchscreen events from a go program?

Thanks!
nihilazo is offline   Reply With Quote
Old 11-11-2020, 06:49 PM   #2
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,482
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
That'd be a no . The only other remotely viable approach is a full custom Qt5 stack (àla pbchess/UMR).

Fair warning in advance: Whatever you go with, input is going to be a major PITA. There's a reason almost nothing out there handles all the corner-cases properly, except for the stock Qt QPA, which we can't use, and Plato. KOReader is a close second, and that mainly because it forgoes hardware rotation handling (and what little it deals with on that front is relegated to FBInk via fbdepth), which avoids a nice chunk of the potential issues.
(Purely coincidental example: https://github.com/llandsmeer/inkvt/pull/14)

Out of curiosity, what's the hangup with FBInk?

Last edited by NiLuJe; 11-11-2020 at 06:56 PM.
NiLuJe is offline   Reply With Quote
Advert
Old 11-11-2020, 07:51 PM   #3
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 868
Karma: 2676800
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
I did a bit of exploratory work with touch input in Go a while ago. You can find it here: go-kobo-input. I also created an experimental on-screen keyboard as well, which can be found at go-osk.

The above probably still has some potential, if anyone wants to dust off the code. The input code probably needs to handle device specific rotation/mirroring handling though, as at the time, I was testing it with my old H2O.
sherman is offline   Reply With Quote
Old 11-11-2020, 11:08 PM   #4
geek1011
Wizard
geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.
 
Posts: 2,766
Karma: 6990707
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
Quote:
Originally Posted by nihilazo View Post
but the only way I have found to draw to the screen from a go program is through fbink (which is great but a little limited for what I'd like)
If the issue is that you don't want to call FBInk with os.Exec, sherman has made a CGO wrapper for it. If you want to avoid FBInk entirely, you may have luck porting Plato's FB and input handling to Go directly since it's quite well written and easy to read.

If the issue is that you want more sophisticated text layout and rendering, note that you'll still need to deal with it no matter what you use (unless you're using a GUI toolkit with support for it, or embedding a minimal browser engine to do the rendering for you). Personally, I'd use Pango/Cairo, but Skia is another option.
geek1011 is offline   Reply With Quote
Old 11-12-2020, 03:08 PM   #5
nihilazo
Member
nihilazo began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Apr 2019
Device: Kobo Aura HD
Quote:
Originally Posted by NiLuJe View Post
That'd be a no . The only other remotely viable approach is a full custom Qt5 stack (àla pbchess/UMR).

Fair warning in advance: Whatever you go with, input is going to be a major PITA. There's a reason almost nothing out there handles all the corner-cases properly, except for the stock Qt QPA, which we can't use, and Plato. KOReader is a close second, and that mainly because it forgoes hardware rotation handling (and what little it deals with on that front is relegated to FBInk via fbdepth), which avoids a nice chunk of the potential issues.
(Purely coincidental example: https://github.com/llandsmeer/inkvt/pull/14)

Out of curiosity, what's the hangup with FBInk?
The hangup with fbink is that I can't see how to do things beyond text and already stored images with it, although I'm probably being dumb.
nihilazo is offline   Reply With Quote
Advert
Old 11-12-2020, 03:38 PM   #6
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 868
Karma: 2676800
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
Quote:
Originally Posted by nihilazo View Post
The hangup with fbink is that I can't see how to do things beyond text and already stored images with it, although I'm probably being dumb.
You can feed raw scanlines to fbink, so one can programmatically draw to a buffer, and pass that to FBink for display.

go-fbink-v2 for example has a convenience "PrintRBGA" function, which displays an image.RGBA. You could use a library like gg to draw to an image.RGBA, then display it with "PrintRBGA"

One of these days, it would be cool to have a pure Go solution for printing to screen, but that isn't today...
sherman is offline   Reply With Quote
Old 11-12-2020, 04:06 PM   #7
nihilazo
Member
nihilazo began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Apr 2019
Device: Kobo Aura HD
Quote:
Originally Posted by sherman View Post
You can feed raw scanlines to fbink, so one can programmatically draw to a buffer, and pass that to FBink for display.

go-fbink-v2 for example has a convenience "PrintRBGA" function, which displays an image.RGBA. You could use a library like gg to draw to an image.RGBA, then display it with "PrintRBGA"

One of these days, it would be cool to have a pure Go solution for printing to screen, but that isn't today...
Oh awesome, I'll try that out!
nihilazo is offline   Reply With Quote
Old 11-12-2020, 06:11 PM   #8
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,482
Karma: 26012494
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Yeah, the idea was to keep things to what I'm interested in first and foremost (i.e., messing with the mxcfb quirks), and what I'm halfway decent at second, which most decidedly is NOT maths and drawing primitives ;p.

So the current stance is: bake your pixmap using tools written by people who actually know what they're doing, and *then* feed it to fbink_print_raw_data ^^.
NiLuJe is offline   Reply With Quote
Old 01-20-2021, 02:35 PM   #9
nihilazo
Member
nihilazo began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Apr 2019
Device: Kobo Aura HD
Quote:
Originally Posted by sherman View Post
I did a bit of exploratory work with touch input in Go a while ago. You can find it here: go-kobo-input. I also created an experimental on-screen keyboard as well, which can be found at go-osk.

The above probably still has some potential, if anyone wants to dust off the code. The input code probably needs to handle device specific rotation/mirroring handling though, as at the time, I was testing it with my old H2O.
Is this input code usable in its current state or does it need more work to get there?
nihilazo is offline   Reply With Quote
Old 01-20-2021, 04:03 PM   #10
sherman
Guru
sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.sherman ought to be getting tired of karma fortunes by now.
 
Posts: 868
Karma: 2676800
Join Date: Aug 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
Quote:
Originally Posted by nihilazo View Post
Is this input code usable in its current state or does it need more work to get there?
I haven't touched (heh) it in a long time, so probably needs work.

More specifically, proper rotation/mirroring support needs to be added.
sherman is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Any way to display custom graphics on the Kobo Wifi? KevinShort Kobo Developer's Corner 1 10-13-2012 03:57 PM
Walking Dead graphics novels come to Kobo (and are non-agency!) scrapking Kobo Tablets 9 03-29-2012 06:50 AM
Kobo & inline graphics Slope Kobo Reader 7 02-21-2011 12:25 PM
graphics glitches - new for me alexxx Calibre 7 12-16-2010 04:21 AM
Computer Graphics Novel for $1.99 roller_coaster Deals and Resources (No Self-Promotion or Affiliate Links) 2 03-17-2010 11:15 AM


All times are GMT -4. The time now is 09:36 AM.


MobileRead.com is a privately owned, operated and funded community.