1.4 KiB
1.4 KiB
Feature: Core UI and Camera Feed (PyObjC)
Status: COMPLETE
Description
Create the main application window using PyObjC (AppKit) and display a live camera feed. This ensures a native macOS look and feel.
Requirements
-
App & Window Setup (AppKit):
- Initialize
NSApplication. - Create a main
NSWindowtitled "ItemSense". - Size: 800x600 (resizable).
- Window should center on screen.
- Initialize
-
UI Layout:
- Use
NSStackView(vertical) or manual constraints to layout:- Top: Video Feed (
NSImageView). - Bottom: "Capture" button (
NSButton).
- Top: Video Feed (
- Use
-
Camera Feed:
- Use
opencv-pythonto capture frames from webcam (index 0). - Convert frames (
cv2BGR -> RGB) toNSImage/CGImage. - Update the
NSImageViewat ~30 FPS using a timer (NSTimeror equivalent app loop integration).
- Use
-
Capture Button:
- Standard macOS Push Button.
- Label: "Capture".
- Action: Print "Capture clicked" to console.
-
Lifecycle:
- Ensure
Cmd+Qworks. - Ensure closing the window terminates the app (or at least the
applicationShouldTerminateAfterLastWindowClosed:delegate method returns True).
- Ensure
Acceptance Criteria
- App launches with a native macOS window "ItemSense".
- Live camera feed is visible in the view.
- "Capture" button is visible at the bottom.
- Clicking "Capture" prints to console.
- App exits cleanly on window close or Cmd+Q.