joelcarlson / RImagePalette

Create a representative palette from an image.
https://github.com/joelcarlson/RImagePalette
Other
45 stars 1 forks source link

Use C++ for median cut #2

Open joelcarlson opened 8 years ago

joelcarlson commented 8 years ago

Currently, the implementation of median cut is in R, and uses lists. This is not efficient as every time you modify a list in R it is copied.

Converting this to C++ would greatly speed up the process. Would also allow use of push and pop, which are missing from R lists.

Ironholds commented 8 years ago

Want me to tackle this? I do enjoy Rcpp.

joelcarlson commented 8 years ago

If you're up for it, I would be delighted! Would involve a pretty significant rewrite, but could be pretty fun. This website may be of some use:

http://en.literateprograms.org/Median_cut_algorithm_(C_Plus_Plus)

Ironholds commented 8 years ago

Cool! I'm not sure quite when I'll get to it but it looks like a fun problem.