@rosepetal/node-red-contrib-image-tools 1.4.2 → 1.4.3
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/darwin-arm64/package.json +1 -1
- package/artifacts/linux-arm64/package.json +1 -1
- package/artifacts/linux-x64/package.json +1 -1
- package/artifacts/linuxmusl-x64/package.json +1 -1
- package/node-red-contrib-image-tools/lib/inference-transform.js +1 -33
- package/npm/darwin-arm64/package.json +1 -1
- package/npm/darwin-x64/package.json +1 -1
- package/npm/linux-arm64/package.json +1 -1
- package/npm/linux-x64/package.json +1 -1
- package/npm/linuxmusl-x64/package.json +1 -1
- package/npm/win32-x64/package.json +1 -1
- package/package.json +1 -1
|
@@ -292,40 +292,8 @@ function makeRotateTransform(params) {
|
|
|
292
292
|
if (near(0)) {
|
|
293
293
|
return { pointFn: (x, y) => [x, y], opts: {}, maskTransformFn: null };
|
|
294
294
|
}
|
|
295
|
-
if (near(90)) {
|
|
296
|
-
// C++ uses cv::ROTATE_90_COUNTERCLOCKWISE for angle=90
|
|
297
|
-
return {
|
|
298
|
-
pointFn: (x, y) => [y, 1 - x],
|
|
299
|
-
opts: {},
|
|
300
|
-
maskTransformFn: async (mask, cppBridge) => {
|
|
301
|
-
const { image } = await cppBridge.rotate(mask, 90, '#00000000', 'raw', 90, false);
|
|
302
|
-
return image;
|
|
303
|
-
}
|
|
304
|
-
};
|
|
305
|
-
}
|
|
306
|
-
if (near(180)) {
|
|
307
|
-
return {
|
|
308
|
-
pointFn: (x, y) => [1 - x, 1 - y],
|
|
309
|
-
opts: {},
|
|
310
|
-
maskTransformFn: async (mask, cppBridge) => {
|
|
311
|
-
const { image } = await cppBridge.rotate(mask, 180, '#00000000', 'raw', 90, false);
|
|
312
|
-
return image;
|
|
313
|
-
}
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
|
-
if (near(270)) {
|
|
317
|
-
// C++ uses cv::ROTATE_90_CLOCKWISE for angle=270
|
|
318
|
-
return {
|
|
319
|
-
pointFn: (x, y) => [1 - y, x],
|
|
320
|
-
opts: {},
|
|
321
|
-
maskTransformFn: async (mask, cppBridge) => {
|
|
322
|
-
const { image } = await cppBridge.rotate(mask, 270, '#00000000', 'raw', 90, false);
|
|
323
|
-
return image;
|
|
324
|
-
}
|
|
325
|
-
};
|
|
326
|
-
}
|
|
327
295
|
|
|
328
|
-
//
|
|
296
|
+
// All non-zero angles use the affine matrix path (matches C++ getRotationMatrix2D)
|
|
329
297
|
const rad = angleDeg * DEG;
|
|
330
298
|
const cosA = Math.cos(rad), sinA = Math.sin(rad);
|
|
331
299
|
const absCos = Math.abs(cosA), absSin = Math.abs(sinA);
|