How to address a cv::cuda::GpuMat variable, passed to kernel as cv::cudaPtrStepSz?

Unless I’m missing something it should be

const unsigned char blue = input(yidx, xidx);
const unsigned char green = input(yidx, xidx+1);
const unsigned char red = input(yidx, xidx+2);