error: no instance of overloaded function "tex2D" matches the argument list
argument types are: (texture<uchar3, 2, cudaReadModeElementType>, int, int)
“a texel … is restricted to the basic integer and single-precision floating-point types and any of the 1-, 2-, and 4-component vector types defined in char, short, int, long, longlong, float, double that are derived from the basic integer and single-precision floating-point types.”
If you want to texture against RGB, you could use uchar4, and ignore the 4th component in subsequent calculations (e.g. your own interpolation calculations). This will require the underlying storage to be arranged as uchar4, e.g. RGBA, not uchar3.
If you mean use the built-in interpolation capabilities of the texture hardware, you’ll need to be more specific with an example of what you have in mind.
I treat the images as one-channel images with three times the width and bind a texture to the one-channel image.
But note for accessing pixels outside of the image dimension you won’t get the right value (according to specified border mode) from the texture hardward - so you have to implement yourself. The same applies for interpolation - you have to implement it yourself, the value delivered from texture hardware is wrong.
You can ‘hide’ all that dirty stuff inside short access functions. The additional overhead does not seem to be a problem in practice.
An other question about cudaBinTexture2d, about the height and width parameters.
Are the width always had to be greater than height? Because I had images in landscape mode and the function send me error with these images.