ms-types 0.9.42 → 0.9.43

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.42",
3
+ "version": "0.9.43",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
package/types/lua/cv.lua CHANGED
@@ -741,12 +741,15 @@ function _OpenCV.imread(path) return nil end
741
741
  function _OpenCV.imdecode(data) return nil end
742
742
 
743
743
  --- imwrite
744
+ --- 格式由扩展名决定,可用 png/apng/jpg/jpeg/jpe/bmp/dib/webp/ppm/pgm/pbm/pnm/pam/sr/ras;
745
+ --- 其它扩展名或通道数不是 1/3/4 的 Mat 返回 false。
744
746
  ---@param path string
745
747
  ---@param mat OpenCV.Mat
746
748
  ---@return boolean
747
749
  function _OpenCV.imwrite(path, mat) return false end
748
750
 
749
751
  --- imencode
752
+ --- 扩展名与通道限制同 imwrite;quality 取值 1-100,仅 jpg 有效。
750
753
  ---@param ext string
751
754
  ---@param mat OpenCV.Mat
752
755
  ---@param quality number|nil
package/types/opencv.d.ts CHANGED
@@ -256,7 +256,14 @@ declare namespace cv {
256
256
  function imread(path: string): Mat | null;
257
257
  /** 仅解码 base64 / data URI;路径与 imageId 请用 `imread` */
258
258
  function imdecode(data: string): Mat | null;
259
+ /**
260
+ * 保存 Mat 到本地文件,格式由扩展名决定。
261
+ * 可用 `png` / `apng` / `jpg` / `jpeg` / `jpe` / `bmp` / `dib` / `webp` /
262
+ * `ppm` / `pgm` / `pbm` / `pnm` / `pam` / `sr` / `ras`;
263
+ * 其它扩展名或通道数不是 1 / 3 / 4 的 Mat 返回 `false`。
264
+ */
259
265
  function imwrite(path: string, mat: Mat): boolean;
266
+ /** 编码为纯 base64;扩展名与通道限制同 `imwrite`,`quality` 取值 1–100(仅 jpg 有效) */
260
267
  function imencode(ext: string, mat: Mat, quality?: number): string | null;
261
268
  function fromImageId(imageId: string): Mat | null;
262
269
  function toImageId(mat: Mat): string | null;