Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
processing_camera_image
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
顾海波
2025-03-23 15:43:21 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
56e7edfb4e5ec44efb7bc2c0d74a9c332719bba2
56e7edfb
1 parent
ec451fbf
【修复】旋转
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
lib/processing_camera_image_i.dart
lib/processing_camera_image_i.dart
View file @
56e7edf
...
...
@@ -255,6 +255,12 @@ class IProcessingCameraImage implements ProcessingCameraImage {
}
rotationAngle
??=
0
;
double
rad
=
(
rotationAngle
*
3.14159265358979323846264338327950288
/
180.0
);
double
sinVal
=
sin
(
rad
).
abs
();
double
cosVal
=
cos
(
rad
).
abs
();
int
newImgWidth
=
(
sinVal
*
height
+
cosVal
*
width
).
toInt
();
int
newImgHeight
=
(
sinVal
*
width
+
cosVal
*
height
).
toInt
();
Pointer
<
Uint8
>
p
=
ffi
.
malloc
.
allocate
(
plane0
.
length
);
...
...
@@ -263,19 +269,19 @@ class IProcessingCameraImage implements ProcessingCameraImage {
Pointer
<
Uint32
>
imgP
=
_convertImageNV21ToRGB
(
p
,
width
,
height
,
newImgWidth
,
newImgHeight
,
rotationAngle
,
backGroundColor
,
isFlipVectical
,
isFlipHoriozntal
,
);
final
imgData
=
imgP
.
asTypedList
(
width
*
h
eight
);
final
imgData
=
imgP
.
asTypedList
(
newImgWidth
*
newImgH
eight
);
imglib
.
Image
img
=
imglib
.
Image
.
fromBytes
(
bytes:
imgData
.
buffer
,
width:
width
,
height:
height
,
width:
newImgWidth
,
height:
newImgHeight
,
order:
imglib
.
ChannelOrder
.
rgba
);
ffi
.
malloc
.
free
(
p
);
...
...
Please
register
or
login
to post a comment