Gamestudio Links
Zorro Links
Newest Posts
How to select between IB accounts by script?
by AndrewAMD. 06/13/26 15:44
Zorro tutorial ideas?
by AndrewAMD. 06/13/26 15:01
Zorro 3.01 recoded MMI function issue
by 11honza11. 06/13/26 11:40
Max Number of Strategies in /Strategy folder
by Martin_HH. 06/12/26 08:50
Stooq now requires an API key
by AndrewAMD. 06/11/26 17:55
Z9 getting Error 058
by k_ivan. 06/10/26 14:38
ZorroGPT
by TipmyPip. 06/10/26 13:07
Z12 live performance
by alx. 06/09/26 20:42
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 1,919 guests, and 11 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Student_64151, Koti, curry, DeepxKalsi, Samed
19219 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