-
Notifications
You must be signed in to change notification settings - Fork 294
Add QImage
and CV::Mat
conversion functions into Frame
for better handling alpha channel handling
#998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aperture147
wants to merge
12
commits into
OpenShot:develop
Choose a base branch
from
aperture147:add-bgra-cvmat-converter
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add QImage
and CV::Mat
conversion functions into Frame
for better handling alpha channel handling
#998
aperture147
wants to merge
12
commits into
OpenShot:develop
from
aperture147:add-bgra-cvmat-converter
+105
−33
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ss for better encapsulation
… for alpha support
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #998 +/- ##
===========================================
+ Coverage 57.31% 57.35% +0.04%
===========================================
Files 198 198
Lines 18166 18189 +23
===========================================
+ Hits 10412 10433 +21
- Misses 7754 7756 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces enhanced image effect capabilities for the
Frame
class by leveraging the OpenCV library. Direct manipulation ofQImage
raw data for complex effects proves challenging, and the performance ofQGraphicsEffect
can be suboptimal. To address these limitations, this PR proposes the integration of OpenCV for more efficient and versatile effect creation.While existing conversion functions between
QImage
andcv::Mat
inFrame.cpp
lack alpha channel support, several effects, including the currently implementedOutline
and the proposedShadow
, require it for proper rendering. This pull request introduces four new methods to facilitate seamless conversion betweenQImage
andcv::Mat
while preserving the alpha channel:QImage2BGRACvMat
: Converts aQImage
to acv::Mat
withBGRA
pixel format.BGRACvMat2QImage
: Converts acv::Mat
withBGRA
pixel format back to aQImage
.GetBGRACvMat
: Provides access to the underlyingcv::Mat
(inBGRA
format) of aFrame
object.SetBGRACvMat
: Allows setting thecv::Mat
(inBGRA
format) to aFrame
object.These conversion functions were previously located within the
Outline
effect code and have been migrated to theFrame
class for broader reusability. Your review and feedback on these additions would be greatly appreciated.Note: Theimagecv
variable, which appears to be a potentially unused cachedcv::Mat
, is currently shared across the code. While investigating its purpose, no clear or active usage was identified. The line intended for caching was also commented out. This aspect might warrant further review or potential removal in a subsequent cleanup.Now switched to
brga_image_cv
variable.