Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Akow, degenerate_762), 1,430 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
reading a lfoating point bmap #447301
12/02/14 18:55
12/02/14 18:55
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline OP
Expert
Matt_Aufderheide  Offline OP
Expert
M

Joined: Oct 2003
Posts: 4,131
Can someone explain how to read float values from a floating point bmap using the finalbits pointer...?

Re: reading a lfoating point bmap [Re: Matt_Aufderheide] #447303
12/02/14 21:35
12/02/14 21:35
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
Code:
// RGBA, BGRA, ...
#define CHANNEL_COUNT 4
int x, y;

// Get the scanline (starts at finalbits and goes finalpitch bytes every line)
float *scanline = (float*)(((char*)bmp->finalbits) + y * bmp->finalpitch);
float channels[CHANNEL_COUNT];
for(i = 0; i < CHANNEL_COUNT; i++) {
    // Index each channel at x
    channels[i] = scanline[CHANNEL_COUNT * x + i]; // Offset in the scanline
}



Visit my site: www.masterq32.de
Re: reading a lfoating point bmap [Re: MasterQ32] #447304
12/02/14 22:27
12/02/14 22:27
Joined: Oct 2003
Posts: 4,131
M
Matt_Aufderheide Offline OP
Expert
Matt_Aufderheide  Offline OP
Expert
M

Joined: Oct 2003
Posts: 4,131
ok it works--thank you!

Re: reading a lfoating point bmap [Re: Matt_Aufderheide] #447305
12/02/14 23:45
12/02/14 23:45
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
you're welcome!


Visit my site: www.masterq32.de

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1