Browse Source

bitmap v5 header

https://learn.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-bitmapv5header
Thomas la Cour 1 year ago
parent
commit
8412352e5a
1 changed files with 45 additions and 0 deletions
  1. 45 0
      core/sys/windows/gdi32.odin

+ 45 - 0
core/sys/windows/gdi32.odin

@@ -1,6 +1,8 @@
 // +build windows
 package sys_windows
 
+import "core:math/fixed"
+
 foreign import gdi32 "system:Gdi32.lib"
 
 @(default_calling_convention="system")
@@ -11,6 +13,7 @@ foreign gdi32 {
 	SetBkColor :: proc(hdc: HDC, color: COLORREF) -> COLORREF ---
 
 	CreateCompatibleDC :: proc(hdc: HDC) -> HDC ---
+	DeleteDC :: proc(hdc: HDC) -> BOOL ---
 
 	CreateDIBPatternBrush :: proc(h: HGLOBAL, iUsage: UINT) -> HBRUSH ---
 
@@ -93,3 +96,45 @@ foreign gdi32 {
 RGB :: #force_inline proc "contextless" (r, g, b: u8) -> COLORREF {
 	return transmute(COLORREF)[4]u8{r, g, b, 0}
 }
+
+FXPT2DOT30 :: distinct fixed.Fixed(i32, 30)
+
+CIEXYZ :: struct {
+	ciexyzX: FXPT2DOT30,
+	ciexyzY: FXPT2DOT30,
+	ciexyzZ: FXPT2DOT30,
+}
+
+CIEXYZTRIPLE :: struct {
+	ciexyzRed:   CIEXYZ,
+	ciexyzGreen: CIEXYZ,
+	ciexyzBlue:  CIEXYZ,
+}
+
+// https://learn.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-bitmapv5header
+BITMAPV5HEADER :: struct {
+	bV5Size:          DWORD,
+	bV5Width:         LONG,
+	bV5Height:        LONG,
+	bV5Planes:        WORD,
+	bV5BitCount:      WORD,
+	bV5Compression:   DWORD,
+	bV5SizeImage:     DWORD,
+	bV5XPelsPerMeter: LONG,
+	bV5YPelsPerMeter: LONG,
+	bV5ClrUsed:       DWORD,
+	bV5ClrImportant:  DWORD,
+	bV5RedMask:       DWORD,
+	bV5GreenMask:     DWORD,
+	bV5BlueMask:      DWORD,
+	bV5AlphaMask:     DWORD,
+	bV5CSType:        DWORD,
+	bV5Endpoints:     CIEXYZTRIPLE,
+	bV5GammaRed:      DWORD,
+	bV5GammaGreen:    DWORD,
+	bV5GammaBlue:     DWORD,
+	bV5Intent:        DWORD,
+	bV5ProfileData:   DWORD,
+	bV5ProfileSize:   DWORD,
+	bV5Reserved:      DWORD,
+}