PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. More...
Go to the source code of this file.
Functions | |
int | count_bits_in_word (uint16_t x) |
Returns the number of 1 bits in the indicated word. More... | |
int | count_bits_in_word (uint32_t x) |
Returns the number of 1 bits in the indicated word. More... | |
int | count_bits_in_word (uint64_t x) |
Returns the number of 1 bits in the indicated word. More... | |
uint16_t | flood_bits_down (uint16_t x) |
Returns a value such that every bit at or below the highest bit in x is 1. More... | |
uint32_t | flood_bits_down (uint32_t x) |
Returns a value such that every bit at or below the highest bit in x is 1. More... | |
uint64_t | flood_bits_down (uint64_t x) |
Returns a value such that every bit at or below the highest bit in x is 1. More... | |
uint16_t | flood_bits_up (uint16_t x) |
Returns a value such that every bit at or above the highest bit in x is 1. More... | |
uint32_t | flood_bits_up (uint32_t x) |
Returns a value such that every bit at or above the highest bit in x is 1. More... | |
uint64_t | flood_bits_up (uint64_t x) |
Returns a value such that every bit at or above the highest bit in x is 1. More... | |
int | get_highest_on_bit (uint16_t x) |
Returns the index of the highest 1 bit in the word. More... | |
int | get_highest_on_bit (uint32_t x) |
Returns the index of the highest 1 bit in the word. More... | |
int | get_highest_on_bit (uint64_t x) |
Returns the index of the highest 1 bit in the word. More... | |
int | get_lowest_on_bit (uint16_t x) |
Returns the index of the lowest 1 bit in the word. More... | |
int | get_lowest_on_bit (uint32_t x) |
Returns the index of the lowest 1 bit in the word. More... | |
int | get_lowest_on_bit (uint64_t x) |
Returns the index of the lowest 1 bit in the word. More... | |
int | get_next_higher_bit (uint16_t x) |
Returns the smallest power of 2 greater than x. More... | |
int | get_next_higher_bit (uint32_t x) |
Returns the smallest power of 2 greater than x. More... | |
int | get_next_higher_bit (uint64_t x) |
Returns the smallest power of 2 greater than x. More... | |
Variables | |
EXPCL_PANDA_PUTIL const unsigned char | num_bits_on [65536] |
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
All rights reserved.
All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE."
Definition in file pbitops.h.
|
inline |
Returns the number of 1 bits in the indicated word.
Definition at line 18 of file pbitops.I.
Referenced by count_bits_in_word(), get_highest_on_bit(), get_lowest_on_bit(), BitMask< uint32_t, 32 >::get_num_off_bits(), and BitMask< uint32_t, 32 >::get_num_on_bits().
|
inline |
|
inline |
Returns the number of 1 bits in the indicated word.
Definition at line 38 of file pbitops.I.
References count_bits_in_word().
|
inline |
Returns a value such that every bit at or below the highest bit in x is 1.
Definition at line 50 of file pbitops.I.
Referenced by BitMask< uint32_t, 32 >::flood_bits_down(), BitMask< uint32_t, 32 >::flood_down_in_place(), and get_highest_on_bit().
|
inline |
|
inline |
|
inline |
Returns a value such that every bit at or above the highest bit in x is 1.
Definition at line 89 of file pbitops.I.
Referenced by BitMask< uint32_t, 32 >::flood_bits_up(), and BitMask< uint32_t, 32 >::flood_up_in_place().
|
inline |
|
inline |
|
inline |
Returns the index of the highest 1 bit in the word.
Returns -1 if there are no 1 bits.
Definition at line 192 of file pbitops.I.
References count_bits_in_word(), and flood_bits_down().
Referenced by BitMask< uint32_t, 32 >::get_highest_on_bit(), get_next_higher_bit(), and BitMask< uint32_t, 32 >::keep_next_lowest_bit().
|
inline |
Returns the index of the highest 1 bit in the word.
Returns -1 if there are no 1 bits.
Definition at line 209 of file pbitops.I.
References count_bits_in_word(), and flood_bits_down().
|
inline |
Returns the index of the highest 1 bit in the word.
Returns -1 if there are no 1 bits.
Definition at line 226 of file pbitops.I.
References count_bits_in_word(), and flood_bits_down().
|
inline |
Returns the index of the lowest 1 bit in the word.
Returns -1 if there are no 1 bits.
Definition at line 129 of file pbitops.I.
Referenced by BitMask< uint32_t, 32 >::get_lowest_on_bit(), and BitMask< uint32_t, 32 >::keep_next_highest_bit().
|
inline |
Returns the index of the lowest 1 bit in the word.
Returns -1 if there are no 1 bits.
Definition at line 150 of file pbitops.I.
References count_bits_in_word().
|
inline |
Returns the index of the lowest 1 bit in the word.
Returns -1 if there are no 1 bits.
Definition at line 171 of file pbitops.I.
References count_bits_in_word().
|
inline |
Returns the smallest power of 2 greater than x.
Returns the smallest number n such that (1 << n) is larger than x.
Definition at line 244 of file pbitops.I.
References get_highest_on_bit().
Referenced by Texture::down_to_power_2(), and Texture::up_to_power_2().
|
inline |
Returns the smallest power of 2 greater than x.
Returns the smallest number n such that (1 << n) is larger than x.
Definition at line 254 of file pbitops.I.
References get_highest_on_bit().
|
inline |
Returns the smallest power of 2 greater than x.
Returns the smallest number n such that (1 << n) is larger than x.
Definition at line 264 of file pbitops.I.
References get_highest_on_bit().