Class CountVoxelsIntersectingBounded
Object
CountVoxelsIntersectingBounded
Like
IterateVoxelsBoundingBox but counts voxels matching a predicate rather than
iterating.- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionstatic intcountByte(BoundedVoxels<UnsignedByteBuffer> voxels1, BoundedVoxels<UnsignedByteBuffer> voxels2, PredicateTwoBytes predicate) Counts all voxels in the intersection of two bounded-voxels of typeBoundedVoxelsthat match a predicate.static intcountByteMasked(Voxels<UnsignedByteBuffer> maskGlobal, byte onMaskGlobal, BoundedVoxels<UnsignedByteBuffer> voxels1, BoundedVoxels<UnsignedByteBuffer> voxels2, PredicateTwoBytes predicate) Counts all voxels intersection of two bounded-voxels of typeBoundedVoxelsbut only voxels that lie on an object-mask and match a predicate.
-
Method Details
-
countByte
public static int countByte(BoundedVoxels<UnsignedByteBuffer> voxels1, BoundedVoxels<UnsignedByteBuffer> voxels2, PredicateTwoBytes predicate) Counts all voxels in the intersection of two bounded-voxels of typeBoundedVoxelsthat match a predicate.- Parameters:
voxels1- the first bounded-voxelsvoxels2- the second bounded-voxelspredicate- determines if a particular voxel should be counted or not?- Returns:
- the number of voxels that match the predicate.
-
countByteMasked
public static int countByteMasked(Voxels<UnsignedByteBuffer> maskGlobal, byte onMaskGlobal, BoundedVoxels<UnsignedByteBuffer> voxels1, BoundedVoxels<UnsignedByteBuffer> voxels2, PredicateTwoBytes predicate) Counts all voxels intersection of two bounded-voxels of typeBoundedVoxelsbut only voxels that lie on an object-mask and match a predicate.- Parameters:
maskGlobal- a mask defined on the entire global space, and all matching voxels must have an on value in this mask, in addition to being part of the intersection ofvoxels1andvoxels2.onMaskGlobal- the on value inmaskGlobal.voxels1- the first bounded-voxelsvoxels2- the second bounded-voxelspredicate- determines if a particular voxel should be counted or not?- Returns:
- the number of voxels that match the predicate.
-