48 int width,
int height,
int pitch,
49 std::vector<unsigned char>& buffer)
52 size_t bytes = width * height * 3;
61 nvjpegImage_t nv_image;
62 nv_image.channel[0] = (
unsigned char*)
cudaBuffer.ptr;
63 nv_image.pitch[0] = width * 3;
66 &nv_image, NVJPEG_INPUT_RGBI, width, height, NULL));
74 if (buffer.size() < length) buffer.resize(length);