PS_PLACE_IMAGE(3)

πŸ’– NAME πŸ’–

PS_place_image β€” places an image on the page, bestie πŸ–ΌοΈβœ¨


🌸 SYNOPSIS 🌸

#include <pslib.h>

void PS_place_image(PSDoc *psdoc, int imageid, float x, float y, float
scale)

πŸŽ€ DESCRIPTION πŸŽ€

Okay so what this does is it takes an image you already loaded earlier and drops it down at the current point on the page. Yes queen, it's a placement moment. πŸ‘‘

And lowkey important: the image gets scaled if x and y have values unequal to 1. Not equal to 1 = resizing happens. That's the vibe check right there.

Now about the image data, ngl this part is kind of iconic. It's ascii85 encoding, which is only 20 percent larger than the raw binary data of the image. And before you come for me β€” the binary data is not equal to the file size, it's somewhat smaller, because the file also contains an image header. Fr fr, don't @ me, that's just how it is. πŸ™ˆ

You can turn on hex encoding instead by setting the parameter imageencoding to hex. But heads up: hex encoding doubles the size of the image data. So like, it's giving bigger file for no reason unless you actually need it. πŸ’€

Now the glow-up lore ✨ β€” since version 0.4.5 of pslib, images are fully read and saved into the output postscript file when they're opened with PS_open_image(3) or PS_open_image_file(3). So later calls of PS_place_image(3) just replay the image. It's a rerun, a repost, a replay. πŸ”

You can turn this behaviour off by setting the parameter imagereuse to false with PS_set_parameter(3). That's the off switch, bestie.

And if image reuse is not turned off, this function may be called within a template. 🫢

πŸ¦‹ SEE ALSO πŸ¦‹


πŸ‘‘ AUTHOR πŸ‘‘

This manual page was written by Uwe Steinmann uwe@steinmann.cx. Thank you for your service, king. πŸ«‘πŸ’œ


And that's a wrap on the PS_PLACE_IMAGE(3) page from the pslib Library Functions Manual, babes β€” go place some images and slay the day, mwah πŸ’…πŸŒˆβ­

πŸ“¦ where this page comes from