Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 08/29/26 06:56
Retrieve optimize() variables order (edited)
by NorbertSz. 08/25/26 13:24
Max Number of Strategies in /Strategy folder
by Martin_HH. 08/17/26 07:54
Pause button for evaluation shell?
by AndrewAMD. 08/13/26 17:16
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 08/10/26 12:46
phantom() not defined in indicators.c
by jcl. 08/07/26 11:45
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (TipmyPip, AndrewAMD), 7,332 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Student_64151, Koti
19230 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 | 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