HaxeFlixel / HaxeFlixel/flixel
Improve FlxBitmapDataUtil?
Nobody has claimed this yet.
- Dominant language
- Haxe
- Stars
- 2.2k
- Forks
- 522
- Avg merge
- 34m
- Merged PRs (30d)
- 1
Description
Related to this forum topic.
I agree the OP there should use a ColorTransform for the job. Nevertheless I think that pixel manipulation performance in FlxBitmapDataUtil could be improved by using BitmapData.get/setPixels().
Does anyone have any test/benchmark code for merge()/compare()/replaceColor()? (@Beeblerox maybe?).
As a side note: I think BitmapData.threshold() has already been implemented in Openfl (maybe missing only for the js target?!), so for simpler use cases (like when there's no need to fetchPositions) it might be a faster approach.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with FlxBitmapDataUtil's merge(), compare(), and replaceColor() methods, then review the linked forum topic and BitmapData.get/setPixels() and threshold() APIs. Add benchmark coverage for the three utility methods and compare the relevant targets; done means the performance question has measured results and an agreed implementation scope.
Written by the indexing model from the issue text.
Assessment
- Domain
- computer-graphics, performance
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100