summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/mupdf/fitz/geometry.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/mupdf/fitz/geometry.h b/include/mupdf/fitz/geometry.h
index 0667c3ee..f1f1501f 100644
--- a/include/mupdf/fitz/geometry.h
+++ b/include/mupdf/fitz/geometry.h
@@ -125,6 +125,12 @@ struct fz_point_s
float x, y;
};
+static inline fz_point fz_make_point(float x, float y)
+{
+ fz_point p = { x, y };
+ return p;
+}
+
/*
fz_rect is a rectangle represented by two diagonally opposite
corners at arbitrary coordinates.
@@ -150,6 +156,12 @@ struct fz_rect_s
float x1, y1;
};
+static inline fz_rect fz_make_rect(float x0, float y0, float x1, float y1)
+{
+ fz_rect r = { x0, y0, x1, y1 };
+ return r;
+}
+
/*
fz_rect_min: get the minimum point from a rectangle as a fz_point.
*/
@@ -178,6 +190,12 @@ struct fz_irect_s
int x1, y1;
};
+static inline fz_irect fz_make_irect(int x0, int y0, int x1, int y1)
+{
+ fz_irect r = { x0, y0, x1, y1 };
+ return r;
+}
+
/*
A rectangle with sides of length one.
@@ -269,6 +287,12 @@ struct fz_matrix_s
*/
extern const fz_matrix fz_identity;
+static inline fz_matrix fz_make_matrix(float a, float b, float c, float d, float e, float f)
+{
+ fz_matrix m = { a, b, c, d, e, f };
+ return m;
+}
+
static inline fz_matrix *fz_copy_matrix(fz_matrix *restrict m, const fz_matrix *restrict s)
{
*m = *s;