maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Touchscreen subpixel accuracy? (https://talk.maemo.org/showthread.php?t=11246)

tjay 2007-11-02 04:09

Touchscreen subpixel accuracy?
 
Hi everyone.

I'm thinking of buying an N810, and writing a paint app for it.

Does the touchscreen have subpixel accuracy? If so, what APIs is it exposed through? GTK? Anyone have any idea how good/accurate/stable it is?

I know the touchscreen is pressure sensitive (yay!). How many levels does it have? Is it uniform across the surface of the screen? What APIs can access it? The howto on maemo.org uses XLib. What about GTK, etc?


Thanks a bunch,

TJ

maxilogan 2007-11-02 08:29

Re: Touchscreen subpixel accuracy?
 
Quote:

Originally Posted by tjay (Post 89635)
Does the touchscreen have subpixel accuracy? If so, what APIs is it exposed through? GTK? Anyone have any idea how good/accurate/stable it is?

I know the touchscreen is pressure sensitive (yay!). How many levels does it have?

I don't know about subpixel accuracy, but regarding the pressure sensitivity I can say that I tried Maemopad+ handwriting tool and it appears to detect 2 levels. Don't know whether this is enough, too low, and if it is due to Maemopad+ or to the touchscreen itself.

yabbas 2007-11-02 12:48

Re: Touchscreen subpixel accuracy?
 
http://maemo.org/community/wiki/howt...npressuredata/

tjay 2007-11-03 08:10

Re: Touchscreen subpixel accuracy?
 
yabbas: Thanks, but I've already seen that. In fact I linked to it in my opening post.

maxilogan: Thanks for the info on maemopad. 2 levels isn't quite enough, though subpixel accuracy is the make-or-break feature for me. I'll see if I can find any info on these two features in maemopad's webpage or source code.

Anyone else have a clue about this?

TJ

technut 2007-11-03 08:24

Re: Touchscreen subpixel accuracy?
 
No clue, but you've got me curious about what your intentions are for that level of accuracy, even in a paint program. Have you seen how small the pixels are on the N8xx screen? I don't know too many people who can reliably achieve sub-pixel accuracy while pointing with a stylus in their hand.

tjay 2007-11-03 09:15

Re: Touchscreen subpixel accuracy?
 
technut: It is impossible to draw a smooth, non-aliased diagonal line without some form of subpixel accuracy, a problem which is compounded if I were working on the image at anything less than 100% zoom. I wish to paint with Photoshop-level quality, not MS Paint level pixel art ;)

I've just had a look through maemopad+'s source. It uses GDK functions to get x/y coordinates, which returns the coords as doubles, which only means that GDK supports subpixel accuracy. However, maemopad+ then goes on to draw pixels using GDK primitives which only use ints, so any subpixel information is lost. I am unable to conclude whether it is maemopad+ which does not support subpixel accuracy or the tablet's touchscreen. Maybe I should try contacting the author of maemopad+.


TJ

anders_gud 2007-11-06 21:46

Re: Touchscreen subpixel accuracy?
 
Hi!
Thinking of buying one too if someone got around to writing/porting a decent drawing app ;-)

Quote:

Originally Posted by tjay (Post 89635)
Does the touchscreen have subpixel accuracy? If so, what APIs is it exposed through? GTK? Anyone have any idea how good/accurate/stable it is?

I've only found this spec from TexasInstruments for the chip I believe is in the n800.

Quote:

Originally Posted by tjay (Post 89635)
I know the touchscreen is pressure sensitive (yay!). How many levels does it have? Is it uniform across the surface of the screen? What APIs can access it? The howto on maemo.org uses XLib. What about GTK, etc?

The chip is pressure sensitive but it's up to the kernel "driver" to catch and use the input in a proper way. Maybe Nokia has some kernel patches for this (as in the Sharp Zaurus)?
I have an old hp1915 PDA that has a similar controller but the kernel ignores the pressure input.
Anyway, I hope you will get the right answers and start hacking your app. On my 1915 I have built and tried:
SPainter aka "Petite Peinture" (lightweight old Zaurus painting app, horrible aliasing and nice compact UI)
Gimp 2.3.3 (Slow as hell on 64mb RAM - menus to cluttered on 320x240px)
Blender (just for the fun of it - OpenGl software rendering without FPU)
MyPaint (Promising for small devices, Python-GTK+2 based, pressure aware but no layer functions - already runs on maemo check posts on this forum by unique311)
Cheers!
Anders

tjay 2007-11-07 05:53

Re: Touchscreen subpixel accuracy?
 
Quote:

Originally Posted by anders_gud (Post 91468)
I've only found this spec from TexasInstruments for the chip I believe is in the n800.

Wow. That would probably be useful if I wanted to write my own driver for it ;) I'm leaning more towards Nokia writing the bloody drivers though. For a supposedly open platform, I must say the documentation is pretty bad. I haven't contacted anyone directly though, just going by what's already written on websites.

Quote:

Originally Posted by anders_gud (Post 91468)
The chip is pressure sensitive but it's up to the kernel "driver" to catch and use the input in a proper way. Maybe Nokia has some kernel patches for this (as in the Sharp Zaurus)?

Pressure sensitivity is already supported by the driver. I dunno how good that support is though.

Found some videos on youtube uploaded by unique311. Thanks for the heads up :) From what I can see, it looks like drawing works fine.


Cheers,
TJ

sdrman 2007-11-07 06:11

Re: Touchscreen subpixel accuracy?
 
4 Attachment(s)
I compiled the pressure demo program with some changes and it's pretty cool. I hope to post a video of it. If you're really impatient, just download the binary and start playing. The Xsp output is much higher resolution than the screen, so you do get subpixel resolution. Pressure output is also pretty detailed, but the pressure value is not consistent over the entire screen. Some areas are less sensitive.



The deb files are really just binaries. Just download, rename, chmod, and run. The only difference is the hardcoded calibration. Try them both and you'll see why.

touchdemosrc.txt should probably have its extension changed to .c .

touchlog.txt is the data provided by Xsp. I drug the stylus diagonally across the screen while increasing the pressure. The format is "raw x, raw y, pressure".

tigert 2007-11-07 06:35

Re: Touchscreen subpixel accuracy?
 
You should use DynaDraw (google for dynadraw gtk will find Federico's gtk+ port of it which is old but trivial to port to gtk2)

It uses an interesting model to eliminate jitters and works much better - your hand shakes matter a LOT too in this thing anyway.

//T

tjay 2007-11-07 12:26

Re: Touchscreen subpixel accuracy?
 
@sdrman: Thanks! That's really good info. I see you've put more than 3000 for the DELTA values. That's very nice accuracy :) Looks like I can start saving up for an N810 now. I didn't notice TRANSLATE_RAW_COORDS in the wiki howto before. Strange... I guess I owe yabbas an apology. Sorry, yabbas.

@tigert: Interesting, thanks.


Cheers,
TJ

yabbas 2007-11-15 16:08

Re: Touchscreen subpixel accuracy?
 
No probs tjay :) g'luck with your plans.

lad 2007-12-28 21:25

Re: Touchscreen subpixel accuracy?
 
Just caught this thread searching on "paint." It occured to me that the NITs could make excellent little sketch pads with their palmable size, handy stylus and hi-rez screens.

Full pressure sensitivity would be amazing, but I'd settle for higher virtual-rez and quick n' easy color mixers/palettes.

realcomix 2007-12-28 22:21

Re: Touchscreen subpixel accuracy?
 
i thinks i remember some one porting gimp to n800 a while ago... pressure sensing would be sweet

tjay 2007-12-29 00:39

Re: Touchscreen subpixel accuracy?
 
You know, I did some calculations on the X-axis values in sdrman's touchlog.txt, and IIRC, it seems that there's only really about 3 points per pixel of touchscreen resolution. Some pixels have 2 and some have 4. I didn't do any calculations on the Y-axis values though. Seems low when compared to the RAW_DELTA_* values, which _I thought_ were a hint to the accuracy of the device. Perhaps there's a setting to increase sampling resolution etc somewhere. Still, it's better than Windows Mobile devices, which have 2 points per pixels in the X and Y directions, in the API at least.

sdrman says that the pressure data isn't consistent across the screen, so I suppose it won't be good enough for drawing. GIMP will need a different UI to work well on the tablets ;)

Anyway, still haven't got my hands on an N800. I live in Malaysia and the device isn't actually available here. Plus I've never seen anyone walking around with one either. Sigh...

TJ


All times are GMT. The time now is 08:10.

vBulletin® Version 3.8.8