-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
- Loading branch information
Showing
8 changed files
with
98 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,103 +1,35 @@ | ||
// const ca = @import("quartz_core.zig"); | ||
// const cf = @import("core_foundation.zig"); | ||
// const pid_t = @import("std").os.posix.pid_t; | ||
// const size_t = usize; | ||
// const ns = @import("foundation.zig"); | ||
// const cg = @import("core_graphics.zig"); | ||
// const objc = @import("objc.zig"); | ||
const cv = @import("core_video.zig"); | ||
|
||
// ------------------------------------------------------------------------------------------------ | ||
// Types | ||
|
||
pub const TimeValue = i64; | ||
pub const TimeScale = i32; | ||
pub const TimeEpoch = u32; | ||
pub const CMClockRef = *opaque {}; | ||
|
||
pub const CVPixelBufferRef = *CVPixelBuffer; | ||
pub const CVPixelBuffer = opaque { | ||
extern fn CVPixelBufferGetBaseAddress(CVPixelBufferRef) ?*anyopaque; | ||
pub inline fn getBaseAddress(pxl: CVPixelBufferRef) ?*anyopaque { | ||
return CVPixelBufferGetBaseAddress(pxl); | ||
} | ||
|
||
extern fn CVPixelBufferGetBaseAddressOfPlane(CVPixelBufferRef) ?*anyopaque; | ||
pub inline fn getBaseAddressOfPlane(pxl: CVPixelBufferRef) ?*anyopaque { | ||
return CVPixelBufferGetBaseAddressOfPlane(pxl); | ||
} | ||
}; | ||
|
||
pub const CVImageBufferRef = *CVImageBuffer; | ||
pub const CVImageBuffer = opaque {}; | ||
pub const BlockBufferRef = *BlockBuffer; | ||
pub const BlockBuffer = opaque {}; | ||
|
||
pub const CMBlockBufferRef = *CMBlockBuffer; | ||
pub const CMBlockBuffer = opaque {}; | ||
|
||
pub const CMSampleBufferRef = *CMSampleBuffer; | ||
pub const CMSampleBuffer = opaque { | ||
extern fn CMSampleBufferGetDataBuffer(CMSampleBufferRef) callconv(.C) ?CMBlockBufferRef; | ||
pub inline fn getDataBuffer(sbuf: *CMSampleBuffer) ?CMBlockBufferRef { | ||
pub const SampleBufferRef = *SampleBuffer; | ||
pub const SampleBuffer = opaque { | ||
extern fn CMSampleBufferGetDataBuffer(SampleBufferRef) callconv(.C) ?BlockBufferRef; | ||
pub inline fn getDataBuffer(sbuf: *SampleBuffer) ?BlockBufferRef { | ||
return CMSampleBufferGetDataBuffer(sbuf); | ||
} | ||
|
||
extern fn CMSampleBufferGetImageBuffer(CMSampleBufferRef) callconv(.C) ?CVImageBufferRef; | ||
pub inline fn getImageBuffer(sbuf: *CMSampleBuffer) ?CVImageBufferRef { | ||
extern fn CMSampleBufferGetImageBuffer(SampleBufferRef) callconv(.C) ?cv.ImageBufferRef; | ||
pub inline fn getImageBuffer(sbuf: *SampleBuffer) ?cv.ImageBufferRef { | ||
return CMSampleBufferGetImageBuffer(sbuf); | ||
} | ||
}; | ||
|
||
pub const Time = extern struct { | ||
value: TimeValue, | ||
timescale: TimeScale, | ||
// TODO: need to figure out why the generator doesn't remove "CM" prefix here. | ||
flags: CMTimeFlags, | ||
epoch: TimeEpoch, | ||
}; | ||
|
||
pub const ClockRef = extern struct {}; | ||
|
||
// pub const applicationMain = NSApplicationMain; | ||
// extern fn NSApplicationMain(argc: c_int, argv: [*]*c_char) c_int; | ||
|
||
// // ------------------------------------------------------------------------------------------------ | ||
// // Shared | ||
|
||
// pub const ErrorDomain = ns.ErrorDomain; | ||
// pub const ErrorUserInfoKey = ns.ErrorUserInfoKey; | ||
// pub const Integer = ns.Integer; | ||
// pub const NotificationName = ns.NotificationName; | ||
// pub const TimeInterval = ns.TimeInterval; | ||
// pub const UInteger = ns.UInteger; | ||
// pub const unichar = ns.unichar; | ||
// pub const Range = ns.Range; | ||
// pub const StringEncoding = ns.StringEncoding; | ||
// pub const StringTransform = ns.StringTransform; | ||
// pub const StringEncodingDetectionOptionsKey = ns.StringEncodingDetectionOptionsKey; | ||
// pub const Array = ns.Array; | ||
// pub const String = ns.String; | ||
|
||
// // ------------------------------------------------------------------------------------------------ | ||
// // Types | ||
|
||
// pub const ModalResponse = *String; | ||
// pub const PasteboardType = *String; | ||
// pub const AboutPanelOptionKey = *String; | ||
// pub const ModalSession = *opaque {}; | ||
// pub const PrintInfoAttributeKey = *String; | ||
// pub const Rect = cg.Rect; | ||
// pub const Point = cg.Point; | ||
// pub const Size = cg.Size; | ||
// pub const RunLoopMode = *String; | ||
// pub const PrinterPaperName = *String; | ||
// pub const PrintJobDispositionValue = *String; | ||
// pub const InterfaceStyle = UInteger; | ||
// pub const TouchBarItemIdentifier = *String; | ||
// pub const TouchBarCustomizationIdentifier = *String; | ||
// pub const TouchBarItemPriority = f32; | ||
// pub const DeviceDescriptionKey = *String; | ||
// pub const PrinterTypeName = *String; | ||
// pub const PrintInfoSettingKey = *String; | ||
// pub const AccessibilityActionName = *String; | ||
// pub const AccessibilityAttributeName = *String; | ||
// pub const ExceptionName = *String; | ||
// pub const ImageName = *String; | ||
// pub const NibName = *String; | ||
// pub const WindowFrameAutosaveName = *String; | ||
// pub const AccessibilityParameterizedAttributeName = *String; | ||
// pub const UserInterfaceItemIdentifier = *String; | ||
pub const ClockRef = *OpaqueCMClock; | ||
pub const OpaqueCMClock = extern struct {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// ------------------------------------------------------------------------------------------------ | ||
// Types | ||
|
||
pub const PixelBufferRef = *PixelBuffer; | ||
pub const PixelBuffer = opaque { | ||
extern fn CVPixelBufferGetBaseAddress(PixelBufferRef) ?*anyopaque; | ||
pub inline fn getBaseAddress(pxl: PixelBufferRef) ?*anyopaque { | ||
return CVPixelBufferGetBaseAddress(pxl); | ||
} | ||
|
||
extern fn CVPixelBufferGetBaseAddressOfPlane(PixelBufferRef) ?*anyopaque; | ||
pub inline fn getBaseAddressOfPlane(pxl: PixelBufferRef) ?*anyopaque { | ||
return CVPixelBufferGetBaseAddressOfPlane(pxl); | ||
} | ||
}; | ||
|
||
pub const ImageBufferRef = *ImageBuffer; | ||
pub const ImageBuffer = opaque {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// ------------------------------------------------------------------------------------------------ | ||
// Types | ||
|
||
pub const PixelBufferRef = *PixelBuffer; | ||
pub const PixelBuffer = opaque { | ||
extern fn CVPixelBufferGetBaseAddress(PixelBufferRef) ?*anyopaque; | ||
pub inline fn getBaseAddress(pxl: PixelBufferRef) ?*anyopaque { | ||
return CVPixelBufferGetBaseAddress(pxl); | ||
} | ||
|
||
extern fn CVPixelBufferGetBaseAddressOfPlane(PixelBufferRef) ?*anyopaque; | ||
pub inline fn getBaseAddressOfPlane(pxl: PixelBufferRef) ?*anyopaque { | ||
return CVPixelBufferGetBaseAddressOfPlane(pxl); | ||
} | ||
}; | ||
|
||
pub const ImageBufferRef = *ImageBuffer; | ||
pub const ImageBuffer = opaque {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters