C++でBGRAバッファをRGBAバッファ形式に変換するにはどうすればよいですか?
void ConvertBetweenBGRAandRGBA(unsigned char* input, int pixel_width,int pixel_hight,
unsigned char* output) {
for (int y = 0; y < pixel_hight; y++) {
for (int x = 0; x < pixel_width; x++) {
const unsigned char* pixel_in = &input[y * x * 4];
unsigned char* pixel_out = &output[y * x * 4];
pixel_out[0] = pixel_in[2];
pixel_out[1] = pixel_in[1];
pixel_out[2] = pixel_in[0];
pixel_out[3] = pixel_in[3];
}
}
しかし、背景色が表示されません。
pls誰かが私を助けますか?