Repository navigation
refactor: port more layers to Cobra renderer: HalfTone2 & 3 - #3300
Conversation
|
Remaining layers without Cobra support:
|
3e8c8df to
886a867
Compare
|
Hi @rodolforg! I have tested this branch, comparing with results of Synfig 1.0.2. Here is a test set - Render results from version 1.0.2 - Render results from this PR - You were right about 1px offset - it is still present for Halftone2 and Halftone3 in this PR. I was expected it will disappear, because they are ported to Cobra. But for some reason the offset is still here. I think the problem is because you use This will change how you interact with context So, I suggest to replace this line: to this: Please take a look at Blur module to see how it is handled for You can use |
0924537 to
62fc197
Compare
9136d6f to
9999828
Compare
|
I have made more tests for Halftone 2 And I see differences in results - It is shift again, but it is different kind. Please see the test file |
0c8adcb to
be8b8a1
Compare
|
Hi! Thank you for the fixes! My previous tests now giving identical results with earlier Synfig version (1.0.2). But I found 2 cases, which give non-identical results:
This is result from the latest PR It seems like the problem in direction of rotation
This is result from the latest PR My Halftone 3 tests are failing too. Looks like it is because the same problem with Angle parameter - |
be8b8a1 to
18b8208
Compare
0924537 to
7d4e65f
Compare
|
@morevnaproject rebased and I believe I fixed the pointed issues. |
|
Thank you so much for testing, @Zloi-KoteikA ! The image layer itself has this displacement/shift/offset/bias :) Is HalfTone3 OK too? |
|
I tried to disable Halftone. @rodolforg, you're right . This is the offset of the image layer. Versions 1.0.2 and PR have no difference. |
7d4e65f to
d7e1b57
Compare
|
Rebased to master branch and fixed some typos in the last commit message. |
d7e1b57 to
af34d26
Compare
af34d26 to
dbc5b43
Compare
|
Сonducted tests of these files (https://github.com/user-attachments/files/16581023/halftone3.zip). Results are identical to version 1.0.2. |
not at every pixel
This PR creates a new interface for rendering Transformation for TaskFilterPixelSW (actually TaskHalftone2 & TaskHalftone3). For better layer rendering, it lets the transformations of upper layers be propagated to lower layers (in other words, pass through this task), as TaskInterfaceTransformationPass does. Differently of the latter, though, this new interface, called TaskInterfaceTransformationGetAndPass, pass the transformation matrix not only to lower (i.e. context) layer, but to this task too. HalfTone2 and HalfTone3 layers create masks with shapes that are affected by the upper transformations, and that is the reason to create this new interface. So, the lower layers are better rendered due to the propagation of the upper transformations (more precise rendering), as the same time as the filter mask is correctly build with such transformation info.
dbc5b43 to
ac871ad
Compare
|
|
||
| void pre_run(const Matrix3& /*matrix*/) const override | ||
| { | ||
| supersample_size = 1/std::fabs(get_pixels_per_unit()[0]*(halftone.param_size.get(Vector())).mag()); |
There was a problem hiding this comment.
Looks like possible division on zero
| if (task) | ||
| synfig::error(_("Internal error: Cobra task %s isn't a TaskPixelProcessorBase"), task->get_token()->name.c_str()); | ||
| else | ||
| synfig::error(_("Internal error: this TaskPaintPixelSW isn't even a Task")); |
There was a problem hiding this comment.
Is this correct?
I mean TaskPaintPixelSW? Looks like should be TaskFilterPixelSW?
|
|
||
| void pre_run(const Matrix3& /*matrix*/) const override | ||
| { | ||
| supersample = 1/std::fabs(get_pixels_per_unit()[0]*(tone[0].param_size.get(Vector())).mag()); |
There was a problem hiding this comment.
Looks like possible division on zero
|
Merged. Thank you! |









No description provided.