LDKSize
typedef struct{
i32 w;
i32 h;
}LDKSize;
Geometry and point/rect/size helper types
Defines basic geometry types and constructors used across LDK.
typedef struct{
i32 w;
i32 h;
}LDKSize;
Construct an integer size from width and height.
LDK_API LDKSize ldk_size(
i32 width,
i32 height
);
i32 widthi32 heightThe resulting size.
Return an integer size with both dimensions zero.
LDK_API LDKSize ldk_size_zero();
The resulting size.
Return an integer size with both dimensions one.
LDK_API LDKSize ldk_size_one();
The resulting size.
typedef struct{
float w;
float h;
}LDKSizef;
Construct a floating-point size from width and height.
LDK_API LDKSizef ldk_sizef(
float width,
float height
);
float widthfloat heightThe resulting size.
Return a floating-point size with both dimensions zero.
LDK_API LDKSizef ldk_sizef_zero();
The resulting size.
Return a floating-point size with both dimensions one.
LDK_API LDKSizef ldk_sizef_one();
The resulting size.
typedef struct{
i32 x;
i32 y;
i32 w;
i32 h;
}LDKRect;
Construct an integer rectangle from position and size.
LDK_API LDKRect ldk_rect(
i32 x,
i32 y,
i32 width,
i32 height
);
i32 xi32 yi32 widthi32 heightThe resulting rectangle.
Test whether the rect contains the requested value.
LDK_API bool ldk_rect_contains(
const LDKRect *rect,
i32 x,
i32 y
);
const LDKRect *recti32 xi32 yTrue when the queried condition holds; false otherwise.
Compute the intersection of the rect.
LDK_API LDKRect ldk_rect_intersect(
const LDKRect *a,
const LDKRect *b
);
The resulting rectangle.
typedef struct{
float x;
float y;
float w;
float h;
}LDKRectf;
Construct a floating-point rectangle from position and size.
LDK_API LDKRectf ldk_rectf(
float x,
float y,
float width,
float height
);
float xfloat yfloat widthfloat heightThe resulting rectangle.
Test whether the rectf contains the requested value.
LDK_API bool ldk_rectf_contains(
const LDKRectf *rect,
float x,
float y
);
const LDKRectf *rectfloat xfloat yTrue when the queried condition holds; false otherwise.
Compute the intersection of the rectf.
LDK_API LDKRectf ldk_rectf_intersect(
const LDKRectf *a,
const LDKRectf *b
);
The resulting rectangle.
typedef struct{
i32 x;
i32 y;
}LDKPoint;
Construct an integer two-dimensional point.
LDK_API LDKPoint ldk_point(
i32 x,
i32 y
);
i32 xi32 yThe resulting point.
typedef struct{
float x;
float y;
}LDKPointf;
Construct a floating-point two-dimensional point.
LDK_API LDKPointf ldk_pointf(
float x,
float y
);
float xfloat yThe resulting point.