Struct in ldk_geom.h

LDKSize

typedef struct{
  i32 w;
  i32 h;
}LDKSize;
Function in ldk_geom.h

ldk_size

Construct an integer size from width and height.

LDK_API LDKSize ldk_size(
 i32 width,
 i32 height
);

Parameters

i32 width
Width in pixels or the units expected by the API.
i32 height
Height in pixels or the units expected by the API.

Returns

The resulting size.

Function in ldk_geom.h

ldk_size_zero

Return an integer size with both dimensions zero.

LDK_API LDKSize ldk_size_zero();

Returns

The resulting size.

Function in ldk_geom.h

ldk_size_one

Return an integer size with both dimensions one.

LDK_API LDKSize ldk_size_one();

Returns

The resulting size.

Struct in ldk_geom.h

LDKSizef

typedef struct{
  float w;
  float h;
}LDKSizef;
Function in ldk_geom.h

ldk_sizef

Construct a floating-point size from width and height.

LDK_API LDKSizef ldk_sizef(
 float width,
 float height
);

Parameters

float width
Width in pixels or the units expected by the API.
float height
Height in pixels or the units expected by the API.

Returns

The resulting size.

Function in ldk_geom.h

ldk_sizef_zero

Return a floating-point size with both dimensions zero.

LDK_API LDKSizef ldk_sizef_zero();

Returns

The resulting size.

Function in ldk_geom.h

ldk_sizef_one

Return a floating-point size with both dimensions one.

LDK_API LDKSizef ldk_sizef_one();

Returns

The resulting size.

Struct in ldk_geom.h

LDKRect

typedef struct{
  i32 x;
  i32 y;
  i32 w;
  i32 h;
}LDKRect;
Function in ldk_geom.h

ldk_rect

Construct an integer rectangle from position and size.

LDK_API LDKRect ldk_rect(
 i32 x,
 i32 y,
 i32 width,
 i32 height
);

Parameters

i32 x
X coordinate or component.
i32 y
Y coordinate or component.
i32 width
Width in pixels or the units expected by the API.
i32 height
Height in pixels or the units expected by the API.

Returns

The resulting rectangle.

Function in ldk_geom.h

ldk_rect_contains

Test whether the rect contains the requested value.

LDK_API bool ldk_rect_contains(
 const LDKRect *rect,
 i32 x,
 i32 y
);

Parameters

const LDKRect *rect
UI or geometry rectangle.
i32 x
X coordinate or component.
i32 y
Y coordinate or component.

Returns

True when the queried condition holds; false otherwise.

Function in ldk_geom.h

ldk_rect_intersect

Compute the intersection of the rect.

LDK_API LDKRect ldk_rect_intersect(
 const LDKRect *a,
 const LDKRect *b
);

Parameters

const LDKRect *a
First value to compare or combine.
const LDKRect *b
Second value to compare or combine.

Returns

The resulting rectangle.

Struct in ldk_geom.h

LDKRectf

typedef struct{
  float x;
  float y;
  float w;
  float h;
}LDKRectf;
Function in ldk_geom.h

ldk_rectf

Construct a floating-point rectangle from position and size.

LDK_API LDKRectf ldk_rectf(
 float x,
 float y,
 float width,
 float height
);

Parameters

float x
X coordinate or component.
float y
Y coordinate or component.
float width
Width in pixels or the units expected by the API.
float height
Height in pixels or the units expected by the API.

Returns

The resulting rectangle.

Function in ldk_geom.h

ldk_rectf_contains

Test whether the rectf contains the requested value.

LDK_API bool ldk_rectf_contains(
 const LDKRectf *rect,
 float x,
 float y
);

Parameters

const LDKRectf *rect
UI or geometry rectangle.
float x
X coordinate or component.
float y
Y coordinate or component.

Returns

True when the queried condition holds; false otherwise.

Function in ldk_geom.h

ldk_rectf_intersect

Compute the intersection of the rectf.

LDK_API LDKRectf ldk_rectf_intersect(
 const LDKRectf *a,
 const LDKRectf *b
);

Parameters

const LDKRectf *a
First value to compare or combine.
const LDKRectf *b
Second value to compare or combine.

Returns

The resulting rectangle.

Struct in ldk_geom.h

LDKPoint

typedef struct{
  i32 x;
  i32 y;
}LDKPoint;
Function in ldk_geom.h

ldk_point

Construct an integer two-dimensional point.

LDK_API LDKPoint ldk_point(
 i32 x,
 i32 y
);

Parameters

i32 x
X coordinate or component.
i32 y
Y coordinate or component.

Returns

The resulting point.

Struct in ldk_geom.h

LDKPointf

typedef struct{
  float x;
  float y;
}LDKPointf;
Function in ldk_geom.h

ldk_pointf

Construct a floating-point two-dimensional point.

LDK_API LDKPointf ldk_pointf(
 float x,
 float y
);

Parameters

float x
X coordinate or component.
float y
Y coordinate or component.

Returns

The resulting point.