Skip to content

Commit 2fdd385

Browse files
committed
文档更新
1 parent e9ba149 commit 2fdd385

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

docs/rhino/advanced/images.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,7 @@ if (images.detectsColor(img, "#fed9a8", x, y)) {
659659
- `template` \{Image} 小图片(模板)
660660
- `options` \{Object} 选项包括:
661661
- `threshold` \{number} 图片相似度。取值范围为 0~1 的浮点数。默认值为 0.9。
662+
- `transparentMask` \{boolean} **v7.2.0 新增**,是否使用透明模板找图。此选项开启后,传入的 template 参数可以是一个透明背景的图片对象用于匹配。图像半透明地方越多,或者透明度越低,匹配结果相似度就越低,所以尽量避免模板图像存在半透明的像素点
662663
- `region` \{Array} 找图区域。参见 findColor 函数关于 region 的说明。
663664
- `level` \{number} **一般而言不必修改此参数**。不加此参数时该参数会根据图片大小自动调整。找图算法是采用图像金字塔进行的, level 参数表示金字塔的层次, level 越大可能带来越高的找图效率,但也可能造成找图失败(图片因过度缩小而无法分辨)或返回错误位置。因此,除非您清楚该参数的意义并需要进行性能调优,否则不需要用到该参数。
664665

@@ -722,6 +723,7 @@ images.findImage(img, template, {
722723
- `threshold` \{number} 图片相似度。取值范围为 0~1 的浮点数。默认值为 0.9。
723724
- `region` \{Array} 找图区域。参见 findColor 函数关于 region 的说明。
724725
- `max` \{number} 找图结果最大数量,默认为 5
726+
- `transparentMask` \{boolean} **v7.2.0 新增**,是否使用透明模板找图。此选项开启后,传入的 template 参数可以是一个透明背景的图片对象用于匹配。图像半透明地方越多,或者透明度越低,匹配结果相似度就越低,所以尽量避免模板图像存在半透明的像素点
725727
- `level` \{number} **一般而言不必修改此参数**。不加此参数时该参数会根据图片大小自动调整。找图算法是采用图像金字塔进行的, level 参数表示金字塔的层次, level 越大可能带来越高的找图效率,但也可能造成找图失败(图片因过度缩小而无法分辨)或返回错误位置。因此,除非您清楚该参数的意义并需要进行性能调优,否则不需要用到该参数。
726728
- 返回 \{MatchingResult}
727729

docs/rhino/advanced/threads.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,46 @@ thread.interrupt();
4747

4848
更多信息参见[Thread](#thread)
4949

50+
## threads.runOnMainThread(fn)
51+
52+
> 7.2.0 新增
53+
54+
```ts
55+
function runOnMainThread(fn: () => void): void;
56+
```
57+
58+
使 fn 函数在脚本主线程中运行
59+
60+
## threads.runOnThreadPool(fn)
61+
62+
> 7.2.0 新增
63+
64+
```ts
65+
function runOnThreadPool(fn: () => void): void;
66+
```
67+
68+
使 fn 函数在默认线程池中运行
69+
70+
## threads.runOnIoThreadPool(fn)
71+
72+
> 7.2.0 新增
73+
74+
```ts
75+
function runOnIoThreadPool(fn: () => void): void;
76+
```
77+
78+
使 fn 函数在默认 Io 线程池中运行
79+
80+
## threads.runAsync(fn)
81+
82+
> 7.2.0 新增
83+
84+
```ts
85+
function runAsync<T>(fn: () => T): Promise<T>;
86+
```
87+
88+
使 fn 函数在默认线程池中运行,并且将结果封装为`Promise`
89+
5090
## threads.shutDownAll()
5191

5292
停止所有通过`threads.start()`启动的子线程。

docs/rhino/base/http.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,16 @@ log(res.body.string());
193193

194194
该函数是 get, post, postJson 等函数的基础函数。因此除非是 PUT, DELET 等请求,或者需要更高定制的 HTTP 请求,否则直接使用 get, post, postJson 等函数会更加方便。
195195

196+
## http.setTimeout(timeout)
197+
198+
> 7.2.0 新增
199+
200+
```ts
201+
function _setTimeout(timeout: number): void;
202+
```
203+
204+
设置 http 模块的请求超时时间,单位为毫秒,默认值为 30 秒
205+
196206
# Response
197207

198208
HTTP 请求的响应。

0 commit comments

Comments
 (0)