CUDA and 24bgr images =(

Moderator: BarsMonster

Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Inco
Posts: 3
Joined: Fri Feb 06, 2009 9:49 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

CUDA and 24bgr images =(

Post by Inco » Mon Feb 23, 2009 8:48 pm

Hi everyone! =) (sorry for english )
I got a question:
I want to use the video card to speed up the code for image processing.
But the problem is that: both CUDA and AMDStream minimum can handle only int type (32 bits), but i have the image 24bgr =(
How can I map(convert) 24bgt image quickly to proccess them on video card? or how to handle?

Now i use next sample code:

int* gpu_data ...
byte* image = ...
for (int i = 0; i < imageSize; i++)
{
gpu_data = image;
}

and then i map gpu_data on int3 array, that each position in the matrix was the color-point? ... but one thing is already converting spend a lot of time =(((
What can i do?

User avatar
BarsMonster
Site Admin
Posts: 1118
Joined: Wed Oct 01, 2008 7:58 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: CUDA and 24bgr images =(

Post by BarsMonster » Tue Feb 24, 2009 12:03 pm

You may use 32-bit image (last 8 bit's ignored), and extract 3 values (r,g,b) on-the-fly:

Code: Select all

//Something like that
r = (pixel[i]>>16) & 255;
g = (pixel[i]>>8) & 255;
b = (pixel[i]>>0) & 255;

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Who is online

Users browsing this forum: No registered users and 1 guest