Files
Odin/core/sys/darwin/Foundation/NSBitmapImageRep.odin
T
Steve Waddicor 9c5e577792 Additional obj-c methods for darwin Foundation
Added support for NSBitmapImageRep class.
Added ability to set contents to a CALayer.
I needed these to support a port of Handmade Hero, but they are of general use.
2025-07-29 21:01:22 +01:00

51 lines
1.6 KiB
Odin

package objc_Foundation
import "base:intrinsics"
@(objc_class="NSBitmapImageRep")
BitmapImageRep :: struct { using _: Object }
@(objc_type=BitmapImageRep, objc_name="alloc", objc_is_class_method=true)
BitmapImageRep_alloc :: proc "c" () -> ^BitmapImageRep {
return msgSend(^BitmapImageRep, BitmapImageRep, "alloc")
}
@(objc_type=BitmapImageRep, objc_name="initWithBitmapDataPlanes")
BitmapImageRep_initWithBitmapDataPlanes :: proc "c" (
self: ^BitmapImageRep,
bitmapDataPlanes: ^^u8,
pixelsWide: Integer,
pixelsHigh: Integer,
bitsPerSample: Integer,
samplesPerPixel: Integer,
hasAlpha: bool,
isPlanar: bool,
colorSpaceName: ^String,
bytesPerRow: Integer,
bitsPerPixel: Integer) -> ^BitmapImageRep {
return msgSend(^BitmapImageRep,
self,
"initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bytesPerRow:bitsPerPixel:",
bitmapDataPlanes,
pixelsWide,
pixelsHigh,
bitsPerSample,
samplesPerPixel,
hasAlpha,
isPlanar,
colorSpaceName,
bytesPerRow,
bitsPerPixel)
}
@(objc_type=BitmapImageRep, objc_name="bitmapData")
BitmapImageRep_bitmapData :: proc "c" (self: ^BitmapImageRep) -> rawptr {
return msgSend(rawptr, self, "bitmapData")
}
@(objc_type=BitmapImageRep, objc_name="CGImage")
BitmapImageRep_CGImage :: proc "c" (self: ^BitmapImageRep) -> rawptr {
return msgSend(rawptr, self, "CGImage")
}