added code for region copy used in codec mode

This commit is contained in:
Laxmikant Rashinkar
2014-01-20 17:48:17 -08:00
parent b001b9432a
commit 6cd342a20a
6 changed files with 216 additions and 3 deletions
+19 -1
View File
@@ -221,7 +221,7 @@ struct xrdp_orders_state
int com_blt_width; /* 2 */
int com_blt_height; /* 2 */
int com_blt_dstformat; /* 2 */
};
/* orders */
@@ -473,6 +473,24 @@ xrdp_jpeg_compress(void *handle, char* in_data, int width, int height,
struct stream* s, int bpp, int byte_limit,
int start_line, struct stream* temp_s,
int e, int quality);
int APP_CC
xrdp_codec_jpeg_compress(void *handle,
int format, /* input data format */
char *inp_data, /* input data */
int width, /* width of inp_data */
int height, /* height of inp_data */
int stride, /* inp_data stride, in bytes*/
int x, /* x loc in inp_data */
int y, /* y loc in inp_data */
int cx, /* width of area to compress */
int cy, /* height of area to compress */
int quality, /* higher numbers compress less */
char *out_data, /* dest for jpg image */
int *io_len /* length of out_data and on return */
/* len of compressed data */
);
void *APP_CC
xrdp_jpeg_init(void);
int APP_CC
+61
View File
@@ -98,6 +98,67 @@ xrdp_jpeg_compress(void *handle, char *in_data, int width, int height,
return height;
}
/**
* Compress a rectangular area (aka inner rectangle) inside our
* frame buffer (inp_data)
*****************************************************************************/
int APP_CC
xrdp_codec_jpeg_compress(void *handle,
int format, /* input data format */
char *inp_data, /* input data */
int width, /* width of inp_data */
int height, /* height of inp_data */
int stride, /* inp_data stride, in bytes*/
int x, /* x loc in inp_data */
int y, /* y loc in inp_data */
int cx, /* width of area to compress */
int cy, /* height of area to compress */
int quality, /* higher numbers compress less */
char *out_data, /* dest for jpg image */
int *io_len /* length of out_data and on return */
/* len of compressed data */
)
{
tjhandle tj_han;
int error;
int bpp;
char *src_ptr;
/*
* note: for now we assume that format is always XBGR and ignore format
*/
if (handle == 0)
{
g_writeln("xrdp_codec_jpeg_compress: handle is nil");
return height;
}
tj_han = (tjhandle) handle;
/* get bytes per pixel */
bpp = stride / width;
/* start of inner rect in inp_data */
src_ptr = inp_data + (y * stride + x * bpp);
/* compress inner rect */
error = tjCompress(tj_han, /* opaque handle */
src_ptr, /* source buf */
cx, /* width of area to compress */
stride, /* pitch */
cy, /* height of area to compress */
TJPF_XBGR, /* pixel size */
out_data, /* dest buf */
io_len, /* inner_buf length & compressed_size */
TJSAMP_420, /* jpeg sub sample */
quality, /* jpeg quality */
0 /* flags */
);
return height;
}
/*****************************************************************************/
void *APP_CC
xrdp_jpeg_init(void)