ms-types 0.9.30 → 0.9.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ms-types",
3
- "version": "0.9.30",
3
+ "version": "0.9.31",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
package/types/image.d.ts CHANGED
@@ -252,6 +252,9 @@ declare namespace image {
252
252
  * @param options.scaleFactors 仅 method=99 生效。模板缩放比例列表(不是屏幕 scale)。
253
253
  * 应围绕 baseScale=当前设备宽/截模板设备宽 生成,例如 baseScale 附近 ±0.05~0.1 共 3~7 档;
254
254
  * 默认 [1.0, 0.9, 1.1, 0.8, 1.2] 只适合尺寸接近时的盲扫,跨大分辨率请按设备动态计算。
255
+ * @param options.orz 查找方向 1-8,与 findColor 的 orz 相同。不传或非 1-8 时仍按相似度从高到低返回;
256
+ * 传入 1-8 时按该方向取前 limit 个达标结果。limit=1 时只返回该方向第一个,不必把其余命中都找出来。
257
+ * method 0(SIFT)会先完成匹配再按方向排序截取。
255
258
  * @returns 图片数组;method=99 时结果额外含 scaleX/scaleY
256
259
  * @example
257
260
  * const points = image.findImage("screen", "template.jpg", 0, 0, 100, 100, 0.9, 1, 5, false)
@@ -272,6 +275,7 @@ declare namespace image {
272
275
  rgb?: boolean,
273
276
  options?: {
274
277
  scaleFactors?: number[];
278
+ orz?: number;
275
279
  },
276
280
  ): {
277
281
  index: number;
@@ -129,11 +129,12 @@ function _Image.cmpColor(id, points, threshold) return true end
129
129
  --- @param ey integer|nil 右下y
130
130
  --- @param threshold number 相似度 0.0-1.0
131
131
  --- @param limit integer|nil 限制个数
132
- --- @param method integer|nil 匹配方法 1|3|5
132
+ --- @param method integer|nil 匹配方法 0|1|3|5|99
133
133
  --- @param rgb boolean|nil 是否使用RGB
134
+ --- @param options table|nil 选项。scaleFactors 仅 method=99;orz 为查找方向 1-8(与 findColor 相同)
134
135
  --- @return Rect[] 结果矩形列表
135
136
  function _Image.findImage(id, templateImageId, x, y, ex, ey, threshold, limit,
136
- method, rgb) return {} end
137
+ method, rgb, options) return {} end
137
138
 
138
139
  --- 多点找色
139
140
  --- @param id string 图片ID
@@ -250,6 +250,9 @@ declare namespace $图片 {
250
250
  * @param 选项.scaleFactors 仅方法=99 生效。模板缩放比例列表(不是屏幕 scale)。
251
251
  * 应围绕 baseScale=当前设备宽/截模板设备宽 生成,例如 baseScale 附近 ±0.05~0.1 共 3~7 档;
252
252
  * 默认 [1.0, 0.9, 1.1, 0.8, 1.2] 只适合尺寸接近时的盲扫,跨大分辨率请按设备动态计算。
253
+ * @param 选项.orz 查找方向 1-8,与单点找色的查找方向相同。不传或非 1-8 时仍按相似度从高到低返回;
254
+ * 传入 1-8 时按该方向取前限制数量个达标结果。限制数量=1 时只返回该方向第一个,不必把其余命中都找出来。
255
+ * 方法 0(SIFT)会先完成匹配再按方向排序截取。
253
256
  * @returns 图片数组;方法=99 时结果额外含 scaleX/scaleY
254
257
  * @example
255
258
  * const 图片数组 = $图片.找图("screen", "template.jpg", 0, 0, 100, 100, 0.9, 1, 5, false)
@@ -270,6 +273,7 @@ declare namespace $图片 {
270
273
  是否使用RGB找图?: 布尔值,
271
274
  选项?: {
272
275
  scaleFactors?: 数字[];
276
+ orz?: 数字;
273
277
  },
274
278
  ): {
275
279
  index: 数字;