Comments (11)
How goes the progress in fixing this?
from graphics32.
I'm busy with other stuff so I'm not working on it (which is why I haven't assigned it to myself)
from graphics32.
That's fair. I saw that you made a commit related to the bug and thought initially that the bug had been fixed, but a closer look at the commit messages indicates that it's not all fixed yet. Still, these messages will indicate that the issue is still open.
from graphics32.
For reference, what we need is a replacement for the current (broken) algorithm:
function MirrorPow2(Value, Max: Integer): Integer; overload;
begin
if Value and (Max + 1) = 0 then
Result := Value and Max
else
Result := Max - Value and Max;
end;
MirrorPow([0..13], 3)
Expected: 0123210123210
Actual: 0123210301232
from graphics32.
I'll take a study of the file myself at some point. I'm curious to know what the function is supposed to do exactly.
from graphics32.
The Clamp
, Wrap
, and Mirror
functions are primarily used when sampling bitmaps (e.g. resizing, rotating, transforming, etc). They specify how out of bounds pixel coordinates should be handled.
https://graphics32.github.io/Docs/Units/GR32/Types/TWrapMode.htm
from graphics32.
Ah I see, thank you. Having played with textures in OpenGL, I can definitely see the importance of getting this function correct then!
from graphics32.
...and also used by some gradient functions: https://graphics32.github.io/Docs/Units/GR32_ColorGradients/Classes/TCustomGradientPolygonFiller/Properties/WrapMode.htm
from graphics32.
I can definitely see the importance of getting this function correct then!
I would think so but the bug has been there since the functions introduction in 2007...
from graphics32.
Sorry I didn't notice that it was resolved in new branch
graphics32/Source/GR32_LowLevel.pas
Lines 1255 to 1265 in a322add
Test on GradFills example :
Original mirror :
After correction
from graphics32.
@lamdalili Thanks but the Mirror function has already been fixed in the LowLevel.Mirror branch:
graphics32/Source/GR32_LowLevel.pas
Lines 1255 to 1265 in a322add
What remains to be fixed is the MirrorPow2 function:
graphics32/Source/GR32_LowLevel.pas
Lines 1321 to 1330 in a322add
See: #291 (comment)
from graphics32.
Related Issues (20)
- Repaint Optimizer "forgets" to update the bitmap HOT 2
- Repaint Optimizer "forgets" to update the bitmap 2 HOT 7
- Polygon grow using Clipper2 very very slow HOT 43
- Delphi 12 incompatibility HOT 1
- Polygon draw result looks strange HOT 18
- Revive jsRoundEx? HOT 1
- Lazarus design time support broken HOT 21
- TBitmap32.Textout interesting behavior HOT 12
- PNG support broken on 32-bit FPC HOT 4
- LF Line Endings in the .DPKs Cause File Corruption HOT 18
- Access Violation with color picker controls on Lazarus HOT 2
- BuildPolyLine produces concave curves that are unsuitable for polylines HOT 13
- TColorPickerGTK not displayed correctely after copy/paste HOT 4
- NeoLemmix / SuperLemmix pull request
- Commit "Fix for AV with tiled draw" breaks my code HOT 7
- Bug with layes visibility change HOT 15
- Repaint TCustomLayer and draw TBitmapLayer at the same time HOT 13
- TGaussianKernel is broken HOT 1
- GAMMA_ENCODING_TABLE mayhem HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphics32.