Help us shape the future of Go! Take the 2026 Go Developer Survey

seal

package
v0.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package seal 计算印章裁剪框与源图像素区域,不加载印章或执行绘制。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClipBox

func ClipBox(boundary, clip models.StBox) (models.StBox, bool)

ClipBox 将 StampAnnot.Clip 夹入 Boundary 并返回页面上的目标框。 Boundary 与 Clip 分别对应 GB/T 33190—2016 §18.2.3 表69 的定位与裁剪属性。 Clip 相对印章左上角;缺省、零尺寸或完全位于盒外时返回 false,沿用整枚印章。

func CropRect

func CropRect(bounds image.Rectangle, boundary, dst models.StBox) (image.Rectangle, bool)

CropRect 按目标框相对 Boundary 的比例计算源图裁剪区域,保留原图非零原点。 坐标按最近像素取整并夹回原图。无有效区域或覆盖整图时返回 false,复用原图。

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL