|
|
I'll look into the test/icon.cxx warnings next.
And so did I. buffer is definitely used uninitialized to create an Fl_RGB_Image with undefined pixel data. Then icon.color_average(c, 0.0); overwrites the undefined pixels with the value of c (by "averaging" 100% c, 0% original data). Not nice.
I can see two solutions:
- what happens if you move the declaration of buffer above choice_cb? This would init it with zeroes. The code would work but still be weird.
- instead of using color_average() we could init
buffer[] with appropriate values which would be 32 * 32 * (255, 0, 0) or (0, 255, 0) or (0, 0, 255), respectively.
The code would likely be longer but free of warnings and clear. Using color_average() is cool but hard to understand.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
[ Direct Link to Message ] | |
|
| |