/*****************************************************************************/ int
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 error; int i; int j; unsignedint pixel; unsignedint *src32; unsignedint *dst32; unsignedlong cdata_bytes; unsignedchar *src_buf; unsignedchar *dst_buf; char *temp_buf;
tjhandle tj_han;
int
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; unsignedlong lio_len;
/*****************************************************************************/ /* called when buffer is full and we need more space */ staticint
my_empty_output_buffer(j_compress_ptr cinfo)
{ struct mydata_comp *md; int chunk_bytes;
/*****************************************************************************/ /* called at end */ staticvoid
my_term_destination(j_compress_ptr cinfo)
{ struct mydata_comp *md; int chunk_bytes;
/*****************************************************************************/ staticint
jpeg_compress(char *in_data, int width, int height, struct stream *s, struct stream *temp_s, int bpp, int byte_limit, int e, int quality)
{
JOCTET *data;
tui32 *src32;
tui8 *dst8;
tui32 pixel; int red; int blue; int green; int j; int i; int cdata_bytes;
data = (JOCTET *) temp_s->data;
dst8 = data;
if (bpp == 24)
{
src32 = (tui32 *)in_data;
for (j = 0; j < height; j++)
{ for (i = 0; i < width; i++)
{
pixel = src32[i + j * width];
SPLITCOLOR32(red, green, blue, pixel);
*(dst8++) = blue;
*(dst8++) = green;
*(dst8++) = red;
}
if (width > 0)
{ for (i = 0; i < e; i++)
{
*(dst8++) = blue;
*(dst8++) = green;
*(dst8++) = red;
}
}
}
} else
{
LOG(LOG_LEVEL_WARNING, "bpp wrong %d", bpp);
}
/*****************************************************************************/ int
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)
{
jpeg_compress(in_data, width, height, s, temp_s, bpp, byte_limit,
e, quality); return height;
}
/*****************************************************************************/ int
xrdp_codec_jpeg_compress(void *handle, int format, char *inp_data, int width, int height, int stride, int x, int y, int cx, int cy, int quality, char *out_data, int *io_len)
{ return0;
}
/*****************************************************************************/ int
xrdp_jpeg_deinit(void *handle)
{ return0;
}
#else
/*****************************************************************************/ int
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)
{ return height;
}
/*****************************************************************************/ int
xrdp_codec_jpeg_compress(void *handle, int format, char *inp_data, int width, int height, int stride, int x, int y, int cx, int cy, int quality, char *out_data, int *io_len)
{ return0;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.