I need to write a custom Bitmapeffect for a project I am working on and have sound a surprising absence of samples and details about how to make anything work. Even more depressing is that even after I found RGBFilterEffect in the SDK, it didn't compile, and then it crashed, and then it required com registration, and on and on.
Lou Franco presents an interesting idea that branches off the sample, write the BitmapEffect in C++/CLI and then you can package the managed and unmanaged code in a single assembly. Furthermore since the unmanaged half is living in the same assembly, a little bit of COM goo (that I frankly don't understand) removes the requirement of COM registration, and restores our favorite CLR x-copy deployment paradigm.
Unfortunately, Lou, doesn't give a complete sample and his code doesn't quite compile. I spent the better part of two days mucking around in C++/CLI, a language I don't really understand, to get everything pasted together and working. I thought I would share the result.
For those of you, like me who couldn't care less about the pipes and just want to muck with the pixels look in in the RGBFilterEffect.CPP CRGBFilterEffect::GetOutput