runmat 0.4.5-dev.3 → 0.4.5-dev.5

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.
@@ -0,0 +1,4 @@
1
+ import type { BuiltinDoc } from "../../builtins.js";
2
+ declare const builtinDoc: BuiltinDoc;
3
+ export default builtinDoc;
4
+ //# sourceMappingURL=imread.d.ts.map
@@ -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,sKAAsK;KACvK;IACD,UAAU,EAAE;QACV;YACE,aAAa,EAAE,kBAAkB;YACjC,OAAO,EAAE,wCAAwC;YACjD,QAAQ,EAAE,+BAA+B;SAC1C;QACD;YACE,aAAa,EAAE,sBAAsB;YACrC,OAAO,EAAE,wDAAwD;YACjE,QAAQ,EAAE,yBAAyB;SACpC;QACD;YACE,aAAa,EAAE,6BAA6B;YAC5C,OAAO,EAAE,0CAA0C;YACnD,QAAQ,EAAE,uEAAuE;SAClF;KACF;IACD,MAAM,EAAE;QACN;YACE,UAAU,EAAE,iDAAiD;YAC7D,QAAQ,EAAE,mMAAmM;SAC9M;QACD;YACE,UAAU,EAAE,sCAAsC;YAClD,QAAQ,EAAE,8JAA8J;SACzK;QACD;YACE,UAAU,EAAE,2CAA2C;YACvD,QAAQ,EAAE,yLAAyL;SACpM;QACD;YACE,UAAU,EAAE,kCAAkC;YAC9C,QAAQ,EAAE,iKAAiK;SAC5K;QACD;YACE,UAAU,EAAE,oCAAoC;YAChD,QAAQ,EAAE,0FAA0F;SACrG;KACF;IACD,OAAO,EAAE;QACP;YACE,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,SAAS;SACjB;QACD;YACE,OAAO,EAAE,SAAS;YAClB,KAAK,EAAE,WAAW;SACnB;QACD;YACE,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,SAAS;SACjB;QACD;YACE,OAAO,EAAE,MAAM;YACf,KAAK,EAAE,QAAQ;SAChB;QACD;YACE,OAAO,EAAE,UAAU;YACnB,KAAK,EAAE,YAAY;SACpB;KACF;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,sDAAsD;QAC/D,KAAK,EAAE,mGAAmG;KAC3G;IACD,eAAe,EAAE,gMAAgM;IACjN,cAAc,EAAE;QACd,uLAAuL;KACxL;IACD,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,EAAE;IACb,cAAc,EAAE;QACd,OAAO;QACP,IAAI;KACL;CACF,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { BuiltinDoc } from "../../builtins.js";
2
+ declare const builtinDoc: BuiltinDoc;
3
+ export default builtinDoc;
4
+ //# sourceMappingURL=imshow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"imshow.d.ts","sourceRoot":"","sources":["../../../src/generated/builtins/imshow.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,QAAA,MAAM,UAAU,EAAE,UAmGjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,104 @@
1
+ // @generated by scripts/generate-builtins.cjs
2
+ // Do not edit by hand.
3
+ const builtinDoc = {
4
+ "title": "imshow",
5
+ "category": "plotting",
6
+ "keywords": [
7
+ "imshow",
8
+ "image display",
9
+ "grayscale image",
10
+ "binary image",
11
+ "rgb image",
12
+ "matlab imshow"
13
+ ],
14
+ "summary": "Display grayscale, binary, truecolor, or file-backed images.",
15
+ "gpu_support": {
16
+ "elementwise": false,
17
+ "reduction": false,
18
+ "precisions": [],
19
+ "broadcasting": "none",
20
+ "notes": "`imshow` is a plotting sink and does not advertise precision-specialized GPU kernels. Grayscale gpuArray inputs may use the image/surface rendering path; filename decoding and truecolor normalization run on the host."
21
+ },
22
+ "fusion": {
23
+ "elementwise": false,
24
+ "reduction": false,
25
+ "max_inputs": 2,
26
+ "constants": "inline"
27
+ },
28
+ "requires_feature": null,
29
+ "tested": {
30
+ "unit": "builtins::plotting::imshow::tests"
31
+ },
32
+ "description": "`imshow` displays image data using MATLAB-familiar defaults. Numeric and logical 2-D arrays render as grayscale images, MxNx3 and MxNx4 arrays render as truecolor images, and filename inputs are decoded through RunMat's filesystem layer before display.",
33
+ "behaviors": [
34
+ "`imshow(I)` displays 2-D numeric data with grayscale limits `[0, 1]`, matching MATLAB double-image defaults.",
35
+ "`imshow(BW)` displays logical image data as black and white using `[0, 1]` limits.",
36
+ "`imshow(RGB)` displays MxNx3 truecolor data directly.",
37
+ "`imshow(RGBA)` displays MxNx4 truecolor data with alpha.",
38
+ "`imshow(I, [low high])` displays grayscale image data using an explicit display range.",
39
+ "`imshow(I, [])` auto-scales grayscale image data from finite minimum to finite maximum.",
40
+ "`imshow(filename)` reads and decodes an image file, then displays it as truecolor data."
41
+ ],
42
+ "examples": [
43
+ {
44
+ "description": "Display a simple grayscale image",
45
+ "input": "row = 100;\ncol = 100;\nrsm = ones(row, col);\nimshow(rsm);"
46
+ },
47
+ {
48
+ "description": "Auto-scale a matrix for display",
49
+ "input": "A = peaks(128);\nimshow(A, []);"
50
+ },
51
+ {
52
+ "description": "Display truecolor RGB data",
53
+ "input": "R = ones(64, 64);\nG = zeros(64, 64);\nB = zeros(64, 64);\nRGB = cat(3, R, G, B);\nimshow(RGB);"
54
+ },
55
+ {
56
+ "description": "Display an image file",
57
+ "input": "imshow(\"photo.png\");"
58
+ }
59
+ ],
60
+ "faqs": [
61
+ {
62
+ "question": "What display range does imshow use for doubles?",
63
+ "answer": "`imshow(I)` uses `[0, 1]` for floating-point grayscale data. Use `imshow(I, [])` when you want RunMat to scale the visible range from the data minimum to maximum."
64
+ },
65
+ {
66
+ "question": "Does imshow support uint8 and uint16 image defaults?",
67
+ "answer": "File-backed images decode with byte pixel semantics. User-created integer image arrays currently depend on RunMat's broader numeric-class metadata model, so exact MATLAB class-dependent defaults for dense uint8/uint16 tensors are tracked separately."
68
+ },
69
+ {
70
+ "question": "How is imshow different from imagesc?",
71
+ "answer": "`imshow` is for image display and uses grayscale or truecolor image defaults. `imagesc` is for scaled matrix visualization and maps data through the active colormap."
72
+ }
73
+ ],
74
+ "links": [
75
+ {
76
+ "label": "image",
77
+ "url": "./image"
78
+ },
79
+ {
80
+ "label": "imagesc",
81
+ "url": "./imagesc"
82
+ },
83
+ {
84
+ "label": "colormap",
85
+ "url": "./colormap"
86
+ },
87
+ {
88
+ "label": "axis",
89
+ "url": "./axis"
90
+ }
91
+ ],
92
+ "source": {
93
+ "label": "`crates/runmat-runtime/src/builtins/plotting/ops/imshow.rs`",
94
+ "url": "https://github.com/runmat-org/runmat/blob/main/crates/runmat-runtime/src/builtins/plotting/ops/imshow.rs"
95
+ },
96
+ "key": "imshow",
97
+ "slug": "imshow",
98
+ "aliases": [],
99
+ "categoryPath": [
100
+ "plotting"
101
+ ]
102
+ };
103
+ export default builtinDoc;
104
+ //# sourceMappingURL=imshow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"imshow.js","sourceRoot":"","sources":["../../../src/generated/builtins/imshow.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,eAAe;QACf,iBAAiB;QACjB,cAAc;QACd,WAAW;QACX,eAAe;KAChB;IACD,SAAS,EAAE,8DAA8D;IACzE,aAAa,EAAE;QACb,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,EAAE;QAChB,cAAc,EAAE,MAAM;QACtB,OAAO,EAAE,0NAA0N;KACpO;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,mCAAmC;KAC5C;IACD,aAAa,EAAE,8PAA8P;IAC7Q,WAAW,EAAE;QACX,8GAA8G;QAC9G,oFAAoF;QACpF,uDAAuD;QACvD,0DAA0D;QAC1D,wFAAwF;QACxF,yFAAyF;QACzF,yFAAyF;KAC1F;IACD,UAAU,EAAE;QACV;YACE,aAAa,EAAE,kCAAkC;YACjD,OAAO,EAAE,6DAA6D;SACvE;QACD;YACE,aAAa,EAAE,iCAAiC;YAChD,OAAO,EAAE,iCAAiC;SAC3C;QACD;YACE,aAAa,EAAE,4BAA4B;YAC3C,OAAO,EAAE,iGAAiG;SAC3G;QACD;YACE,aAAa,EAAE,uBAAuB;YACtC,OAAO,EAAE,wBAAwB;SAClC;KACF;IACD,MAAM,EAAE;QACN;YACE,UAAU,EAAE,iDAAiD;YAC7D,QAAQ,EAAE,oKAAoK;SAC/K;QACD;YACE,UAAU,EAAE,sDAAsD;YAClE,QAAQ,EAAE,2PAA2P;SACtQ;QACD;YACE,UAAU,EAAE,uCAAuC;YACnD,QAAQ,EAAE,uKAAuK;SAClL;KACF;IACD,OAAO,EAAE;QACP;YACE,OAAO,EAAE,OAAO;YAChB,KAAK,EAAE,SAAS;SACjB;QACD;YACE,OAAO,EAAE,SAAS;YAClB,KAAK,EAAE,WAAW;SACnB;QACD;YACE,OAAO,EAAE,UAAU;YACnB,KAAK,EAAE,YAAY;SACpB;QACD;YACE,OAAO,EAAE,MAAM;YACf,KAAK,EAAE,QAAQ;SAChB;KACF;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,6DAA6D;QACtE,KAAK,EAAE,0GAA0G;KAClH;IACD,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,EAAE;IACb,cAAc,EAAE;QACd,UAAU;KACX;CACF,CAAC;AAEF,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,EAq4OjD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAuX9D,CAAC;AAEF,eAAO,MAAM,4BAA4B,sEAC0C,CAAC"}
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,52 @@ 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
+ },
3146
+ {
3147
+ "key": "imshow",
3148
+ "title": "imshow",
3149
+ "slug": "imshow",
3150
+ "aliases": [],
3151
+ "category": "plotting",
3152
+ "categoryPath": [
3153
+ "plotting"
3154
+ ],
3155
+ "keywords": [
3156
+ "imshow",
3157
+ "image display",
3158
+ "grayscale image",
3159
+ "binary image",
3160
+ "rgb image",
3161
+ "matlab imshow"
3162
+ ],
3163
+ "summary": "Display grayscale, binary, truecolor, or file-backed images.",
3164
+ "exampleCount": 4
3165
+ },
3120
3166
  {
3121
3167
  "key": "ind2sub",
3122
3168
  "title": "ind2sub",
@@ -7713,6 +7759,8 @@ export const builtinDocLoaders = {
7713
7759
  "image": () => import("./builtins/image.js").then((mod) => mod.default),
7714
7760
  "imagesc": () => import("./builtins/imagesc.js").then((mod) => mod.default),
7715
7761
  "imfilter": () => import("./builtins/imfilter.js").then((mod) => mod.default),
7762
+ "imread": () => import("./builtins/imread.js").then((mod) => mod.default),
7763
+ "imshow": () => import("./builtins/imshow.js").then((mod) => mod.default),
7716
7764
  "ind2sub": () => import("./builtins/ind2sub.js").then((mod) => mod.default),
7717
7765
  "input": () => import("./builtins/input.js").then((mod) => mod.default),
7718
7766
  "interp1": () => import("./builtins/interp1.js").then((mod) => mod.default),