Files
ghostty/pkg/macos/graphics/image.zig
Mitchell Hashimoto eccd07f009 pkg: replace @cImport with addTranslateC in pkg/
@cImport is going to disappear in Zig 0.17. Its deprecated in Zig 0.16.
Let's remove it now.

Replace @cImport with addTranslateC across pkg/ packages. Each
package now has a c_import.h header that is translated at build
time via addTranslateC and exposed as a "cimport" module import.

Converted packages:
- dcimgui
- fontconfig
- freetype
- glslang
- harfbuzz
- macos
- oniguruma
- opengl
- sentry
- spirv-cross
- wuffs

Omitted:
- gtk4-layer-shell - This has a bit more complexity with how it
  interacts with GTK headers, so I need to consider this a bit more.
- src/ - It'll be cleaner to do this separately.
2026-04-16 21:35:51 -07:00

32 lines
1.1 KiB
Zig

const std = @import("std");
const assert = std.debug.assert;
const Allocator = std.mem.Allocator;
const graphics = @import("../graphics.zig");
const context = @import("context.zig");
const c = @import("c");
pub const ImageAlphaInfo = enum(c_uint) {
none = c.kCGImageAlphaNone,
premultiplied_last = c.kCGImageAlphaPremultipliedLast,
premultiplied_first = c.kCGImageAlphaPremultipliedFirst,
last = c.kCGImageAlphaLast,
first = c.kCGImageAlphaFirst,
none_skip_last = c.kCGImageAlphaNoneSkipLast,
none_skip_first = c.kCGImageAlphaNoneSkipFirst,
only = c.kCGImageAlphaOnly,
};
pub const BitmapInfo = enum(c_uint) {
alpha_mask = c.kCGBitmapAlphaInfoMask,
float_mask = c.kCGBitmapFloatInfoMask,
float_components = c.kCGBitmapFloatComponents,
byte_order_mask = c.kCGBitmapByteOrderMask,
byte_order_default = c.kCGBitmapByteOrderDefault,
byte_order_16_little = c.kCGBitmapByteOrder16Little,
byte_order_32_little = c.kCGBitmapByteOrder32Little,
byte_order_16_big = c.kCGBitmapByteOrder16Big,
byte_order_32_big = c.kCGBitmapByteOrder32Big,
_,
};