Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - complement to PxLoadImage() ?: (13 Items)
   
complement to PxLoadImage() ?  
Hi 2 all,

for planning some piece of code i am searching for functions to read and write graphics files (jpg and png are needed). 
I found PxLoadImage(), but no complement like SaveImage() ... does anyone know if such a function exists?

Thanx for hints!

Greetings from germany!

Frank
RE: complement to PxLoadImage() ?  
Hi Frank,
 
Do you want these routines for Photon of Advanced Graphics?  PxLoadImage() is for Photon.  For Advanced Graphics, there 
are the img_xxxxx() calls.
 
Regards,
-Derek

________________________________

From: Frank Maier [mailto:community-noreply@qnx.com]
Sent: Wed 22/04/2009 8:42 AM
To: advanced-graphics
Subject: complement to PxLoadImage() ?



Hi 2 all,

for planning some piece of code i am searching for functions to read and write graphics files (jpg and png are needed). 
I found PxLoadImage(), but no complement like SaveImage() ... does anyone know if such a function exists?

Thanx for hints!

Greetings from germany!

Frank

_______________________________________________
Advanced Graphics
http://community.qnx.com/sf/go/post27715



Attachment: Text winmail.dat 3.66 KB
Re: RE: complement to PxLoadImage() ?  
Hi Derek,

thx for fast reaction! ...

I am a beginner, i have no experience with QNX. As i described i am searching for informations about the possibilities 
for loading and writing graphic files.

Can you tell we what is the difference between Photon library and other libraries? I did not found this explanation here
 on the QNX websites ...

All beginning is difficult ... eh? So i will try to find the description of the img_xxxx() functionsyou mentioned ... :-
<

Thx for answering my stupid questions ... ;-))

Frank
RE: RE: complement to PxLoadImage() ?  
Hi Frank,
 
No worries.  First go to the Wiki page for the Graphics Project, that will give you an overview of all the technologies.
  It is here:
 
http://community.qnx.com/sf/wiki/do/viewPage/projects.graphics/wiki/HomePage
 
Photon is a microGUI Windowing system, with widgets and windows.
 
Advanced Graphics is a hardware abstraction API (actually, Photon is built on top of this in QNX SDP 6.4.0 or newer).  
With Advanced Graphics, it has some image API, and instrinsics (like rectangle, line, pixel, etc).
 
The go to the documentation, there are docs for Advanced Graphics and Photon.
 
Kind Regards,
-Derek

________________________________

From: Frank Maier [mailto:community-noreply@qnx.com]
Sent: Wed 22/04/2009 9:01 AM
To: advanced-graphics
Subject: Re: RE: complement to PxLoadImage() ?



Hi Derek,

thx for fast reaction! ...

I am a beginner, i have no experience with QNX. As i described i am searching for informations about the possibilities 
for loading and writing graphic files.

Can you tell we what is the difference between Photon library and other libraries? I did not found this explanation here
 on the QNX websites ...

All beginning is difficult ... eh? So i will try to find the description of the img_xxxx() functionsyou mentioned ... :-
<

Thx for answering my stupid questions ... ;-))

Frank

_______________________________________________
Advanced Graphics
http://community.qnx.com/sf/go/post27720



Attachment: Text winmail.dat 4.72 KB
Re: RE: RE: complement to PxLoadImage() ?  
Hi, Derek,

thx for your explanation ... after reading the important documentation now i feel much better ... ;-)

I found the img_load_file() and img_write_file() ... thats what i needed because i dont need the photon gui overhead.

But i also need font rendering and OpenGL function. So i find the themes "Font Fusion Library" and "Open GL ES" in the "
Advanced Graphics Developer's Guide" ... but no API documentation.
Can you give me a hint where i have to search for this documention? Must i search external because this is 3rd-party-
software?

Thx for your patience!

Frank

RE: RE: RE: complement to PxLoadImage() ?  
Hi Frank,
 
You can get the OpenGL ES 1.0 documentation from www.khronos.org
 
With respect to QNX SDP 6.4.0 or newer, Photon does not have much of "overhead" increase versus raw Advanced Graphics, 
some there is no overhead increase, all depends on the code flow.  That being said, if you are doing something "
intrinsic wise", then Advanced Graphics will work fine for you.
 
For the fonts ... this is kind of tricky, how indepth do you want to get? :)
 
Font Fusion is powerful (the docs are included in the QNX SDP 6.4.1 distro - notice the .1), otherwise I need to email 
them to you.  The thing is, from a "user API" point of view, it is rather raw.
 
Another option is to run the Photon font server (does not require the other servers running), and link your application 
against libfont.so .  You can then use the Pf*Cx() calls, utilizing PfRenderCx() to obtain the resultant bitmaps.
 
If you want the Font Fusion documentation, please let me know.
 
-Derek

________________________________

From: Frank Maier [mailto:community-noreply@qnx.com]
Sent: Wed 22/04/2009 9:55 AM
To: advanced-graphics
Subject: Re: RE: RE: complement to PxLoadImage() ?



Hi, Derek,

thx for your explanation ... after reading the important documentation now i feel much better ... ;-)

I found the img_load_file() and img_write_file() ... thats what i needed because i dont need the photon gui overhead.

But i also need font rendering and OpenGL function. So i find the themes "Font Fusion Library" and "Open GL ES" in the "
Advanced Graphics Developer's Guide" ... but no API documentation.
Can you give me a hint where i have to search for this documention? Must i search external because this is 3rd-party-
software?

Thx for your patience!

Frank



_______________________________________________
Advanced Graphics
http://community.qnx.com/sf/go/post27735



Attachment: Text winmail.dat 4.91 KB
Re: RE: RE: RE: complement to PxLoadImage() ?  
Hi Derek,

i need font functions like RenderCharacter(), GetAscender(), GetDescender(), GetHeight(), GetKerning() and only a few 
more ... no special things i think ... ;-)

The option with using the photon function you explained will be enough if there are no more alternatives ... but because
 the photon library does not support kerning the font fusion library may be the better choice ... supports Font Fusion 
kerning?

But send me the docu of Font Fusion at all ... thx: f338@gmx.de

Because in our project at another place Freetype2 is used and i have read in the docu of Freetype2 that it runs 
perfectly also on embedded systems i think it must be possible without great effort to port Freetype2 to QNX ... it is 
pure ANSI C. What do you say to that possibility?

Frank
RE: RE: RE: RE: complement to PxLoadImage() ?  
Hi Frank,
 
I will send the manual shortly to the address you provided.
 
Regarding FreeType2, yes, it will certainly port and work on QNX Neutrino, no worries there.
 
Kind Regards,
-Derek

________________________________

From: Frank Maier [mailto:community-noreply@qnx.com]
Sent: Wed 22/04/2009 10:21 AM
To: advanced-graphics
Subject: Re: RE: RE: RE: complement to PxLoadImage() ?



Hi Derek,

i need font functions like RenderCharacter(), GetAscender(), GetDescender(), GetHeight(), GetKerning() and only a few 
more ... no special things i think ... ;-)

The option with using the photon function you explained will be enough if there are no more alternatives ... but because
 the photon library does not support kerning the font fusion library may be the better choice ... supports Font Fusion 
kerning?

But send me the docu of Font Fusion at all ... thx: f338@gmx.de

Because in our project at another place Freetype2 is used and i have read in the docu of Freetype2 that it runs 
perfectly also on embedded systems i think it must be possible without great effort to port Freetype2 to QNX ... it is 
pure ANSI C. What do you say to that possibility?

Frank


_______________________________________________
Advanced Graphics
http://community.qnx.com/sf/go/post27742



Attachment: Text winmail.dat 4.26 KB
Re: RE: RE: RE: RE: complement to PxLoadImage() ?  
Hi, Derek,

thx for sending the Font Fusion docu!

May i disturb you to ask another question ... ?

img_load_file() loads the complete file from the filesystem ... but i need also a function to extract a region of the 
image ... for example whenn the JPG file has the size of 200x200 i will extrct a 100x50 pixel block at the offset (x,y) 
= (20,20) ... in the img-Library there is no function. Do you know a portable library which allows this function? Or do 
you know another way to get this aim?

Thanx for help!

Frank
RE: RE: RE: RE: RE: complement to PxLoadImage() ?  
Hi Frank,
 
Yes, there is a new function in 641 called img_crop() ... 641 will be released "shortly" though ...
 
-Derek

________________________________

From: Frank Maier [mailto:community-noreply@qnx.com]
Sent: Thu 23/04/2009 8:56 AM
To: advanced-graphics
Subject: Re: RE: RE: RE: RE: complement to PxLoadImage() ?



Hi, Derek,

thx for sending the Font Fusion docu!

May i disturb you to ask another question ... ?

img_load_file() loads the complete file from the filesystem ... but i need also a function to extract a region of the 
image ... for example whenn the JPG file has the size of 200x200 i will extrct a 100x50 pixel block at the offset (x,y) 
= (20,20) ... in the img-Library there is no function. Do you know a portable library which allows this function? Or do 
you know another way to get this aim?

Thanx for help!

Frank

_______________________________________________
Advanced Graphics
http://community.qnx.com/sf/go/post27865



Attachment: Text winmail.dat 3.91 KB
Re: RE: RE: RE: RE: RE: complement to PxLoadImage() ?  
And now the 1 Million dollar question: What's the general meaning of "shortly" ? (especially in this context)

A ~ 1 day
B ~ 1 week
C ~ 1 month
D ~ 1 year
E ~ 1 aeon

What's your answer, Derek? ... ;-))

RE: RE: RE: RE: RE: RE: complement to PxLoadImage() ?  
If I only knew ;) but I'm not part of product management, so you'll have to wait, though the prototype for the routine 
is below, if you want to "stub it out" for now ...
 
-Derek
 
/*!
 * Crop an image. This function will crop a source image at source co-ordinates
 * x,y to the dimensions specified by the destination image.
 *
 * \param src Address of source ::img_t structure to crop.
 * \param dst Address of destination ::img_t structure, which requires the
 * width (IMG_W) and height (IMG_H) to be specified at a minimum.
 * \param x Horizontal co-ordinate in source image to begin crop operation.
 * \param y Vertical co-ordinate in source image to begin crop operation.
 *
 * \returns Status of the operation.
 * \retval IMG_ERR_OK Success
 * \retval IMG_ERR_PARM source image width, height, and/or format not set.
 * destination image width, and/or height not set.
 * destination image larger than source image.
 * crop co-ordinates plus size of destination image exceed source image bounds.
 * \retval IMG_ERR_MEM Memory allocation failure
 * \retval IMG_ERR_NOSUPPORT Destination image format not supported.
 */
int
img_crop(const img_t *src, img_t *dst, const unsigned x, const unsigned y)
 

________________________________

From: Frank Maier [mailto:community-noreply@qnx.com]
Sent: Thu 23/04/2009 9:26 AM
To: advanced-graphics
Subject: Re: RE: RE: RE: RE: RE: complement to PxLoadImage() ?



And now the 1 Million dollar question: What's the general meaning of "shortly" ? (especially in this context)

A ~ 1 day
B ~ 1 week
C ~ 1 month
D ~ 1 year
E ~ 1 aeon

What's your answer, Derek? ... ;-))



_______________________________________________
Advanced Graphics
http://community.qnx.com/sf/go/post27873



Attachment: Text winmail.dat 4.58 KB
RE: complement to PxLoadImage() ?  
For Photon image writing, there is an undocumented function:
 
int PxWriteImage( char const *filename, PhImage_t const *image, PxMethods_t const *methods, int iformat, int itype )
 
 
Maybe it is about time we documented it, but that is beside the point.  Basically, you need to use the first two 
parameters:
 
e.g.
 
PxWriteImage( "/tmp/outimage.jpg", &my_image, NULL, 0, 0 );
 
it returns 0 on success, 1 on failure.  You can change the type of image by changing the extension of outimage.xxx .  
NOTE:  writing of GIF images in not supported.
 
-Derek
 

________________________________

From: Frank Maier [mailto:community-noreply@qnx.com]
Sent: Wed 22/04/2009 8:42 AM
To: advanced-graphics
Subject: complement to PxLoadImage() ?



Hi 2 all,

for planning some piece of code i am searching for functions to read and write graphics files (jpg and png are needed). 
I found PxLoadImage(), but no complement like SaveImage() ... does anyone know if such a function exists?

Thanx for hints!

Greetings from germany!

Frank

_______________________________________________
Advanced Graphics
http://community.qnx.com/sf/go/post27715



Attachment: Text winmail.dat 4.53 KB