Excise y-inversion code
parent
9501a1da64
commit
e9f200f4cc
|
@ -32,10 +32,6 @@ enum nvnc_button_mask {
|
|||
NVNC_SCROLL_DOWN = 1 << 4,
|
||||
};
|
||||
|
||||
enum nvnc_modifier {
|
||||
NVNC_MOD_Y_INVERT = 1 << 0,
|
||||
};
|
||||
|
||||
typedef void (*nvnc_key_fn)(struct nvnc_client*, uint32_t keysym, bool is_pressed);
|
||||
typedef void (*nvnc_pointer_fn)(struct nvnc_client*, uint16_t x, uint16_t y,
|
||||
enum nvnc_button_mask);
|
||||
|
|
|
@ -26,15 +26,9 @@ int raw_encode_box(struct vec *dst, const struct rfb_pixel_format *dst_fmt,
|
|||
|
||||
uint32_t* b = fb->addr;
|
||||
|
||||
if (false) {
|
||||
for (int y = y_start; y < y_start + height; ++y)
|
||||
for (int x = x_start; x < x_start + width; ++x)
|
||||
vec_fast_append_32(dst, b[x + (fb->height - y - 1) * stride]);
|
||||
} else {
|
||||
for (int y = y_start; y < y_start + height; ++y)
|
||||
for (int x = x_start; x < x_start + width; ++x)
|
||||
vec_fast_append_32(dst, b[x + y * stride]);
|
||||
}
|
||||
for (int y = y_start; y < y_start + height; ++y)
|
||||
for (int x = x_start; x < x_start + width; ++x)
|
||||
vec_fast_append_32(dst, b[x + y * stride]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
14
src/zrle.c
14
src/zrle.c
|
@ -139,15 +139,10 @@ void zrle_encode_packed_tile(struct vec *dst,
|
|||
}
|
||||
|
||||
void zrle_copy_tile(uint32_t *dst, const uint32_t *src, int stride,
|
||||
int width, int height, enum nvnc_modifier mod)
|
||||
int width, int height)
|
||||
{
|
||||
for (int y = 0; y < height; ++y) {
|
||||
if (!(mod & NVNC_MOD_Y_INVERT))
|
||||
memcpy(dst + y * width, src + y * stride, width * 4);
|
||||
else
|
||||
memcpy(dst + (height - y - 1) * width, src + y * stride,
|
||||
width * 4);
|
||||
}
|
||||
for (int y = 0; y < height; ++y)
|
||||
memcpy(dst + y * width, src + y * stride, width * 4);
|
||||
}
|
||||
|
||||
void zrle_encode_tile(struct vec *dst, const struct rfb_pixel_format *dst_fmt,
|
||||
|
@ -255,8 +250,7 @@ int zrle_encode_box(struct vec* out, const struct rfb_pixel_format *dst_fmt,
|
|||
|
||||
zrle_copy_tile(tile,
|
||||
((uint32_t*)fb->addr) + x + tile_x + y_off * stride,
|
||||
stride, tile_width, tile_height,
|
||||
0);
|
||||
stride, tile_width, tile_height);
|
||||
|
||||
zrle_encode_tile(&in, dst_fmt, tile, src_fmt,
|
||||
tile_width * tile_height);
|
||||
|
|
Loading…
Reference in New Issue