mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Updated AMF/3MF import to pass configuration into a DynamicPrintConfig
instead of PresetBundle.
This commit is contained in:
parent
1398d5d09a
commit
9a3db200a5
10 changed files with 81 additions and 134 deletions
|
@ -76,20 +76,37 @@ extern unsigned get_current_pid();
|
|||
|
||||
// Compute the next highest power of 2 of 32-bit v
|
||||
// http://graphics.stanford.edu/~seander/bithacks.html
|
||||
template<typename T>
|
||||
inline T next_highest_power_of_2(T v)
|
||||
inline uint16_t next_highest_power_of_2(uint16_t v)
|
||||
{
|
||||
if (v != 0)
|
||||
-- v;
|
||||
if (v != 0)
|
||||
-- v;
|
||||
v |= v >> 1;
|
||||
v |= v >> 2;
|
||||
v |= v >> 4;
|
||||
if (sizeof(T) >= sizeof(uint16_t))
|
||||
v |= v >> 8;
|
||||
if (sizeof(T) >= sizeof(uint32_t))
|
||||
v |= v >> 16;
|
||||
if (sizeof(T) >= sizeof(uint64_t))
|
||||
v |= v >> 32;
|
||||
v |= v >> 8;
|
||||
return ++ v;
|
||||
}
|
||||
inline uint32_t next_highest_power_of_2(uint32_t v)
|
||||
{
|
||||
if (v != 0)
|
||||
-- v;
|
||||
v |= v >> 1;
|
||||
v |= v >> 2;
|
||||
v |= v >> 4;
|
||||
v |= v >> 8;
|
||||
v |= v >> 16;
|
||||
return ++ v;
|
||||
}
|
||||
inline uint64_t next_highest_power_of_2(uint64_t v)
|
||||
{
|
||||
if (v != 0)
|
||||
-- v;
|
||||
v |= v >> 1;
|
||||
v |= v >> 2;
|
||||
v |= v >> 4;
|
||||
v |= v >> 8;
|
||||
v |= v >> 16;
|
||||
v |= v >> 32;
|
||||
return ++ v;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue