f



access to the screen

I have an assignment to read PNG files in parallel and the firs thing I
thought of was how do I send the output of the read to the screen?

Ruben
0
ruben
10/13/2016 1:46:21 AM
comp.unix.programmer 10848 articles. 0 followers. kokososo56 (350) is leader. Post Follow

11 Replies
548 Views

Similar Articles

[PageSpeed] 22

ruben safir <ruben@mrbrklyn.com> writes:

> I have an assignment to read PNG files in parallel and the firs thing I
> thought of was how do I send the output of the read to the screen?

Is that part of the assignment, or do you just need to show that you've
read the file successfully by doing some sort of analysis?

If you really need to display the result, the question varies with which
toolkit you're using...
0
Joe
10/13/2016 2:51:39 AM
On 10/12/2016 10:51 PM, Joe Pfeiffer wrote:
> Is that part of the assignment, or do you just need to show that you've
> read the file successfully by doing some sort of analysis?
> 
> If you really need to display the result, the question varies with which
> toolkit you're using...


I need to see it.  I need to read it and display it.  I assume I'm using
X, but can it be sent to a terminal?  libpng doesn't access the screen
directly?  The gimp uses what?
0
ruben
10/13/2016 3:21:36 AM
On 2016-10-13, ruben safir <ruben@mrbrklyn.com> wrote:
> On 10/12/2016 10:51 PM, Joe Pfeiffer wrote:
>> Is that part of the assignment, or do you just need to show that you've
>> read the file successfully by doing some sort of analysis?
>> 
>> If you really need to display the result, the question varies with which
>> toolkit you're using...
>
>
> I need to see it.  I need to read it and display it.  I assume I'm using
> X, but can it be sent to a terminal?  libpng doesn't access the screen
> directly?  The gimp uses what?

GIMP sends canvas paint requests to ... that fox which holds the brush
in its mouth.
0
Kaz
10/13/2016 4:12:42 AM
On 10/13/2016 12:12 AM, Kaz Kylheku wrote:
> GIMP sends canvas paint requests to ... that fox which holds the brush
> in its mouth.

?
0
ruben
10/13/2016 7:17:51 AM
ruben safir wrote:
> On 10/13/2016 12:12 AM, Kaz Kylheku wrote:
>> GIMP sends canvas paint requests to ... that fox which holds the brush
>> in its mouth.
> 
> ?

Most people wishing to "open their first window
on an X server and display something", look
for a tutorial to that effect on the web.

http://math.msu.su/~vvb/2course/Borisenko/CppProjects/GWindow/xintro.html

    "This document is a very basic introduction.
     This is its first draft (2/9/96)."

So that tutorial was written 20 years ago.

You can use a PNG library, prepare a pixmap
from the PNG, find some nice tutorial code for
resizing a pixmap, make a bunch of thumbnails
and plunk them into your main window and so on.

And this part of your project is the easy part.
I can't help you with the hard part. As I'm
a "copy and paste programmer" :-)

    Paul
0
Paul
10/13/2016 8:04:06 AM
On Wed, 12 Oct 2016 21:46:21 -0400, ruben safir wrote:

> I have an assignment to read PNG files in parallel and the firs thing I
> thought of was how do I send the output of the read to the screen?

The easiest solution is to use a GUI toolkit (GTK, Qt, wxWidgets, Tk,
....). There are lower-level solutions using Xlib or even fbdev, but
they're more complicated.

0
Nobody
10/13/2016 9:39:59 AM
On 13/10/2016 03:46, ruben safir wrote:

> I have an assignment to read PNG files in parallel and the first thing I
> thought of was how do I send the output of the read to the screen?

In the old days, one might use DirectFB (defunct) or fbdev.

https://en.wikipedia.org/wiki/DirectFB
https://en.wikipedia.org/wiki/Linux_framebuffer

Today, it's gotten more complex with DRI, DRM, Wayland, Mir, etc.

https://en.wikipedia.org/wiki/Direct_Rendering_Infrastructure
https://en.wikipedia.org/wiki/Direct_Rendering_Manager
https://en.wikipedia.org/wiki/Wayland_%28display_server_protocol%29
https://en.wikipedia.org/wiki/Mir_%28software%29

A tutorial might be in order.

http://betteros.org/tut/graphics1.php

If you just want to display to a terminal, you might also consider
AAlib or libcaca.

https://en.wikipedia.org/wiki/AAlib
https://en.wikipedia.org/wiki/Libcaca

Regards.
0
Noob
10/13/2016 10:55:27 AM
Nobody , dans le message
<pan.2016.10.13.09.39.58.342000@nowhere.invalid>, a �crit�:
> The easiest solution is to use a GUI toolkit (GTK, Qt, wxWidgets, Tk,
> ...).

Piping the image to a viewer is even simpler.
0
Nicolas
10/13/2016 12:18:13 PM
ruben safir <ruben@mrbrklyn.com> writes:

> On 10/12/2016 10:51 PM, Joe Pfeiffer wrote:
>> Is that part of the assignment, or do you just need to show that you've
>> read the file successfully by doing some sort of analysis?
>> 
>> If you really need to display the result, the question varies with which
>> toolkit you're using...
>
>
> I need to see it.  I need to read it and display it.  I assume I'm using
> X, but can it be sent to a terminal?  libpng doesn't access the screen
> directly?  The gimp uses what?

GTK (the Gimp Toolkit, originally written for the Gimp).  See
http://www.gtk.org/
0
Joe
10/13/2016 2:30:37 PM
On Thu, 2016-10-13, Nicolas George wrote:
> Nobody , dans le message
> <pan.2016.10.13.09.39.58.342000@nowhere.invalid>, a �crit�:
>> The easiest solution is to use a GUI toolkit (GTK, Qt, wxWidgets, Tk,
>> ...).
>
> Piping the image to a viewer is even simpler.

Yes; unless the assignment forbids it[0], I'd probably convert to PNM,
and feed it to Imagemagick's display(1) utility, or something.

/Jorgen

[0] But at first it sounded as if the assignment focused on using
    parallelism for fast PNG decoding.  It's unclear why just creating
    a bitmapped image file in some simple format wouldn't be enough.

-- 
  // Jorgen Grahn <grahn@  Oo  o.   .     .
\X/     snipabacken.se>   O  o   .
0
Jorgen
10/13/2016 4:40:31 PM
On 10/13/2016 12:40 PM, Jorgen Grahn wrote:
> But at first it sounded as if the assignment focused on using
>     parallelism for fast PNG decoding.  It's unclear why just creating
>     a bitmapped image file in some simple format wouldn't be enough.


that is true and the reason is to see it on the screen.  I'd like to see
if I can fix some of the bugs in my png files as well since the standard
tools won't fix them.  But that is a personal thing.
0
ruben
10/13/2016 8:29:40 PM
Reply: