aboutsummaryrefslogtreecommitdiff
path: root/system/pdp_imageproc_portable.c
diff options
context:
space:
mode:
Diffstat (limited to 'system/pdp_imageproc_portable.c')
-rw-r--r--system/pdp_imageproc_portable.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/system/pdp_imageproc_portable.c b/system/pdp_imageproc_portable.c
index 6feddd3..86b91b8 100644
--- a/system/pdp_imageproc_portable.c
+++ b/system/pdp_imageproc_portable.c
@@ -24,6 +24,24 @@
#include <math.h>
#include "pdp_imageproc.h"
+/* all image dims are legal */
+u32 pdp_imageproc_legalwidth(int i)
+{
+ if (i>1024) return 1024;
+ if (i>0) return i;
+ return 1;
+}
+
+u32 pdp_imageproc_legalheight(int i)
+{
+ if (i>1024) return 1024;
+ if (i>0) return i;
+ return 1;
+}
+u32 pdp_imageproc_legalwidth_round_down(int i) {return pdp_imageproc_legalwidth(i);}
+u32 pdp_imageproc_legalheight_round_down(int i) {return pdp_imageproc_legalheight(i);}
+
+
// utility stuff
inline static s32 float2fixed(float f)
{