runmat 0.4.5-dev.4 → 0.4.5-dev.6
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/artifacts/stdlib.snapshot +0 -0
- package/dist/generated/builtin-examples-catalog.d.ts.map +1 -1
- package/dist/generated/builtin-examples-catalog.js +1 -1
- package/dist/generated/builtin-examples-catalog.js.map +1 -1
- package/dist/generated/builtins/imread.d.ts +4 -0
- package/dist/generated/builtins/imread.d.ts.map +1 -0
- package/dist/generated/builtins/imread.js +131 -0
- package/dist/generated/builtins/imread.js.map +1 -0
- package/dist/generated/builtins-manifest.d.ts.map +1 -1
- package/dist/generated/builtins-manifest.js +27 -0
- package/dist/generated/builtins-manifest.js.map +1 -1
- package/dist/lsp/runmat_lsp.d.ts +2 -2
- package/dist/lsp/runmat_lsp.js +4 -4
- package/dist/lsp/runmat_lsp_bg.wasm +0 -0
- package/dist/lsp/runmat_lsp_bg.wasm.d.ts +2 -2
- package/dist/pkg-web/runmat_wasm_web.d.ts +8 -8
- package/dist/pkg-web/runmat_wasm_web.js +29 -29
- package/dist/pkg-web/runmat_wasm_web_bg.wasm +0 -0
- package/dist/pkg-web/runmat_wasm_web_bg.wasm.d.ts +6 -6
- package/dist/runtime/stdlib.snapshot +0 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imread.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/imread.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UA8HjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// @generated by scripts/generate-builtins.cjs
|
|
2
|
+
// Do not edit by hand.
|
|
3
|
+
const builtinDoc = {
|
|
4
|
+
"title": "imread",
|
|
5
|
+
"category": "image/io",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"imread",
|
|
8
|
+
"image",
|
|
9
|
+
"read image",
|
|
10
|
+
"png",
|
|
11
|
+
"jpeg",
|
|
12
|
+
"jpg",
|
|
13
|
+
"tiff",
|
|
14
|
+
"bmp",
|
|
15
|
+
"gif",
|
|
16
|
+
"webp",
|
|
17
|
+
"upload"
|
|
18
|
+
],
|
|
19
|
+
"summary": "Read image data from an uploaded file into MATLAB-compatible arrays.",
|
|
20
|
+
"references": [
|
|
21
|
+
"https://www.mathworks.com/help/matlab/ref/imread.html"
|
|
22
|
+
],
|
|
23
|
+
"gpu_support": {
|
|
24
|
+
"elementwise": false,
|
|
25
|
+
"reduction": false,
|
|
26
|
+
"precisions": [],
|
|
27
|
+
"broadcasting": "none",
|
|
28
|
+
"notes": "`imread` performs host-side file or network I/O and CPU decoding. Results are host tensors; wrap with `gpuArray` if device residency is needed after import."
|
|
29
|
+
},
|
|
30
|
+
"fusion": {
|
|
31
|
+
"elementwise": false,
|
|
32
|
+
"reduction": false,
|
|
33
|
+
"max_inputs": 2,
|
|
34
|
+
"constants": "inline"
|
|
35
|
+
},
|
|
36
|
+
"requires_feature": null,
|
|
37
|
+
"tested": {
|
|
38
|
+
"unit": "builtins::image::imread::tests",
|
|
39
|
+
"integration": "builtins::image::imread::tests::imread_fetches_http_url"
|
|
40
|
+
},
|
|
41
|
+
"description": "`imread(filename)` reads raster image data into dense column-major tensors using MATLAB-compatible shape conventions. Grayscale images return an MxN array, RGB images return an MxNx3 truecolor array, and alpha channels are available through the third output. Due to CORS and browser security restrictions, `file://` and `http://`/`https://` URLs are not currently supported — upload your image first and pass the resulting filename to `imread`.",
|
|
42
|
+
"behaviors": [
|
|
43
|
+
"Accepts a character vector or string scalar for the image source.",
|
|
44
|
+
"Due to CORS and browser security restrictions, `file://` URLs and `http://`/`https://` URLs are not currently supported. Upload your image first and pass the resulting filename to `imread`.",
|
|
45
|
+
"Accepts an optional explicit format hint: `imread(filename, format)`. Common hints include `png`, `jpg`, `jpeg`, `tif`, `tiff`, `bmp`, `gif`, and `webp`.",
|
|
46
|
+
"Without a format hint, RunMat detects the image format from the byte stream.",
|
|
47
|
+
"Grayscale images return MxN tensors. RGB and RGBA images return MxNx3 truecolor tensors using red, green, and blue planes along the third dimension.",
|
|
48
|
+
"8-bit images return `uint8` tensors and 16-bit images return `uint16` tensors. Floating-point images return `single` tensors when the decoder exposes floating-point pixel data.",
|
|
49
|
+
"For `[X, map] = imread(...)`, RunMat returns `X` and an empty colormap for direct-color formats.",
|
|
50
|
+
"For `[X, map, alpha] = imread(...)`, RunMat returns alpha as an MxN tensor when the source image has an alpha channel; otherwise alpha is empty.",
|
|
51
|
+
"Animated image frame selection and indexed colormap extraction are not implemented yet; current decoding returns the first decoded image frame as direct pixel data."
|
|
52
|
+
],
|
|
53
|
+
"examples": [
|
|
54
|
+
{
|
|
55
|
+
"description": "Read A Local PNG",
|
|
56
|
+
"input": "img = imread(\"logo.png\");\nsize(img)",
|
|
57
|
+
"output": "ans =\n rows cols 3"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"description": "Get Alpha Separately",
|
|
61
|
+
"input": "[rgb, map, alpha] = imread(\"icon.png\");\nsize(alpha)",
|
|
62
|
+
"output": "ans =\n rows cols"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"description": "Use An Explicit Format Hint",
|
|
66
|
+
"input": "img = imread(\"raw-download\", \"jpg\");",
|
|
67
|
+
"output": "% Decodes the bytes as JPEG even when the file name has no extension."
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"faqs": [
|
|
71
|
+
{
|
|
72
|
+
"question": "What shape does `imread` return for RGB images?",
|
|
73
|
+
"answer": "RGB images return an MxNx3 tensor where the third dimension stores red, green, and blue planes. Data is stored in RunMat's column-major tensor layout while preserving MATLAB indexing semantics."
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"question": "Where is the alpha channel returned?",
|
|
77
|
+
"answer": "Use the three-output form: `[X, map, alpha] = imread(filename)`. Direct-color images return an empty colormap in `map`; alpha is an MxN tensor when present."
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"question": "Can `imread` load `file://` or HTTP URLs?",
|
|
81
|
+
"answer": "Not currently. Due to CORS and browser security restrictions, `file://` and `http://`/`https://` URLs are blocked. Upload your image first and pass the resulting filename to `imread`."
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"question": "Does `imread` return GPU arrays?",
|
|
85
|
+
"answer": "No. Image reading performs host I/O and CPU decoding, so outputs are host tensors. Call `gpuArray(imread(...))` if subsequent processing should run on the GPU."
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"question": "Are animated GIF frames supported?",
|
|
89
|
+
"answer": "Not yet. The current decoder returns the first decoded image frame as direct pixel data."
|
|
90
|
+
}
|
|
91
|
+
],
|
|
92
|
+
"links": [
|
|
93
|
+
{
|
|
94
|
+
"label": "image",
|
|
95
|
+
"url": "./image"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"label": "imagesc",
|
|
99
|
+
"url": "./imagesc"
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"label": "class",
|
|
103
|
+
"url": "./class"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"label": "size",
|
|
107
|
+
"url": "./size"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"label": "gpuArray",
|
|
111
|
+
"url": "./gpuarray"
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
"source": {
|
|
115
|
+
"label": "`crates/runmat-runtime/src/builtins/image/imread.rs`",
|
|
116
|
+
"url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/image/imread.rs"
|
|
117
|
+
},
|
|
118
|
+
"gpu_residency": "`imread` always returns host-resident tensors because file and network I/O plus image decoding occur on the CPU. Use `gpuArray` after reading if later operations should use device residency.",
|
|
119
|
+
"gpu_behavior": [
|
|
120
|
+
"`imread` does not dispatch provider kernels and is not fusion eligible. GPU-resident scalar string inputs are gathered before decoding, and decoded pixel tensors remain on the host."
|
|
121
|
+
],
|
|
122
|
+
"key": "imread",
|
|
123
|
+
"slug": "imread",
|
|
124
|
+
"aliases": [],
|
|
125
|
+
"categoryPath": [
|
|
126
|
+
"image",
|
|
127
|
+
"io"
|
|
128
|
+
]
|
|
129
|
+
};
|
|
130
|
+
export default builtinDoc;
|
|
131
|
+
//# sourceMappingURL=imread.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imread.js","sourceRoot":"","sources":["../../../src/generated/builtins/imread.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,uBAAuB;AAIvB,MAAM,UAAU,GAAe;IAC7B,OAAO,EAAE,QAAQ;IACjB,UAAU,EAAE,UAAU;IACtB,UAAU,EAAE;QACV,QAAQ;QACR,OAAO;QACP,YAAY;QACZ,KAAK;QACL,MAAM;QACN,KAAK;QACL,MAAM;QACN,KAAK;QACL,KAAK;QACL,MAAM;QACN,QAAQ;KACT;IACD,SAAS,EAAE,sEAAsE;IACjF,YAAY,EAAE;QACZ,uDAAuD;KACxD;IACD,aAAa,EAAE;QACb,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,EAAE;QAChB,cAAc,EAAE,MAAM;QACtB,OAAO,EAAE,8JAA8J;KACxK;IACD,QAAQ,EAAE;QACR,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,CAAC;QACf,WAAW,EAAE,QAAQ;KACtB;IACD,kBAAkB,EAAE,IAAI;IACxB,QAAQ,EAAE;QACR,MAAM,EAAE,gCAAgC;QACxC,aAAa,EAAE,yDAAyD;KACzE;IACD,aAAa,EAAE,8bAA8b;IAC7c,WAAW,EAAE;QACX,mEAAmE;QACnE,+LAA+L;QAC/L,2JAA2J;QAC3J,8EAA8E;QAC9E,sJAAsJ;QACtJ,kLAAkL;QAClL,kGAAkG;QAClG,kJAAkJ;QAClJ,s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AEF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builtins-manifest.d.ts","sourceRoot":"","sources":["../../src/generated/builtins-manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE7E,eAAO,MAAM,eAAe,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"builtins-manifest.d.ts","sourceRoot":"","sources":["../../src/generated/builtins-manifest.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE7E,eAAO,MAAM,eAAe,EAAE,oBAAoB,EAm7OjD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAyX9D,CAAC;AAEF,eAAO,MAAM,4BAA4B,sEAC0C,CAAC"}
|
|
@@ -3117,6 +3117,32 @@ export const builtinManifest = [
|
|
|
3117
3117
|
"summary": "Filter images or N-D arrays with correlation/convolution kernels and configurable padding.",
|
|
3118
3118
|
"exampleCount": 5
|
|
3119
3119
|
},
|
|
3120
|
+
{
|
|
3121
|
+
"key": "imread",
|
|
3122
|
+
"title": "imread",
|
|
3123
|
+
"slug": "imread",
|
|
3124
|
+
"aliases": [],
|
|
3125
|
+
"category": "image/io",
|
|
3126
|
+
"categoryPath": [
|
|
3127
|
+
"image",
|
|
3128
|
+
"io"
|
|
3129
|
+
],
|
|
3130
|
+
"keywords": [
|
|
3131
|
+
"imread",
|
|
3132
|
+
"image",
|
|
3133
|
+
"read image",
|
|
3134
|
+
"png",
|
|
3135
|
+
"jpeg",
|
|
3136
|
+
"jpg",
|
|
3137
|
+
"tiff",
|
|
3138
|
+
"bmp",
|
|
3139
|
+
"gif",
|
|
3140
|
+
"webp",
|
|
3141
|
+
"upload"
|
|
3142
|
+
],
|
|
3143
|
+
"summary": "Read image data from an uploaded file into MATLAB-compatible arrays.",
|
|
3144
|
+
"exampleCount": 3
|
|
3145
|
+
},
|
|
3120
3146
|
{
|
|
3121
3147
|
"key": "imshow",
|
|
3122
3148
|
"title": "imshow",
|
|
@@ -7733,6 +7759,7 @@ export const builtinDocLoaders = {
|
|
|
7733
7759
|
"image": () => import("./builtins/image.js").then((mod) => mod.default),
|
|
7734
7760
|
"imagesc": () => import("./builtins/imagesc.js").then((mod) => mod.default),
|
|
7735
7761
|
"imfilter": () => import("./builtins/imfilter.js").then((mod) => mod.default),
|
|
7762
|
+
"imread": () => import("./builtins/imread.js").then((mod) => mod.default),
|
|
7736
7763
|
"imshow": () => import("./builtins/imshow.js").then((mod) => mod.default),
|
|
7737
7764
|
"ind2sub": () => import("./builtins/ind2sub.js").then((mod) => mod.default),
|
|
7738
7765
|
"input": () => import("./builtins/input.js").then((mod) => mod.default),
|