Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions AgentGuidelines/CHANGELOG.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion AgentGuidelines/Guidelines/Packages.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions AgentGuidelines/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 74 additions & 0 deletions AgentGuidelines/Scripts/validate_consumer_setup.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions AgentGuidelines/Scripts/validate_guidelines.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

136 changes: 136 additions & 0 deletions AgentGuidelines/Tests/run_tests.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion AgentGuidelines/VERSION

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

All notable changes to TextCaptureKit are documented here.

## Unreleased
## 0.1.0 - 2026-09-12

### Added

- Bootstrapped the Swift package, DocC catalog, CI/CD workflows, shared AgentGuidelines integration, and repository policy.
- Added configurable on-device Vision text recognition with structured candidates, confidence, and normalized bounds.
- Added deterministic plain-text projection and automatic encoded-image orientation handling.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

# TextCaptureKit

TextCaptureKit is a reusable, UI-agnostic wrapper around Apple's Vision text-recognition APIs. It will convert host-supplied still images into structured recognized text while preserving candidates, confidence, and layout for application-owned review and correction.
TextCaptureKit is a reusable, UI-agnostic wrapper around Apple's Vision text-recognition APIs. It converts host-supplied still images into structured recognized text while preserving encoded orientation, candidates, confidence, and layout for application-owned review and correction.

The package is currently a bootstrapped foundation. Camera capture, scanner UI, parsing, persistence, and product presentation remain host responsibilities.
Camera capture, scanner UI, parsing, persistence, and product presentation remain host responsibilities.

## Documentation

Expand Down
20 changes: 20 additions & 0 deletions Sources/TextCaptureKit/TextCaptureCandidate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import Foundation

/// One text candidate reported for a recognized region.
public struct TextCaptureCandidate: Sendable, Hashable {
/// The recognized text.
public let text: String

/// Vision's confidence in the candidate, expressed from zero through one.
public let confidence: Float

/// Creates a recognized-text candidate.
///
/// - Parameters:
/// - text: The recognized text.
/// - confidence: Vision's confidence in the candidate.
public init(text: String, confidence: Float) {
self.text = text
self.confidence = confidence
}
}
34 changes: 34 additions & 0 deletions Sources/TextCaptureKit/TextCaptureImage.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import Foundation

/// An encoded still image and its display orientation.
public struct TextCaptureImage: Sendable, Hashable {
/// The encoded image bytes.
public let data: Data

/// The orientation required to present the image upright.
public let orientation: TextCaptureImageOrientation

/// Creates a still-image input.
///
/// - Parameters:
/// - data: The encoded image bytes.
/// - orientation: The orientation required to present the image upright.
public init(data: Data, orientation: TextCaptureImageOrientation = .automatic) {
self.data = data
self.orientation = orientation
}
}

/// The orientation required to present an encoded still image upright.
public enum TextCaptureImageOrientation: Sendable, Hashable {
/// Reads the encoded image's orientation metadata, falling back to upright.
case automatic
case down
case downMirrored
case left
case leftMirrored
case right
case rightMirrored
case up
case upMirrored
}
Loading