Blame include/freerdp/codec/region.h

Packit 1fb8d4
/**
Packit 1fb8d4
 * Copyright © 2014 Thincast Technologies GmbH
Packit 1fb8d4
 * Copyright © 2014 Hardening <contact@hardening-consulting.com>
Packit 1fb8d4
 *
Packit 1fb8d4
 * Permission to use, copy, modify, distribute, and sell this software and
Packit 1fb8d4
 * its documentation for any purpose is hereby granted without fee, provided
Packit 1fb8d4
 * that the above copyright notice appear in all copies and that both that
Packit 1fb8d4
 * copyright notice and this permission notice appear in supporting
Packit 1fb8d4
 * documentation, and that the name of the copyright holders not be used in
Packit 1fb8d4
 * advertising or publicity pertaining to distribution of the software
Packit 1fb8d4
 * without specific, written prior permission.  The copyright holders make
Packit 1fb8d4
 * no representations about the suitability of this software for any
Packit 1fb8d4
 * purpose.  It is provided "as is" without express or implied warranty.
Packit 1fb8d4
 *
Packit 1fb8d4
 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
Packit 1fb8d4
 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
Packit 1fb8d4
 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
Packit 1fb8d4
 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
Packit 1fb8d4
 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
Packit 1fb8d4
 * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
Packit 1fb8d4
 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Packit 1fb8d4
 */
Packit 1fb8d4
Packit 1fb8d4
#ifndef FREERDP_CODEC_REGION_H
Packit 1fb8d4
#define FREERDP_CODEC_REGION_H
Packit 1fb8d4
Packit 1fb8d4
#include <freerdp/api.h>
Packit 1fb8d4
#include <freerdp/types.h>
Packit 1fb8d4
Packit 1fb8d4
#ifdef __cplusplus
Packit Service 5a9772
extern "C"
Packit 1fb8d4
{
Packit Service 5a9772
#endif
Packit 1fb8d4
Packit Service 5a9772
	struct _REGION16_DATA;
Packit Service 5a9772
	typedef struct _REGION16_DATA REGION16_DATA;
Packit Service 5a9772
Packit Service 5a9772
	/**
Packit Service 5a9772
	 * @brief
Packit Service 5a9772
	 */
Packit Service 5a9772
	struct _REGION16
Packit Service 5a9772
	{
Packit Service 5a9772
		RECTANGLE_16 extents;
Packit Service 5a9772
		REGION16_DATA* data;
Packit Service 5a9772
	};
Packit Service 5a9772
	typedef struct _REGION16 REGION16;
Packit Service 5a9772
Packit Service 5a9772
	/** computes if two rectangles are equal
Packit Service 5a9772
	 * @param r1 first rectangle
Packit Service 5a9772
	 * @param r2 second rectangle
Packit Service 5a9772
	 * @return if the two rectangles are equal
Packit Service 5a9772
	 */
Packit Service 5a9772
	FREERDP_API BOOL rectangles_equal(const RECTANGLE_16* r1, const RECTANGLE_16* r2);
Packit Service 5a9772
Packit Service 5a9772
	/** computes if two rectangles intersect
Packit Service 5a9772
	 * @param r1 first rectangle
Packit Service 5a9772
	 * @param r2 second rectangle
Packit Service 5a9772
	 * @return if the two rectangles intersect
Packit Service 5a9772
	 */
Packit Service 5a9772
	FREERDP_API BOOL rectangles_intersects(const RECTANGLE_16* r1, const RECTANGLE_16* r2);
Packit Service 5a9772
Packit Service 5a9772
	/** computes the intersection of two rectangles
Packit Service 5a9772
	 * @param r1 first rectangle
Packit Service 5a9772
	 * @param r2 second rectangle
Packit Service 5a9772
	 * @param dst resulting intersection
Packit Service 5a9772
	 * @return if the two rectangles intersect
Packit Service 5a9772
	 */
Packit Service 5a9772
	FREERDP_API BOOL rectangles_intersection(const RECTANGLE_16* r1, const RECTANGLE_16* r2,
Packit Service 5a9772
	                                         RECTANGLE_16* dst);
Packit Service 5a9772
Packit Service 5a9772
	/** initialize a region16
Packit Service 5a9772
	 * @param region the region to initialise
Packit Service 5a9772
	 */
Packit Service 5a9772
	FREERDP_API void region16_init(REGION16* region);
Packit Service 5a9772
Packit Service 5a9772
	/** @return the number of rectangles of this region16 */
Packit Service 5a9772
	FREERDP_API int region16_n_rects(const REGION16* region);
Packit Service 5a9772
Packit Service 5a9772
	/** returns a pointer to rectangles and the number of rectangles in this region.
Packit Service 5a9772
	 * nbRects can be set to NULL if not interested in the number of rectangles.
Packit Service 5a9772
	 * @param region the input region
Packit Service 5a9772
	 * @param nbRects if non-NULL returns the number of rectangles
Packit Service 5a9772
	 * @return a pointer on the rectangles
Packit Service 5a9772
	 */
Packit Service 5a9772
	FREERDP_API const RECTANGLE_16* region16_rects(const REGION16* region, UINT32* nbRects);
Packit Service 5a9772
Packit Service 5a9772
	/** @return the extents rectangle of this region */
Packit Service 5a9772
	FREERDP_API const RECTANGLE_16* region16_extents(const REGION16* region);
Packit Service 5a9772
Packit Service 5a9772
	/** returns if the rectangle is empty
Packit Service 5a9772
	 * @param rect
Packit Service 5a9772
	 * @return if the rectangle is empty
Packit Service 5a9772
	 */
Packit Service 5a9772
	FREERDP_API BOOL rectangle_is_empty(const RECTANGLE_16* rect);
Packit Service 5a9772
Packit Service 5a9772
	/** returns if the region is empty
Packit Service 5a9772
	 * @param region
Packit Service 5a9772
	 * @return if the region is empty
Packit Service 5a9772
	 */
Packit Service 5a9772
	FREERDP_API BOOL region16_is_empty(const REGION16* region);
Packit Service 5a9772
Packit Service 5a9772
	/** clears the region, the region is resetted to a (0,0,0,0) region
Packit Service 5a9772
	 * @param region
Packit Service 5a9772
	 */
Packit Service 5a9772
	FREERDP_API void region16_clear(REGION16* region);
Packit Service 5a9772
Packit Service 5a9772
	/** dumps the region on stderr
Packit Service 5a9772
	 * @param region the region to dump
Packit Service 5a9772
	 */
Packit Service 5a9772
	FREERDP_API void region16_print(const REGION16* region);
Packit Service 5a9772
Packit Service 5a9772
	/** copies the region to another region
Packit Service 5a9772
	 * @param dst destination region
Packit Service 5a9772
	 * @param src source region
Packit Service 5a9772
	 * @return if the operation was successful (false meaning out-of-memory)
Packit Service 5a9772
	 */
Packit Service 5a9772
	FREERDP_API BOOL region16_copy(REGION16* dst, const REGION16* src);
Packit Service 5a9772
Packit Service 5a9772
	/** adds a rectangle in src and stores the resulting region in dst
Packit Service 5a9772
	 * @param dst destination region
Packit Service 5a9772
	 * @param src source region
Packit Service 5a9772
	 * @param rect the rectangle to add
Packit Service 5a9772
	 * @return if the operation was successful (false meaning out-of-memory)
Packit Service 5a9772
	 */
Packit Service 5a9772
	FREERDP_API BOOL region16_union_rect(REGION16* dst, const REGION16* src,
Packit Service 5a9772
	                                     const RECTANGLE_16* rect);
Packit Service 5a9772
Packit Service 5a9772
	/** returns if a rectangle intersects the region
Packit Service 5a9772
	 * @param src the region
Packit Service 5a9772
	 * @param arg2 the rectangle
Packit Service 5a9772
	 * @return if region and rectangle intersect
Packit Service 5a9772
	 */
Packit Service 5a9772
	FREERDP_API BOOL region16_intersects_rect(const REGION16* src, const RECTANGLE_16* arg2);
Packit Service 5a9772
Packit Service 5a9772
	/** computes the intersection between a region and a rectangle
Packit Service 5a9772
	 * @param dst destination region
Packit Service 5a9772
	 * @param src the source region
Packit Service 5a9772
	 * @param arg2 the rectangle that intersects
Packit Service 5a9772
	 * @return if the operation was successful (false meaning out-of-memory)
Packit Service 5a9772
	 */
Packit Service 5a9772
	FREERDP_API BOOL region16_intersect_rect(REGION16* dst, const REGION16* src,
Packit Service 5a9772
	                                         const RECTANGLE_16* arg2);
Packit Service 5a9772
Packit Service 5a9772
	/** release internal data associated with this region
Packit Service 5a9772
	 * @param region the region to release
Packit Service 5a9772
	 */
Packit Service 5a9772
	FREERDP_API void region16_uninit(REGION16* region);
Packit 1fb8d4
Packit 1fb8d4
#ifdef __cplusplus
Packit 1fb8d4
}
Packit 1fb8d4
#endif
Packit 1fb8d4
Packit 1fb8d4
#endif /* FREERDP_CODEC_REGION_H */