Documentation
¶
Index ¶
- func EmbeddedTextVersion() string
- func FindMuTool() string
- func NormalizePageSelection(value string) (string, error)
- func RelativeArtifactPath(root string, path string) string
- func WriteManifest(path string, command string, result Result, dpi int) error
- type Manifest
- type Options
- type PageImage
- type PageSelection
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmbeddedTextVersion ¶
func EmbeddedTextVersion() string
func FindMuTool ¶
func FindMuTool() string
func NormalizePageSelection ¶
NormalizePageSelection validates a selection and returns its canonical form.
func RelativeArtifactPath ¶
RelativeArtifactPath keeps persisted artifact references valid after the complete output directory is moved to another machine.
Types ¶
type Manifest ¶
type Manifest struct {
Version string `json:"version"`
Command string `json:"command"`
Input detect.Input `json:"input"`
Render struct {
DPI int `json:"dpi"`
PageCount int `json:"page_count"`
SourcePageCount int `json:"source_page_count,omitempty"`
PageSelection string `json:"page_selection,omitempty"`
ImageFormat string `json:"image_format"`
OutputDir string `json:"output_dir"`
} `json:"render"`
Pages []PageImage `json:"pages"`
StartedAt time.Time `json:"started_at"`
FinishedAt time.Time `json:"finished_at"`
}
type PageImage ¶
type PageImage struct {
Page int `json:"page"`
SourcePath string `json:"source_path"`
ImagePath string `json:"image_path"`
Width int `json:"width"`
Height int `json:"height"`
SHA256 string `json:"sha256"`
EmbeddedTextSHA256 string `json:"embedded_text_sha256,omitempty"`
EmbeddedTextChars int `json:"embedded_text_chars,omitempty"`
EmbeddedTextTruncated bool `json:"embedded_text_truncated,omitempty"`
EmbeddedTextSupported bool `json:"embedded_text_supported,omitempty"`
EmbeddedTextChecked bool `json:"embedded_text_checked,omitempty"`
EmbeddedText string `json:"-"`
}
type PageSelection ¶
type PageSelection struct {
// contains filtered or unexported fields
}
PageSelection describes the 1-based pages that should be sent to the model. An empty selection means every rendered page.
func ParsePageSelection ¶
func ParsePageSelection(value string) (PageSelection, error)
ParsePageSelection parses expressions such as "1,3-5,9". Page numbers are 1-based and intervals are inclusive.
func (PageSelection) Pages ¶
func (selection PageSelection) Pages(sourcePageCount int) ([]int, error)
Pages expands a non-empty selection against a known source page count.
func (PageSelection) String ¶
func (selection PageSelection) String() string
type Result ¶
type Result struct {
Input detect.Input `json:"input"`
Pages []PageImage `json:"pages"`
SourcePageCount int `json:"source_page_count"`
PageSelection string `json:"page_selection,omitempty"`
OutputDir string `json:"output_dir"`
StartedAt time.Time `json:"started_at"`
FinishedAt time.Time `json:"finished_at"`
}
Click to show internal directories.
Click to hide internal directories.