vpTranspose(3)

πŸ’– vpTranspose(3) πŸ’–

ok so bestie, welcome to vpTranspose from the VolPack library functions manual β€” she's a libc-style page and she's here to transpose a volume. yes really. sit down, hydrate, let's go 🫢


✨ NAME ✨

vpTranspose β€” transpose a volume πŸŒ€


🌸 SYNOPSIS 🌸

#include <volpack.h>

vpResult
vpTranspose(vpc, axis)
    vpContext *vpc;
    int axis;

πŸŽ€ ARGUMENTS πŸŽ€

  • vpc β€” the VolPack context, like, the one you got from vpCreateContext. your main character struct πŸ’…
  • axis β€” the axis that should have the smallest stride after transposing. your options are VP_X_AXIS, VP_Y_AXIS or VP_Z_AXIS. pick one, bestie, not all three πŸ™ˆ

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does vpTranspose actually do? she transposes the 3D voxel array so the memory stride gets optimized for one particular principal viewing axis. that's the whole vibe. ✨

the intended way to use this (and this is the way, fr fr) is:

  1. set the viewing transformation,
  2. call vpGeti with the VP_VIEW_AXIS argument to find the corresponding viewing axis,
  3. then call vpTranspose with that axis.

and yes, transposing the data changes the arrangement of the data stored in the 3D voxel array β€” that's literally the point, it's giving rearrangement. but here's the slay part: the voxel stride state variables get updated to reflect this change, so you do not need to change the viewing transformation after transposing. it just handles it. periodt. πŸ’…

also, if the volume is already transposed for the axis you asked for, she returns immediately without modifying the voxel array. no wasted motion, she's efficient like that.

ngl, this function is useful only for rendering large 3D voxel arrays. that's her niche. and heads up β€” this function has no affect on the preclassified volume data. (yes, we're keeping that spelling, it's canon, don't come for me 😭)

🌈 STATE VARIABLES 🌈

you can retrieve the relevant variables with these state variable codes (check vpGeti(3) for the deets): VP_VIEW_AXIS, VP_VOXEL_XSTRIDE, VP_VOXEL_YSTRIDE, VP_VOXEL_ZSTRIDE. iconic lineup honestly πŸ‘‘


πŸ’€ ERRORS πŸ’€

the normal return value is VP_OK. everything's fine, we're thriving, no notes. πŸ’–

but the following error return values are possible, and when they show up it's not the vibe:

  • VPERROR_BAD_OPTION β€” the axis argument is invalid. girl. pick a real axis. 😭
  • VPERROR_BAD_VOLUME β€” the 3D voxel array is missing or invalid.
  • VPERROR_BAD_VOXEL β€” the voxel fields are incorrectly specified. the fields! they're wrong! πŸ™ˆ

⭐ SEE ALSO ⭐

VolPack(3), vpCreateContext(3) β€” go read those next, bestie, they're the prequel πŸ¦‹


ok that's the whole page, mwah πŸ’‹ this was VolPack's vpTranspose(3), and yeah, that's the title up top and down at the bottom, because she contains multitudes. catch you in the next manpage, bestie β€” stay transposed (in the good, stride-optimized way) πŸŒΈβœ¨πŸ’œ

πŸ“¦ where this page comes from