Blitz FreeImage Library

BlitzPlus Forums/BlitzPlus Beginners Area/Blitz FreeImage Library

I'm trying to use Snarty's Blitz FreeImage Library to load some gif images into my application.

It works well, but I was looking at his code and I'm a little confused. This may be because I'm extremely new to image encoding.

Global FIB_RedMask[4], FIB_GreenMask[4], FIB_BlueMask[4], FIB_BitDepth[4]

FIB_BitDepth[1] = 16
FIB_RedMask[1] = $1F
FIB_GreenMask[1] = $7E0
FIB_BlueMask[1] = $F800

FIB_BitDepth[2] = 16
FIB_RedMask[2] = $1F
FIB_GreenMask[2] = $3E0
FIB_BlueMask[2] = $7C00

FIB_BitDepth[3] = 24
FIB_RedMask[3] = $FF0000
FIB_GreenMask[3] = $FF00
FIB_BlueMask[3] = $FF

FIB_BitDepth[4] = 32
FIB_RedMask[4] = $FF0000
FIB_GreenMask[4] = $FF00
FIB_BlueMask[4] = $FF

In the code block above, how are the constant values for RedMask, GreenMask, and BlueMask determined?

And what is the significance of the "$" sign in front of the constant?

Many Thanks.

- Nick