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

composite

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: 4 Imported by: 0

Documentation

Overview

Package composite 计算复合图元的兼容内容范围、保守墨迹边界与重采样计划。 本包不加载资源或执行绘制,输入模型及共享路径均视为只读。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContentExtent

func ContentExtent(object models.CompositeObject) (float64, float64, bool)

ContentExtent 由 Boundary 与轴向 CTM 反推内容范围;旋转或错切时不做反推。 GB/T 33190—2016 §13 表50 定义单元宽高;此函数用于兼容声明尺寸与实际 对象范围不符的文档,不改变模型中的声明尺寸。

func ExtentMismatch

func ExtentMismatch(declared, extent float64) bool

ExtentMismatch 判断声明尺寸与反推范围的相对误差是否超过既有兼容阈值。

func InkRect

func InkRect(unit *models.CompositeGraphicUnit, w, h float64) (models.StBox, bool)

InkRect 保守估算单元内容的画布边界(毫米,Y 向上),并预留字形与取整边距。 描边、旋转、图片及嵌套内容无法可靠随画布平移时,返回 false 以沿用完整画布。 路径使用实际轮廓,文字使用 Boundary;结果只用于优化,空白重画回退由调用方处理。

func Resample

func Resample(ink geom.Rect, w, h, dpi float64, box models.StBox, outDPI float64) (geom.Rect, float64, bool)

Resample 根据首遍图像的墨迹像素边界计算重画画布(毫米,Y 向上)和 DPI。 仅当内容面积足够小且分辨率至少提升两成时返回计划,最高 1200 DPI。 调用方须在重画前计入预算,并在重画为空时保留首遍结果。

Types

This section is empty.

Jump to

Keyboard shortcuts

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