PS_OPEN_IMAGE(3)
π PS_OPEN_IMAGE(3) π
okay bestie, welcome to the pslib girlies' corner of the manual pages β¨ this one lives in the Library Functions Manual and it's all about PS_open_image β reading in a lil picture so you can slap it into your PostScript later π
πΈ NAME πΈ
PS_open_image β reads an image for later placement πΌοΈβ¨
π¦ SYNOPSIS π¦
#include <pslib.h>
int PS_open_image(PSDoc *psdoc, char *type, char *source, char *data,
int lenght, int width, int height, int components, int bpc, const char
*params)
(yes, lenght is spelled like that, we don't make the rules, we just report them π
)
π DESCRIPTION π
So here's the tea π: PS_open_image reads an image that's already sitting in memory. It's not out here opening files, it's just vibing with what you hand it.
The source parameter? Bestie, it is currently not evaluated β everybody just assumes it says memory and moves on. Iconic of it honestly.
The type parameter can be either raw or eps. Pick your fighter β¨
π raw images π
A raw image is expected to be a stream of pixels that starts in the upper left and ends in the lower right corner. Each pixel is a tuple of components representing the colors, and each one of those components is bpc bits long.
For color images, the components are expected to be stored in RGB or CMYK order. The number of components is what implies the colorspace β and this is the part where you gotta pay attention, bestie:
4 components imply a CMYK image, NOT an RGB image with an alpha channel. Do not come for me, that's just how it is. This restriction may be removed in later versions. π
π§ eps images π§
EPS images are expected as stored in a file. There is no need to set any other parameter β lowkey the easiest path, no cap. The height and width of the image get taken from the bounding box within the image data. slay.
π the reuse glow-up (since pslib 0.4.5) π
Since version 0.4.5 of pslib, images are read by default for later reuse. What that means: the image gets saved into a so called reusable stream object. Then later calls of PS_place_image(3) will only put a short sequence of postscript code into the output file replaying the image. The way thatβ¦
- reduces the overall postscript file size π₯
- speeds up its processing by the postscript rip π₯
- allows you to place images into templates π₯
main character behaviour fr fr. If you want to turn this off, set the parameter imagereuse to false with PS_set_parameter(3). Your call, bestie π
β RETURN VALUE β
Returns the identifier of the image, or zero in case of an error π The identifier is a positive number greater than 0. So if you got a 0 back, that's a vibe check you did not pass.
π«Ά SEE ALSO π«Ά
π AUTHOR π
This manual page was written by Uwe Steinmann <uwe@steinmann.cx>. thank you king π
and that's the whole page, babe β this was PS_OPEN_IMAGE(3) from the Library Functions Manual, and it's been a pleasure yapping with you πβ¨ bye bestie, go place some images π¦πΈ
π¦ where this page comes from
- debian bookworm: pslib-dev 0.4.7-1+b1
- debian trixie: pslib-dev 0.4.8-1+b1
- ubuntu jammy: pslib-dev 0.4.7-1
- ubuntu noble: pslib-dev 0.4.7-1build2
- ubuntu questing: pslib-dev 0.4.8-1
- ubuntu resolute: pslib-dev 0.4.8-1build1
- ubuntu stonking: pslib-dev 0.4.8-3 Β· GPL-2.0-or-later OR LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms