Reputation: 229
I want to write a graphics library for image processing and computer vision. Because the algorithms are sometimes very slow on big images, I want to use the PixelShader of the graphics card to do this.
Because I write the application in C# I do not want to use DirectX direct. I want to use the XNA libraries, because this is the only way for simply doing such things, which I know. The problem is, that I have no idea how I could design the library correct.
XNA needs a graphics device, which needs a window handle for creation (is there any way to fool this?), which the calling class eventually hasn't, because of the class design of the calling programm(for example in a MVVM application the Model has not the window handle).
The other thing is, that I have to load the shader as a Effect, which is normaly done by a content manager, but this is also not the perfect solution for a class library, I think (here an alternative way of loading the effect would help).
So is there any way of solving these not so optimal things or is there another way of using the graphics card for image processing in C#? I hope my question is clear, if not, please let it know.
Upvotes: 0
Views: 1117
Reputation: 3358
Well, you've explained it nicely to yourself why using game library like XNA (and XNA really is more of 'game' library than graphics library) might not be good to create a library that'll perform processing on the GPU. With that observation, you should try to search something else like:
C
stands for computing, so it's what you wantUpvotes: 1