Gamestudio Links
Zorro Links
Newest Posts
SGT_FW
by Aku_Aku. 11/30/26 08:19
Removing outliers from files
by JeyKey II. 11/29/26 10:01
Experiences with cTrader
by JeyKey II. 11/27/26 09:04
make a complaint
by EW_bytes. 11/26/26 23:00
FXCM => AVA Trade Plugin???
by Martin_HH. 11/25/26 21:59
No connection to MT4
by Martin_HH. 11/23/26 06:38
MinMax function on History t6 file
by LucasJoshua. 11/21/26 14:28
What are you working on?
by rayp. 11/20/26 18:10
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (JeyKey II, Martin_HH, Aku_Aku), 12,175 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 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