Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
41d0ef0f
Commit
41d0ef0f
authored
Nov 30, 2020
by
Christoffer Ackelman
Committed by
Esteban Blanc
Dec 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QT: Fixed the image_pixel_iter image postprocessing function.
parent
dd794844
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
18 deletions
+12
-18
xtt/lib/glow/qt/glow_draw_qt.cqt
xtt/lib/glow/qt/glow_draw_qt.cqt
+12
-18
No files found.
xtt/lib/glow/qt/glow_draw_qt.cqt
View file @
41d0ef0f
...
@@ -2328,36 +2328,30 @@ void GlowDrawQt::image_pixel_iter(glow_tImImage orig_image,
...
@@ -2328,36 +2328,30 @@ void GlowDrawQt::image_pixel_iter(glow_tImImage orig_image,
glow_tImImage* image, void (*pixel_cb)(void*, unsigned char*),
glow_tImImage* image, void (*pixel_cb)(void*, unsigned char*),
void* userdata)
void* userdata)
{
{
unsigned char *rgb, *rgb_row;
QImage img;
int rgb_height;
int rgb_width;
int rowstride;
if (orig_image) {
if (orig_image) {
if (image && *image != orig_image) {
if (image && *image != orig_image) {
delete ((QImage*)*image);
delete ((QImage*)*image);
}
}
*((QImage*)*image) = ((QImage*)orig_image)->copy(
);
img = ((QImage*)orig_image)->convertToFormat(QImage::Format_ARGB32
);
} else if (!*image) {
} else if (!*image) {
return;
return;
} else {
img = ((QImage*)*image)->convertToFormat(QImage::Format_ARGB32);
}
}
rgb = ((QImage*)*image)->convertToFormat(QImage::Format_ARGB32).bits();
unsigned char* rgb_row = img.bits();
rgb_height = ((QImage*)*image)->height();
for (int j = 0; j < img.height(); j++) {
rgb_width = ((QImage*)*image)->width();
unsigned char* rgb = rgb_row;
rowstride = ((QImage*)*image)->bytesPerLine();
for (int i = 0; i < img.width(); i++) {
if (*(rgb)) {
rgb_row = rgb;
(pixel_cb)(userdata, rgb+1);
for (int j = 0; j < rgb_height; j++) {
rgb = rgb_row;
for (int i = 0; i < rgb_width; i++) {
if (*(rgb + 3)) {
(pixel_cb)(userdata, rgb);
}
}
rgb += 4;
rgb += 4;
}
}
rgb_row +=
rowstride
;
rgb_row +=
img.bytesPerLine()
;
}
}
*image = new QImage(img);
}
}
int GlowDrawQt::gradient_create_pattern(int x, int y, int w, int h,
int GlowDrawQt::gradient_create_pattern(int x, int y, int w, int h,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment