HaxeFlixel / HaxeFlixel/flixel

Improve FlxBitmapDataUtil?

Open
#1,385 7 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.