forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Camra problem

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
UH



Joined: 01 May 2009
Posts: 5

PostPosted: Mon May 04, 2009 11:12 pm    Post subject: Camra problem Reply with quote

Is there any one how nows have to convert jpg buffter to pixel rbg buffer.

in other words get the date compilede over to raw data so that it can be show on the screne by runing the buffer...

ps i need to work with the data to be able to use it, so i need it to be blocks of [R][G][B] for itch pixel f.eks in one buffer eller 3buffer

Hope somone can help thanks
Back to top
View user's profile Send private message
LionX



Joined: 27 Dec 2004
Posts: 61

PostPosted: Tue May 05, 2009 5:06 am    Post subject: Reply with quote

use libjpg:
http://svn.ps2dev.org/listing.php?repname=ps2&path=%2Ftrunk%2Flibjpg%2Flibjpg%2F&rev=0&sc=0


I include a sample using libjpg called test0:
http://svn.ps2dev.org/listing.php?repname=ps2&path=%2Ftrunk%2Fps2sdk%2Fee%2Frpc%2Fcamera%2F&rev=0&sc=0


note: when you compile ps2sdk, this sample doesn't get copied to the /samples folder like other samples do.
Back to top
View user's profile Send private message
UH



Joined: 01 May 2009
Posts: 5

PostPosted: Tue May 05, 2009 11:12 pm    Post subject: Reply with quote

hey

thanks i have been looking at the libjpg, but i can not convert the jpg_buffer to the jpgData buffter that the libjpg are using.

the eksample only show have to send the data to the pc, as a jpeg, but i can not use the jpg data i need the raw data so that i can show it on the screen and there by usign the pixle value to make som image processing,.

when i am trying to convert the buffer the system of the playstation shutdown.

Hope you can help me a littel more thanks

ps. have got the test0 to work and it is nice work
Back to top
View user's profile Send private message
LionX



Joined: 27 Dec 2004
Posts: 61

PostPosted: Wed May 06, 2009 5:33 am    Post subject: Reply with quote

ok, after you compile libjpg and include it to you project, this is how you convert the jpeg image to rgb buffer:


the data in jpg_buffer is 100% a jpeg file.


to convet it to rgb:

after you extract the frame with:
ret = PS2CamExtractFrame(devid, jpg_buffer, 500512);


'ret' is the size of the file.

you con open the buffer like this
jpgData *jpg;

jpg = jpgOpenRAW( &jpg_buffer, ret);


then create your rgb buffer like this:
unsigned char my_rgb_buff[640*480*3];



then convert the jpeg to rgb like this:

jpgReadImage(jpg, &my_rgb_buff[0]);
Back to top
View user's profile Send private message
UH



Joined: 01 May 2009
Posts: 5

PostPosted: Wed May 06, 2009 7:11 pm    Post subject: thaky Reply with quote

Finaly, the solution thanks.... i have been working in that area but it didden work ontil now


thanky....
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group