List of utility methods to do Integer Align
int | align(int size, int alignment) align return ((size / alignment) + 1) * alignment;
|
int | align(int size, int space, int weight) Return the coordinate where something of size 'size' starts in a space of size 'space', with 'weight' as the alignment. if (weight == ALIGN_LEFT) { return 0; } else if (weight == ALIGN_CENTER) { return (space - size) / 2; } else if (weight == ALIGN_CENTER_OR_TOP) { return size <= space ? (space - size) / 2 : 0; } else { return space - size; ... |
int | align(int value, int alignment) Returns the given (address) value, adjusted to have the given alignment. return (((value) + (alignment) - 1) & ~((alignment) - 1));
|