projects
/
convexer.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
switch to shell scripts
[convexer.git]
/
nbvtf
/
rgbcx.h
diff --git
a/nbvtf/rgbcx.h
b/nbvtf/rgbcx.h
index dd199b781471d6ce432b798b9549048d0e332454..620441b3fc7c98b678a5c355e0223aad8091ef5e 100644
(file)
--- a/
nbvtf/rgbcx.h
+++ b/
nbvtf/rgbcx.h
@@
-58,8
+58,17
@@
#include <stdlib.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdint.h>
-#include <algorithm>
#include <assert.h>
#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.
#include <limits.h>
// By default, the table used to accelerate cluster fit on 4 color blocks uses a 969x128 entry table.
@@
-2818,7
+2827,11
@@
namespace rgbcx
dots[i] = (d << 4) + i;
}
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;
uint32_t r_sum[17], g_sum[17], b_sum[17];
uint32_t r = 0, g = 0, b = 0;
@@
-3716,9
+3729,13
@@
namespace rgbcx
assert(d >= 0);
dots[i] = (d << 4) + i;
}
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++)
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++)