FreeRDP
codec/region.c File Reference
#include <assert.h>
#include <winpr/memory.h>
#include <freerdp/log.h>
#include <freerdp/codec/region.h>

Macros

#define TAG   FREERDP_TAG("codec")
 

Functions

void region16_init (REGION16 *region)
 
int region16_n_rects (const REGION16 *region)
 
const RECTANGLE_16 * region16_rects (const REGION16 *region, UINT32 *nbRects)
 
static INLINE RECTANGLE_16 * region16_rects_noconst (REGION16 *region)
 
const RECTANGLE_16 * region16_extents (const REGION16 *region)
 
static RECTANGLE_16 * region16_extents_noconst (REGION16 *region)
 
BOOL rectangle_is_empty (const RECTANGLE_16 *rect)
 
BOOL region16_is_empty (const REGION16 *region)
 
BOOL rectangles_equal (const RECTANGLE_16 *r1, const RECTANGLE_16 *r2)
 
BOOL rectangles_intersects (const RECTANGLE_16 *r1, const RECTANGLE_16 *r2)
 
BOOL rectangles_intersection (const RECTANGLE_16 *r1, const RECTANGLE_16 *r2, RECTANGLE_16 *dst)
 
void region16_clear (REGION16 *region)
 
static INLINE REGION16_DATA * allocateRegion (long nbItems)
 
BOOL region16_copy (REGION16 *dst, const REGION16 *src)
 
void region16_print (const REGION16 *region)
 
static void region16_copy_band_with_union (RECTANGLE_16 *dst, const RECTANGLE_16 *src, const RECTANGLE_16 *end, UINT16 newTop, UINT16 newBottom, const RECTANGLE_16 *unionRect, UINT32 *dstCounter, const RECTANGLE_16 **srcPtr, RECTANGLE_16 **dstPtr)
 
static RECTANGLE_16 * next_band (RECTANGLE_16 *band1, RECTANGLE_16 *endPtr, int *nbItems)
 
static BOOL band_match (const RECTANGLE_16 *band1, const RECTANGLE_16 *band2, RECTANGLE_16 *endPtr)
 
static BOOL rectangle_contained_in_band (const RECTANGLE_16 *band, const RECTANGLE_16 *endPtr, const RECTANGLE_16 *rect)
 
static BOOL region16_simplify_bands (REGION16 *region)
 
BOOL region16_union_rect (REGION16 *dst, const REGION16 *src, const RECTANGLE_16 *rect)
 
BOOL region16_intersects_rect (const REGION16 *src, const RECTANGLE_16 *arg2)
 
BOOL region16_intersect_rect (REGION16 *dst, const REGION16 *src, const RECTANGLE_16 *rect)
 
void region16_uninit (REGION16 *region)
 

Variables

static REGION16_DATA empty_region = { 0, 0 }
 

Macro Definition Documentation

#define TAG   FREERDP_TAG("codec")

FreeRDP: A Remote Desktop Protocol Implementation

Copyright 2014 Thincast Technologies GmbH Copyright 2014 Hardening conta.nosp@m.ct@h.nosp@m.arden.nosp@m.ing-.nosp@m.consu.nosp@m.ltin.nosp@m.g.com Copyright 2017 Armin Novak armin.nosp@m..nov.nosp@m.ak@th.nosp@m.inca.nosp@m.st.co.nosp@m.m Copyright 2017 Thincast Technologies GmbH

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.

Function Documentation

static INLINE REGION16_DATA* allocateRegion ( long  nbItems)
static

Here is the caller graph for this function:

static BOOL band_match ( const RECTANGLE_16 *  band1,
const RECTANGLE_16 *  band2,
RECTANGLE_16 *  endPtr 
)
static

Here is the caller graph for this function:

static RECTANGLE_16* next_band ( RECTANGLE_16 *  band1,
RECTANGLE_16 *  endPtr,
int *  nbItems 
)
static

Here is the caller graph for this function:

static BOOL rectangle_contained_in_band ( const RECTANGLE_16 *  band,
const RECTANGLE_16 *  endPtr,
const RECTANGLE_16 *  rect 
)
static

compute if the rectangle is fully included in the band

Parameters
banda pointer on the beginning of the band
endPtrend of the region
rectthe rectangle to test
Returns
if rect is fully included in an item of the band

Here is the caller graph for this function:

BOOL rectangle_is_empty ( const RECTANGLE_16 *  rect)

returns if the rectangle is empty

Parameters
rect
Returns
if the rectangle is empty

Here is the caller graph for this function:

BOOL rectangles_equal ( const RECTANGLE_16 *  r1,
const RECTANGLE_16 *  r2 
)

computes if two rectangles are equal

Parameters
r1first rectangle
r2second rectangle
Returns
if the two rectangles are equal
BOOL rectangles_intersection ( const RECTANGLE_16 *  r1,
const RECTANGLE_16 *  r2,
RECTANGLE_16 *  dst 
)

computes the intersection of two rectangles

Parameters
r1first rectangle
r2second rectangle
dstresulting intersection
Returns
if the two rectangles intersect

Here is the caller graph for this function:

BOOL rectangles_intersects ( const RECTANGLE_16 *  r1,
const RECTANGLE_16 *  r2 
)

computes if two rectangles intersect

Parameters
r1first rectangle
r2second rectangle
Returns
if the two rectangles intersect

Here is the call graph for this function:

Here is the caller graph for this function:

void region16_clear ( REGION16 *  region)

clears the region, the region is resetted to a (0,0,0,0) region

Parameters
region

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL region16_copy ( REGION16 *  dst,
const REGION16 *  src 
)

copies the region to another region

Parameters
dstdestination region
srcsource region
Returns
if the operation was successful (false meaning out-of-memory)

Here is the call graph for this function:

Here is the caller graph for this function:

static void region16_copy_band_with_union ( RECTANGLE_16 *  dst,
const RECTANGLE_16 *  src,
const RECTANGLE_16 *  end,
UINT16  newTop,
UINT16  newBottom,
const RECTANGLE_16 *  unionRect,
UINT32 dstCounter,
const RECTANGLE_16 **  srcPtr,
RECTANGLE_16 **  dstPtr 
)
static

Here is the caller graph for this function:

const RECTANGLE_16* region16_extents ( const REGION16 *  region)
Returns
the extents rectangle of this region

Here is the caller graph for this function:

static RECTANGLE_16* region16_extents_noconst ( REGION16 *  region)
static

Here is the caller graph for this function:

void region16_init ( REGION16 *  region)

initialize a region16

Parameters
regionthe region to initialise

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL region16_intersect_rect ( REGION16 *  dst,
const REGION16 *  src,
const RECTANGLE_16 *  arg2 
)

computes the intersection between a region and a rectangle

Parameters
dstdestination region
srcthe source region
arg2the rectangle that intersects
Returns
if the operation was successful (false meaning out-of-memory)

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL region16_intersects_rect ( const REGION16 *  src,
const RECTANGLE_16 *  arg2 
)

returns if a rectangle intersects the region

Parameters
srcthe region
arg2the rectangle
Returns
if region and rectangle intersect

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL region16_is_empty ( const REGION16 *  region)

returns if the region is empty

Parameters
region
Returns
if the region is empty

Here is the call graph for this function:

Here is the caller graph for this function:

int region16_n_rects ( const REGION16 *  region)
Returns
the number of rectangles of this region16

Here is the call graph for this function:

Here is the caller graph for this function:

void region16_print ( const REGION16 *  region)

dumps the region on stderr

Parameters
regionthe region to dump

Here is the call graph for this function:

Here is the caller graph for this function:

const RECTANGLE_16* region16_rects ( const REGION16 *  region,
UINT32 nbRects 
)

returns a pointer to rectangles and the number of rectangles in this region. nbRects can be set to NULL if not interested in the number of rectangles.

Parameters
regionthe input region
nbRectsif non-NULL returns the number of rectangles
Returns
a pointer on the rectangles

Here is the caller graph for this function:

static INLINE RECTANGLE_16* region16_rects_noconst ( REGION16 *  region)
static

Here is the caller graph for this function:

static BOOL region16_simplify_bands ( REGION16 *  region)
static

Simplify consecutive bands that touch and have the same items

==================== ==================== | 1 | | 2 | | | | | ==================== | | | | | 1 | | 2 | ====> | 1 | | 2 | ==================== | | | | | 1 | | 2 | | | | | ==================== ====================

Here is the call graph for this function:

Here is the caller graph for this function:

void region16_uninit ( REGION16 *  region)

release internal data associated with this region

Parameters
regionthe region to release

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL region16_union_rect ( REGION16 *  dst,
const REGION16 *  src,
const RECTANGLE_16 *  rect 
)

adds a rectangle in src and stores the resulting region in dst

Parameters
dstdestination region
srcsource region
rectthe rectangle to add
Returns
if the operation was successful (false meaning out-of-memory)

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

REGION16_DATA empty_region = { 0, 0 }
static