Magimedia
Posts: 33
Joined: Sun Feb 22, 2015 8:31 pm

New to graphics programming - what to learn?

Sat Feb 13, 2016 2:49 pm

Hi,

I have an application that revolves around a 1024 x 1280 display (ie the config sets the screen rotated 90 degrees). The application needs to display some JPEGs in sequence, and also a page of text that will scroll.

Currently I'm using HTML and KWeb3 for this, which is passable, but the transitions between images is clunky, and text scrolling isn't smooth. My thinking is that I can probably code what I need (since the layouts are very simple anyway), and interface with the GPIO, as I've made an electronics interface..

What I want to achieve is mainly smooth transitions (fade or slide) between JPEGs, and very smooth text scrolling at a reasonable speed.

As far as I can make out, my best chance of success may be to use OpenVG and AJStarks library, although there's also something called OpenFrameworks that I've encountered.

I have some programming background in PHP/MySQL, and know a little C (low level PIC programming). I've also used Python, which I'm ruling out as I don't think there are OpenVG libraries for it. I realise I'm going to have to learn some new stuff, and the prospect is a little daunting but also quite exciting!

What would be the easiest language to accomplish this in?

Is the easiest language also going to give the best performance, or isn't there much difference?

Should I use AJStarks OpenVG library, or OpenFrameworks?

User avatar
GTR2Fan
Posts: 1601
Joined: Sun Feb 23, 2014 9:20 pm
Location: South East UK

Re: New to graphics programming - what to learn?

Sat Feb 13, 2016 2:54 pm

Wouldn't it be easier to just generate a video from the stills with embedded scrolling text with ffmpeg and play that back with omxplayer?

Another alternative would be to create and run a slideshow in Libreoffice Impress.
Pi2B Mini-PC/Media Centre: ARM=1GHz (+3), Core=500MHz, v3d=500MHz, h264=333MHz, RAM=DDR2-1200 (+6/+4/+4+schmoo). Sandisk Ultra HC-I 32GB microSD card on '50=100' OCed slot (42MB/s read) running Raspbian/KODI16, Seagate 3.5" 1.5TB HDD mass storage.

Magimedia
Posts: 33
Joined: Sun Feb 22, 2015 8:31 pm

Re: New to graphics programming - what to learn?

Sat Feb 13, 2016 2:58 pm

The text content can change hourly.
The JPEGs and text will eventually be able to be controlled via the GPIO interface.

I don't see how that could be accomplished in video? ...or are you suggesting compiling a video on boot?

User avatar
GTR2Fan
Posts: 1601
Joined: Sun Feb 23, 2014 9:20 pm
Location: South East UK

Re: New to graphics programming - what to learn?

Sat Feb 13, 2016 3:00 pm

Magimedia wrote:The text content can change hourly.
The JPEGs and text will eventually be able to be controlled via the GPIO interface.
Ah. I saw no mention of this in the opening post until going back and spotting the GPIO reference.
Pi2B Mini-PC/Media Centre: ARM=1GHz (+3), Core=500MHz, v3d=500MHz, h264=333MHz, RAM=DDR2-1200 (+6/+4/+4+schmoo). Sandisk Ultra HC-I 32GB microSD card on '50=100' OCed slot (42MB/s read) running Raspbian/KODI16, Seagate 3.5" 1.5TB HDD mass storage.

ghans
Posts: 7819
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: New to graphics programming - what to learn?

Sat Feb 13, 2016 4:18 pm

Those programs should do what you want OOB or
could at least be modified to do so :

http://www.info-beamer.com
http://www.screenlyapp.com
http://pipresents.wordpress.com


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Magimedia
Posts: 33
Joined: Sun Feb 22, 2015 8:31 pm

Re: New to graphics programming - what to learn?

Sun Feb 14, 2016 12:56 am

Thanks

I made the mistake of creating a new install of Jessie. I can't get anything to run on startup, or if I put it in rc.local it doesn't output to the screen.

Is SystemD unable to simply run scripts on startup? Will I have to go back to Wheezy?

ghans
Posts: 7819
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: New to graphics programming - what to learn?

Sun Feb 14, 2016 9:26 am

The whole point of an init system is to run scripts
on startup.

What does "it doesn't output to the screen" mean ? Does your
program have graphical output or does it use stdout/stderr ?


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Magimedia
Posts: 33
Joined: Sun Feb 22, 2015 8:31 pm

Re: New to graphics programming - what to learn?

Sun Feb 14, 2016 12:24 pm

The script I used to run under Wheezy simply ran a python program, which looked to see if there was a working internet connection, and if there was, downloaded some files, then used python's print command to output the word "UPDATED" in large letters drawn out of asterisks so it could be seen clearly from across a room. This no longer happens, and rc.local is executed a little earlier.

The script then went on to start KWeb3 etc. but that's the part I want to do differently this time.

I've managed to "fudge" things, by having a python script executed in rc.local that waits for 15 seconds then fakes pressing keys on the keyboard to run another script. It's an ugly hack, but it's working.

Back to the original problem...

raysan5
Posts: 37
Joined: Tue Sep 30, 2014 4:44 pm
Location: Barcelona
Contact: Website

Re: New to graphics programming - what to learn?

Mon Mar 21, 2016 3:11 pm

Maybe you can try my library: raylib (www.raylib.com). Its simple and easy-to-use, you code in C and my students are very happy with it. It works very well in any RPI version.

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

Re: New to graphics programming - what to learn?

Sat Apr 02, 2016 8:49 am

wow, amazing!
great source code examples, marvelous clearly arranged!
congratulations!

did you publish it on Github?

How can I "apt-get install" raylib on my Raspi to #include the lib into my own Raspi gpp C/C++ programs?
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

raysan5
Posts: 37
Joined: Tue Sep 30, 2014 4:44 pm
Location: Barcelona
Contact: Website

Re: New to graphics programming - what to learn?

Sun Apr 03, 2016 10:03 pm

Hi davenull, many thanks for your comments! Lot of effort has been invested in raylib.

You can download raylib from github: https://github.com/raysan5/raylib

In the github wiki there is some info on usage: https://github.com/raysan5/raylib/wiki/ ... spberry-Pi

I don't know how to make it available from apt-get...

Please, let me know if you have any problem! :)

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

Re: New to graphics programming - what to learn?

Mon Apr 04, 2016 9:03 am

how to download and install it then on Raspbian Jessie?
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

raysan5
Posts: 37
Joined: Tue Sep 30, 2014 4:44 pm
Location: Barcelona
Contact: Website

Re: New to graphics programming - what to learn?

Tue Apr 05, 2016 9:37 am

You should download it from Git repository:

Code: Select all

sudo apt-get install git
git clone https://github.com/raysan5/raylib.git raylib
And then you can compile the library following GitHub Wiki steps.

davenull
Posts: 1159
Joined: Thu Oct 22, 2015 7:22 am
Location: a small planet close to Betelgeuze

Re: New to graphics programming - what to learn?

Tue Apr 05, 2016 9:54 am

ah, I see!
git is already installed, so I'll try it ASAP (have some WiFi issues FTM unfortunately since a couple of weeks, with all my WiFi sticks at my Raspi)
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;int main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PointOut(x,y);}}}for(;;);}

Return to “OpenVG”