Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
uint16_t linesize;
char *src = bmp_addr;
char *dst = pdst;
uint16_t linesize;
char *src = bmp_addr;
char *dst = pdst;
bool flip = false;
memcpy(&header, src, sizeof(header));
bool flip = false;
memcpy(&header, src, sizeof(header));
src += (*width) * (*height - 1) * 3;
for (i = 0; i < *height; i++) {
src += (*width) * (*height - 1) * 3;
for (i = 0; i < *height; i++) {
- for (j = 0; j < *width; j++) {
- dst[0] = src[2];
- dst[1] = src[1];
- dst[2] = src[0];
- dst += 3;
- src += 3;
- }
+ memcpy(dst, src, 3 * (*width));
+ dst += *width * 3;
+ src += *width * 3;
if (flip)
src -= *width * 3 * 2;
}
if (flip)
src -= *width * 3 * 2;
}