com.shinolab.autd3-sdk.pattern.holo 0.5.0 → 0.6.1
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/Holo.cs
CHANGED
|
@@ -201,7 +201,7 @@ namespace AUTD3.Holo
|
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
[StructLayout(LayoutKind.Sequential)]
|
|
204
|
-
internal struct
|
|
204
|
+
internal struct HoloAmplitudeTargetNative
|
|
205
205
|
{
|
|
206
206
|
public float X;
|
|
207
207
|
public float Y;
|
|
@@ -213,6 +213,11 @@ namespace AUTD3.Holo
|
|
|
213
213
|
{
|
|
214
214
|
private const string Lib = "autd3_pattern_holo";
|
|
215
215
|
|
|
216
|
+
static NativeHolo() => NativeAbi.Verify(Lib, autd3_abi_version());
|
|
217
|
+
|
|
218
|
+
[DllImport(Lib)]
|
|
219
|
+
private static extern uint autd3_abi_version();
|
|
220
|
+
|
|
216
221
|
[DllImport(Lib)]
|
|
217
222
|
internal static extern float autd3_holo_amplitude_pascal(float value);
|
|
218
223
|
|
|
@@ -223,24 +228,24 @@ namespace AUTD3.Holo
|
|
|
223
228
|
internal static extern float autd3_holo_amplitude_spl(float value);
|
|
224
229
|
|
|
225
230
|
[DllImport(Lib)]
|
|
226
|
-
internal static extern int autd3_holo_naive(IntPtr geometry,
|
|
231
|
+
internal static extern int autd3_holo_naive(IntPtr geometry, HoloAmplitudeTargetNative[] foci, UIntPtr numFoci, float wavelengthMm, in EmissionConstraintNative constraint, byte directivity, byte[]? mask, [MarshalAs(UnmanagedType.I1)] bool parallel, IntPtr buffer, byte[] outErr, UIntPtr outErrLen);
|
|
227
232
|
|
|
228
233
|
[DllImport(Lib)]
|
|
229
|
-
internal static extern int autd3_holo_gs(IntPtr geometry,
|
|
234
|
+
internal static extern int autd3_holo_gs(IntPtr geometry, HoloAmplitudeTargetNative[] foci, UIntPtr numFoci, float wavelengthMm, UIntPtr repeat, in EmissionConstraintNative constraint, byte directivity, byte[]? mask, [MarshalAs(UnmanagedType.I1)] bool parallel, IntPtr buffer, byte[] outErr, UIntPtr outErrLen);
|
|
230
235
|
|
|
231
236
|
[DllImport(Lib)]
|
|
232
|
-
internal static extern int autd3_holo_gspat(IntPtr geometry,
|
|
237
|
+
internal static extern int autd3_holo_gspat(IntPtr geometry, HoloAmplitudeTargetNative[] foci, UIntPtr numFoci, float wavelengthMm, UIntPtr repeat, in EmissionConstraintNative constraint, byte directivity, byte[]? mask, [MarshalAs(UnmanagedType.I1)] bool parallel, IntPtr buffer, byte[] outErr, UIntPtr outErrLen);
|
|
233
238
|
|
|
234
239
|
[DllImport(Lib)]
|
|
235
|
-
internal static extern int autd3_holo_greedy(IntPtr geometry,
|
|
240
|
+
internal static extern int autd3_holo_greedy(IntPtr geometry, HoloAmplitudeTargetNative[] foci, UIntPtr numFoci, float wavelengthMm, byte phaseQuantizationLevels, in EmissionConstraintNative constraint, byte directivity, byte[]? mask, IntPtr buffer, byte[] outErr, UIntPtr outErrLen);
|
|
236
241
|
}
|
|
237
242
|
|
|
238
|
-
public readonly struct
|
|
243
|
+
public readonly struct AmplitudeTarget
|
|
239
244
|
{
|
|
240
245
|
public Vector3 Point { get; }
|
|
241
246
|
public Amplitude Amplitude { get; }
|
|
242
247
|
|
|
243
|
-
public
|
|
248
|
+
public AmplitudeTarget(Vector3 point, Amplitude amplitude)
|
|
244
249
|
{
|
|
245
250
|
Point = point;
|
|
246
251
|
Amplitude = amplitude;
|
|
@@ -250,13 +255,13 @@ namespace AUTD3.Holo
|
|
|
250
255
|
public static class Holo
|
|
251
256
|
{
|
|
252
257
|
|
|
253
|
-
private static
|
|
258
|
+
private static HoloAmplitudeTargetNative[] ToNative(AmplitudeTarget[] foci)
|
|
254
259
|
{
|
|
255
|
-
var native = new
|
|
260
|
+
var native = new HoloAmplitudeTargetNative[foci.Length];
|
|
256
261
|
for (var i = 0; i < foci.Length; i++)
|
|
257
262
|
{
|
|
258
263
|
var p = Coords.Point(foci[i].Point);
|
|
259
|
-
native[i] = new
|
|
264
|
+
native[i] = new HoloAmplitudeTargetNative
|
|
260
265
|
{
|
|
261
266
|
X = p.X,
|
|
262
267
|
Y = p.Y,
|
|
@@ -288,39 +293,43 @@ namespace AUTD3.Holo
|
|
|
288
293
|
return flat;
|
|
289
294
|
}
|
|
290
295
|
|
|
291
|
-
public static void Naive(Geometry geometry,
|
|
296
|
+
public static void Naive(Geometry geometry, AmplitudeTarget[] foci, Length wavelength, NaiveOption option, PatternBuffer dst)
|
|
292
297
|
{
|
|
293
298
|
var c = option.Constraint.ToNative();
|
|
294
|
-
|
|
299
|
+
var err = new byte[NativeAbi.ErrorBufferLength];
|
|
300
|
+
if (NativeHolo.autd3_holo_naive(geometry.Handle, ToNative(foci), (UIntPtr)foci.Length, wavelength.Mm, in c, (byte)option.Directivity, FlattenMask(option.Mask.Mask, dst.NumDevices), option.Parallel, dst.Handle, err, (UIntPtr)err.Length) != 0)
|
|
295
301
|
{
|
|
296
|
-
throw new Autd3Exception(
|
|
302
|
+
throw new Autd3Exception(NativeUtil.Utf8(err));
|
|
297
303
|
}
|
|
298
304
|
}
|
|
299
305
|
|
|
300
|
-
public static void Gs(Geometry geometry,
|
|
306
|
+
public static void Gs(Geometry geometry, AmplitudeTarget[] foci, Length wavelength, GsOption option, PatternBuffer dst)
|
|
301
307
|
{
|
|
302
308
|
var c = option.Constraint.ToNative();
|
|
303
|
-
|
|
309
|
+
var err = new byte[NativeAbi.ErrorBufferLength];
|
|
310
|
+
if (NativeHolo.autd3_holo_gs(geometry.Handle, ToNative(foci), (UIntPtr)foci.Length, wavelength.Mm, (UIntPtr)option.Repeat, in c, (byte)option.Directivity, FlattenMask(option.Mask.Mask, dst.NumDevices), option.Parallel, dst.Handle, err, (UIntPtr)err.Length) != 0)
|
|
304
311
|
{
|
|
305
|
-
throw new Autd3Exception(
|
|
312
|
+
throw new Autd3Exception(NativeUtil.Utf8(err));
|
|
306
313
|
}
|
|
307
314
|
}
|
|
308
315
|
|
|
309
|
-
public static void Gspat(Geometry geometry,
|
|
316
|
+
public static void Gspat(Geometry geometry, AmplitudeTarget[] foci, Length wavelength, GspatOption option, PatternBuffer dst)
|
|
310
317
|
{
|
|
311
318
|
var c = option.Constraint.ToNative();
|
|
312
|
-
|
|
319
|
+
var err = new byte[NativeAbi.ErrorBufferLength];
|
|
320
|
+
if (NativeHolo.autd3_holo_gspat(geometry.Handle, ToNative(foci), (UIntPtr)foci.Length, wavelength.Mm, (UIntPtr)option.Repeat, in c, (byte)option.Directivity, FlattenMask(option.Mask.Mask, dst.NumDevices), option.Parallel, dst.Handle, err, (UIntPtr)err.Length) != 0)
|
|
313
321
|
{
|
|
314
|
-
throw new Autd3Exception(
|
|
322
|
+
throw new Autd3Exception(NativeUtil.Utf8(err));
|
|
315
323
|
}
|
|
316
324
|
}
|
|
317
325
|
|
|
318
|
-
public static void Greedy(Geometry geometry,
|
|
326
|
+
public static void Greedy(Geometry geometry, AmplitudeTarget[] foci, Length wavelength, GreedyOption option, PatternBuffer dst)
|
|
319
327
|
{
|
|
320
328
|
var c = option.Constraint.ToNative();
|
|
321
|
-
|
|
329
|
+
var err = new byte[NativeAbi.ErrorBufferLength];
|
|
330
|
+
if (NativeHolo.autd3_holo_greedy(geometry.Handle, ToNative(foci), (UIntPtr)foci.Length, wavelength.Mm, option.PhaseQuantizationLevels, in c, (byte)option.Directivity, FlattenMask(option.Mask.Mask, dst.NumDevices), dst.Handle, err, (UIntPtr)err.Length) != 0)
|
|
322
331
|
{
|
|
323
|
-
throw new Autd3Exception(
|
|
332
|
+
throw new Autd3Exception(NativeUtil.Utf8(err));
|
|
324
333
|
}
|
|
325
334
|
}
|
|
326
335
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/THIRD-PARTY-LICENSES.md
CHANGED
|
@@ -1068,11 +1068,41 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
1068
1068
|
|
|
1069
1069
|
Used by:
|
|
1070
1070
|
|
|
1071
|
-
- autd3-
|
|
1072
|
-
- autd3-
|
|
1073
|
-
- autd3-
|
|
1074
|
-
|
|
1075
|
-
|
|
1071
|
+
- autd3-rs-core 0.6.1 — https://github.com/shinolab/autd3-sdk
|
|
1072
|
+
- autd3-rs-pattern-holo 0.6.1 — https://github.com/shinolab/autd3-sdk
|
|
1073
|
+
- autd3-cpu-wire 0.6.0 — https://github.com/shinolab/autd3-sdk
|
|
1074
|
+
|
|
1075
|
+
```
|
|
1076
|
+
MIT License
|
|
1077
|
+
|
|
1078
|
+
Copyright (c) 2026 Shun Suzuki
|
|
1079
|
+
|
|
1080
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
1081
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
1082
|
+
in the Software without restriction, including without limitation the rights
|
|
1083
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
1084
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
1085
|
+
furnished to do so, subject to the following conditions:
|
|
1086
|
+
|
|
1087
|
+
The above copyright notice and this permission notice shall be included in all
|
|
1088
|
+
copies or substantial portions of the Software.
|
|
1089
|
+
|
|
1090
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
1091
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
1092
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1093
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
1094
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
1095
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1096
|
+
SOFTWARE.
|
|
1097
|
+
|
|
1098
|
+
```
|
|
1099
|
+
|
|
1100
|
+
## MIT License
|
|
1101
|
+
|
|
1102
|
+
Used by:
|
|
1103
|
+
|
|
1104
|
+
- autd3-ffi-abi 0.6.1 — https://github.com/shinolab/autd3-sdk
|
|
1105
|
+
- autd3-ffi-pattern-holo 0.6.1 — https://github.com/shinolab/autd3-sdk
|
|
1076
1106
|
- chrono 0.4.45 — https://github.com/chronotope/chrono
|
|
1077
1107
|
- r-efi 6.0.0 — https://github.com/r-efi/r-efi
|
|
1078
1108
|
- wide 1.5.0 — https://github.com/Lokathor/wide
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"url": "git+https://github.com/shinolab/autd3-sdk.git",
|
|
6
6
|
"directory": "bindings/unity/com.shinolab.autd3-sdk.pattern.holo"
|
|
7
7
|
},
|
|
8
|
-
"version": "0.
|
|
8
|
+
"version": "0.6.1",
|
|
9
9
|
"displayName": "AUTD3 Pattern Holo",
|
|
10
10
|
"description": "AUTD3 multi-focus holographic patterns (Unity binding).",
|
|
11
11
|
"unity": "6000.0",
|
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
"url": "https://github.com/shinolab"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"com.shinolab.autd3-sdk.pattern": "0.
|
|
18
|
+
"com.shinolab.autd3-sdk.pattern": "0.6.1"
|
|
19
19
|
}
|
|
20
20
|
}
|