GDK-PIXBUF-CSOURCE(1)

πŸ’– gdk-pixbuf-csource β€” the girlies' guide πŸ’–

okay so bestie, this is a page from the gdk-pixbuf-csource manual, and we're gonna get you fluent in it, no cap ✨


✨ NAME ✨

gdk-pixbuf-csource β€” the C code generation utility for GdkPixbuf images πŸŽ€ (yes she generates C code, she's an icon, she's a legend, and she IS the moment)


πŸ¦‹ SYNOPSIS πŸ¦‹

gdk-pixbuf-csource [OPTIONS...] <IMAGE>

🌸 DESCRIPTION 🌸

So gdk-pixbuf-csource is this adorable little utility that generates C code containing images πŸ’… which is genuinely so useful for compiling images directly into your programs. like, right in there. no external files. obsessed.

She works one of two ways, and honestly both are valid:

  • you hand her one image file name and she generates code for it, OR
  • with the --build-list option, you hand her a list of (name, image) pairs and she generates code for a whole list of images into named variables 🫢
🚨 okay real talk bestie, listen up: this tool is mostly meant to be used for backward compatibility. Newly written applications and libraries should use GResource to embed image assets in their binary. that's the glow-up. that's the move. periodt.

πŸ‘‘ OPTIONS πŸ‘‘

  • --stream β€” generates a pixbuf data stream: a single string holding a serialized GdkPixdata structure in network byte order ✨ (network byte order, bestie, she's consistent)
  • --struct β€” generates a GdkPixdata structure. heads up: your code needs the GdkPixdata structure definition from gdk-pixdata.h πŸ“Ž
  • --macros β€” generates *_ROWSTRIDE, *_WIDTH, *_HEIGHT, *_BYTES_PER_PIXEL and *_RLE_PIXEL_DATA or *_PIXEL_DATA macro definitions for the image πŸŽ€
  • --rle β€” enables run-length encoding for the generated pixel data. this is the default πŸ’–
  • --raw β€” disables run-length encoding for the generated pixel data 🌈
  • --extern β€” generates extern symbols πŸ‘‘
  • --static β€” generates static symbols. this is the default πŸ’…
  • --decoder β€” provides a *_RUN_LENGTH_DECODE(image_buf, rle_data, size, bpp) macro definition to decode run-length encoded image data 🧚 (she's handing you the decoder bestie, use it)
  • --name=identifier β€” specifies the identifier name (the prefix!) for the generated variables or macros. ngl this is only useful if --build-list was not specified πŸ™ˆ
  • --build-list β€” enables the (name, image) pair parsing mode πŸ¦‹
  • -h, --help β€” prints a brief help and exits. she's brief, she's helpful, she's leaving πŸ’€
  • -v, --version β€” prints the tool version and exits ⭐
  • --g-fatal-warnings β€” makes warnings fatal, and causes the program to abort 😭 so like, dramatic much? but yes, warnings = game over, she will not be tolerating any of that

🌈 SEE ALSO 🌈

The GdkPixbuf documentation, shipped by gdk-pixbuf, and also available online on docs.gtk.org β€” the exact page lives at https://docs.gtk.org/gdk-pixbuf/ πŸ’œ (iykyk, go read it, she's thorough)


πŸ’€ BUGS πŸ’€

okay so there ARE some known issues and we're gonna be honest about them, no gatekeeping:

  • The runlength encoder gets out of sync with the pixel boundaries, since it includes the rowstride padding in the encoded stream 😭 like girl what.
  • Furthermore, it generates pixbufs with suboptimal rowstride in some cases πŸ™ˆ

not me exposing her flaws β€” but fr fr, that's what the page says, so that's what you get πŸ’…


🌸 that's the whole page bestie! and a lil' sign-off: this manual page is filed under the manual name gdk-pixbuf-csource, and it's part of the gdk-pixbuf package docs. mwah πŸ’‹ go embed some images responsibly, and remember β€” new code, use GResource. periodt. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from