#include <stdlib.h>
#include <stdint.h>
-#include <algorithm>
#include <assert.h>
+
+#ifndef RGBCX_NO_ALGORITHM
+ #include <algorithm>
+#else
+int std_sort_int (const void * a, const void * b)
+{
+ return ( *(int*)a - *(int*)b );
+}
+#endif
+
#include <limits.h>
// By default, the table used to accelerate cluster fit on 4 color blocks uses a 969x128 entry table.
dots[i] = (d << 4) + i;
}
- std::sort(dots, dots + 16);
+#ifdef RGBCX_NO_ALGORITHM
+ qsort( dots, 16, sizeof(int), std_sort_int );
+#else
+ std::sort(dots, dots + 16);
+#endif
uint32_t r_sum[17], g_sum[17], b_sum[17];
uint32_t r = 0, g = 0, b = 0;
assert(d >= 0);
dots[i] = (d << 4) + i;
}
+
+#ifdef RGBCX_NO_ALGORITHM
+ qsort( dots, 16, sizeof(int), std_sort_int );
+#else
+ std::sort(dots, dots + 16);
+#endif
- std::sort(dots, dots + 16);
-
uint32_t r_sum[17], g_sum[17], b_sum[17];
uint32_t r = 0, g = 0, b = 0;
for (uint32_t i = 0; i < 16; i++)