Camra problem

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
UH
Posts: 5
Joined: Fri May 01, 2009 6:50 pm

Camra problem

Post by UH »

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] for itch pixel f.eks in one buffer eller 3buffer

Hope somone can help thanks
LionX
Posts: 61
Joined: Mon Dec 27, 2004 11:40 am

Post by LionX »

use libjpg:
http://svn.ps2dev.org/listing.php?repna ... rev=0&sc=0


I include a sample using libjpg called test0:
http://svn.ps2dev.org/listing.php?repna ... rev=0&sc=0


note: when you compile ps2sdk, this sample doesn't get copied to the /samples folder like other samples do.
UH
Posts: 5
Joined: Fri May 01, 2009 6:50 pm

Post by UH »

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
LionX
Posts: 61
Joined: Mon Dec 27, 2004 11:40 am

Post by LionX »

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]);
UH
Posts: 5
Joined: Fri May 01, 2009 6:50 pm

thaky

Post by UH »

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


thanky....
Post Reply