FreeRDP
codec/bitmap.c File Reference
#include <freerdp/config.h>
#include <freerdp/codec/bitmap.h>
#include <freerdp/codec/planar.h>

Macros

#define OUT_COLOR_COUNT2(in_count, in_s, in_data)    in_count = out_color_count_2(in_count, in_s, in_data)
 
#define OUT_COLOR_COUNT3(in_count, in_s, in_data)    in_count = out_color_count_3(in_count, in_s, in_data)
 
#define OUT_COPY_COUNT2(in_count, in_s, in_data)    in_count = out_copy_count_2(in_count, in_s, in_data)
 
#define OUT_COPY_COUNT3(in_count, in_s, in_data)    in_count = out_copy_count_3(in_count, in_s, in_data)
 
#define OUT_BICOLOR_COUNT2(in_count, in_s, in_color1, in_color2)    in_count = out_bicolor_count_2(in_count, in_s, in_color1, in_color2)
 
#define OUT_BICOLOR_COUNT3(in_count, in_s, in_color1, in_color2)    in_count = out_bicolor_count_3(in_count, in_s, in_color1, in_color2)
 
#define OUT_FILL_COUNT2(in_count, in_s)   in_count = out_fill_count_2(in_count, in_s)
 
#define OUT_FILL_COUNT3(in_count, in_s)   in_count = out_fill_count_3(in_count, in_s)
 
#define OUT_MIX_COUNT2(in_count, in_s)   in_count = out_mix_count_2(in_count, in_s)
 
#define OUT_MIX_COUNT3(in_count, in_s)   in_count = out_mix_count_3(in_count, in_s)
 
#define OUT_FOM_COUNT2(in_count, in_s, in_mask, in_mask_len)    in_count = out_from_count_2(in_count, in_s, in_mask, in_mask_len)
 
#define OUT_FOM_COUNT3(in_count, in_s, in_mask, in_mask_len)    in_count = out_from_count_3(in_count, in_s, in_mask, in_mask_len)
 
#define TEST_FILL   ((last_line == 0 && pixel == 0) || (last_line != 0 && pixel == ypixel))
 
#define TEST_MIX   ((last_line == 0 && pixel == mix) || (last_line != 0 && pixel == (ypixel ^ mix)))
 
#define TEST_FOM   TEST_FILL || TEST_MIX
 
#define TEST_COLOR   pixel == last_pixel
 
#define TEST_BICOLOR
 
#define RESET_COUNTS
 

Functions

static INLINE UINT16 GETPIXEL16 (const void *d, UINT32 x, UINT32 y, UINT32 w)
 
static INLINE UINT32 GETPIXEL32 (const void *d, UINT32 x, UINT32 y, UINT32 w)
 
static INLINE UINT16 IN_PIXEL16 (const void *in_ptr, UINT32 in_x, UINT32 in_y, UINT32 in_w, UINT16 in_last_pixel)
 
static INLINE UINT32 IN_PIXEL32 (const void *in_ptr, UINT32 in_x, UINT32 in_y, UINT32 in_w, UINT32 in_last_pixel)
 
static UINT16 out_color_count_2 (UINT16 in_count, wStream *in_s, UINT16 in_data)
 
static UINT16 out_color_count_3 (UINT16 in_count, wStream *in_s, UINT32 in_data)
 
static INLINE UINT16 out_copy_count_2 (UINT16 in_count, wStream *in_s, wStream *in_data)
 
static INLINE UINT16 out_copy_count_3 (UINT16 in_count, wStream *in_s, wStream *in_data)
 
static INLINE UINT16 out_bicolor_count_2 (UINT16 in_count, wStream *in_s, UINT16 in_color1, UINT16 in_color2)
 
static INLINE UINT16 out_bicolor_count_3 (UINT16 in_count, wStream *in_s, UINT32 in_color1, UINT32 in_color2)
 
static INLINE UINT16 out_fill_count_2 (UINT16 in_count, wStream *in_s)
 
static INLINE UINT16 out_fill_count_3 (UINT16 in_count, wStream *in_s)
 
static INLINE UINT16 out_mix_count_2 (UINT16 in_count, wStream *in_s)
 
static INLINE UINT16 out_mix_count_3 (UINT16 in_count, wStream *in_s)
 
static INLINE UINT16 out_from_count_2 (UINT16 in_count, wStream *in_s, const char *in_mask, size_t in_mask_len)
 
static INLINE UINT16 out_from_count_3 (UINT16 in_count, wStream *in_s, const char *in_mask, size_t in_mask_len)
 
static SSIZE_T freerdp_bitmap_compress_24 (const void *srcData, UINT32 width, UINT32 height, wStream *s, UINT32 byte_limit, UINT32 start_line, wStream *temp_s, UINT32 e)
 
static SSIZE_T freerdp_bitmap_compress_16 (const void *srcData, UINT32 width, UINT32 height, wStream *s, UINT32 bpp, UINT32 byte_limit, UINT32 start_line, wStream *temp_s, UINT32 e)
 
SSIZE_T freerdp_bitmap_compress (const void *srcData, UINT32 width, UINT32 height, wStream *s, UINT32 bpp, UINT32 byte_limit, UINT32 start_line, wStream *temp_s, UINT32 e)
 

Macro Definition Documentation

◆ OUT_BICOLOR_COUNT2

#define OUT_BICOLOR_COUNT2 (   in_count,
  in_s,
  in_color1,
  in_color2 
)     in_count = out_bicolor_count_2(in_count, in_s, in_color1, in_color2)

◆ OUT_BICOLOR_COUNT3

#define OUT_BICOLOR_COUNT3 (   in_count,
  in_s,
  in_color1,
  in_color2 
)     in_count = out_bicolor_count_3(in_count, in_s, in_color1, in_color2)

◆ OUT_COLOR_COUNT2

#define OUT_COLOR_COUNT2 (   in_count,
  in_s,
  in_data 
)     in_count = out_color_count_2(in_count, in_s, in_data)

◆ OUT_COLOR_COUNT3

#define OUT_COLOR_COUNT3 (   in_count,
  in_s,
  in_data 
)     in_count = out_color_count_3(in_count, in_s, in_data)

◆ OUT_COPY_COUNT2

#define OUT_COPY_COUNT2 (   in_count,
  in_s,
  in_data 
)     in_count = out_copy_count_2(in_count, in_s, in_data)

◆ OUT_COPY_COUNT3

#define OUT_COPY_COUNT3 (   in_count,
  in_s,
  in_data 
)     in_count = out_copy_count_3(in_count, in_s, in_data)

◆ OUT_FILL_COUNT2

#define OUT_FILL_COUNT2 (   in_count,
  in_s 
)    in_count = out_fill_count_2(in_count, in_s)

◆ OUT_FILL_COUNT3

#define OUT_FILL_COUNT3 (   in_count,
  in_s 
)    in_count = out_fill_count_3(in_count, in_s)

◆ OUT_FOM_COUNT2

#define OUT_FOM_COUNT2 (   in_count,
  in_s,
  in_mask,
  in_mask_len 
)     in_count = out_from_count_2(in_count, in_s, in_mask, in_mask_len)

◆ OUT_FOM_COUNT3

#define OUT_FOM_COUNT3 (   in_count,
  in_s,
  in_mask,
  in_mask_len 
)     in_count = out_from_count_3(in_count, in_s, in_mask, in_mask_len)

◆ OUT_MIX_COUNT2

#define OUT_MIX_COUNT2 (   in_count,
  in_s 
)    in_count = out_mix_count_2(in_count, in_s)

◆ OUT_MIX_COUNT3

#define OUT_MIX_COUNT3 (   in_count,
  in_s 
)    in_count = out_mix_count_3(in_count, in_s)

◆ RESET_COUNTS

#define RESET_COUNTS
Value:
do \
{ \
bicolor_count = 0; \
fill_count = 0; \
color_count = 0; \
mix_count = 0; \
fom_count = 0; \
fom_mask_len = 0; \
bicolor_spin = FALSE; \
} while (0)

◆ TEST_BICOLOR

#define TEST_BICOLOR
Value:
((pixel != last_pixel) && \
((!bicolor_spin && (pixel == bicolor1) && (last_pixel == bicolor2)) || \
(bicolor_spin && (pixel == bicolor2) && (last_pixel == bicolor1))))

◆ TEST_COLOR

#define TEST_COLOR   pixel == last_pixel

◆ TEST_FILL

#define TEST_FILL   ((last_line == 0 && pixel == 0) || (last_line != 0 && pixel == ypixel))

◆ TEST_FOM

#define TEST_FOM   TEST_FILL || TEST_MIX

◆ TEST_MIX

#define TEST_MIX   ((last_line == 0 && pixel == mix) || (last_line != 0 && pixel == (ypixel ^ mix)))

Function Documentation

◆ freerdp_bitmap_compress()

SSIZE_T freerdp_bitmap_compress ( const void *  in_data,
UINT32  width,
UINT32  height,
wStream s,
UINT32  bpp,
UINT32  byte_limit,
UINT32  start_line,
wStream temp_s,
UINT32  e 
)

FreeRDP: A Remote Desktop Protocol Implementation Compressed Bitmap

Copyright 2011 Jay Sorg jay.s.nosp@m.org@.nosp@m.gmail.nosp@m..com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_bitmap_compress_16()

static SSIZE_T freerdp_bitmap_compress_16 ( const void *  srcData,
UINT32  width,
UINT32  height,
wStream s,
UINT32  bpp,
UINT32  byte_limit,
UINT32  start_line,
wStream temp_s,
UINT32  e 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_bitmap_compress_24()

static SSIZE_T freerdp_bitmap_compress_24 ( const void *  srcData,
UINT32  width,
UINT32  height,
wStream s,
UINT32  byte_limit,
UINT32  start_line,
wStream temp_s,
UINT32  e 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GETPIXEL16()

static INLINE UINT16 GETPIXEL16 ( const void *  d,
UINT32  x,
UINT32  y,
UINT32  w 
)
static

FreeRDP: A Remote Desktop Protocol Implementation Bitmap Compression

Copyright 2004-2012 Jay Sorg jay.s.nosp@m.org@.nosp@m.gmail.nosp@m..com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Here is the caller graph for this function:

◆ GETPIXEL32()

static INLINE UINT32 GETPIXEL32 ( const void *  d,
UINT32  x,
UINT32  y,
UINT32  w 
)
static
Here is the caller graph for this function:

◆ IN_PIXEL16()

static INLINE UINT16 IN_PIXEL16 ( const void *  in_ptr,
UINT32  in_x,
UINT32  in_y,
UINT32  in_w,
UINT16  in_last_pixel 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IN_PIXEL32()

static INLINE UINT32 IN_PIXEL32 ( const void *  in_ptr,
UINT32  in_x,
UINT32  in_y,
UINT32  in_w,
UINT32  in_last_pixel 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ out_bicolor_count_2()

static INLINE UINT16 out_bicolor_count_2 ( UINT16  in_count,
wStream in_s,
UINT16  in_color1,
UINT16  in_color2 
)
static
Here is the call graph for this function:

◆ out_bicolor_count_3()

static INLINE UINT16 out_bicolor_count_3 ( UINT16  in_count,
wStream in_s,
UINT32  in_color1,
UINT32  in_color2 
)
static
Here is the call graph for this function:

◆ out_color_count_2()

static UINT16 out_color_count_2 ( UINT16  in_count,
wStream in_s,
UINT16  in_data 
)
static
Here is the call graph for this function:

◆ out_color_count_3()

static UINT16 out_color_count_3 ( UINT16  in_count,
wStream in_s,
UINT32  in_data 
)
static
Here is the call graph for this function:

◆ out_copy_count_2()

static INLINE UINT16 out_copy_count_2 ( UINT16  in_count,
wStream in_s,
wStream in_data 
)
static
Here is the call graph for this function:

◆ out_copy_count_3()

static INLINE UINT16 out_copy_count_3 ( UINT16  in_count,
wStream in_s,
wStream in_data 
)
static
Here is the call graph for this function:

◆ out_fill_count_2()

static INLINE UINT16 out_fill_count_2 ( UINT16  in_count,
wStream in_s 
)
static
Here is the call graph for this function:

◆ out_fill_count_3()

static INLINE UINT16 out_fill_count_3 ( UINT16  in_count,
wStream in_s 
)
static
Here is the call graph for this function:

◆ out_from_count_2()

static INLINE UINT16 out_from_count_2 ( UINT16  in_count,
wStream in_s,
const char *  in_mask,
size_t  in_mask_len 
)
static
Here is the call graph for this function:

◆ out_from_count_3()

static INLINE UINT16 out_from_count_3 ( UINT16  in_count,
wStream in_s,
const char *  in_mask,
size_t  in_mask_len 
)
static
Here is the call graph for this function:

◆ out_mix_count_2()

static INLINE UINT16 out_mix_count_2 ( UINT16  in_count,
wStream in_s 
)
static
Here is the call graph for this function:

◆ out_mix_count_3()

static INLINE UINT16 out_mix_count_3 ( UINT16  in_count,
wStream in_s 
)
static
Here is the call graph for this function: