VistaIOCreateImage(3)

✨ VistaIOCreateImage β€” the manual page, but make it cute ✨

okay bestie, buckle up πŸ’– this is the Library Functions Manual entry for VistaIOCreateImage(3), and we're gonna make image allocation make sense, fr fr.


🌸 NAME 🌸

VistaIOCreateImage, VistaIOCreateImageLike β€” allocate memory for an image πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <vistaio.h>

VistaIOImage VistaIOCreateImage (nbands, nrows, ncolumns, pixel_repn)
       int nbands, nrows, ncolumns;
       VistaIORepnKind pixel_repn;

VistaIOImage VistaIOCreateImageLike (src)
       VistaIOImage src;

πŸ’… ARGUMENTS πŸ’…

  • nbands β€” how many bands the new image is gonna have. like, the count. that's it. ✨
  • nrows β€” how many rows the new image is gonna have. πŸ“
  • ncolumns β€” how many columns the new image is gonna have. 🌈
  • pixel_repn β€” the representation of the pixels in the new image. it must be one of these and no others, no cap:
    • VistaIOBitRepn
    • VistaIOUByteRepn
    • VistaIOSByteRepn
    • VistaIOShortRepn
    • VistaIOLongRepn
    • VistaIOFloatRepn
    • VistaIODoubleRepn
  • src β€” an image that already has all the properties you want the new image to have. your blueprint, your inspo pic, your main character πŸ’œ

πŸ‘‘ DESCRIPTION πŸ‘‘

VistaIOCreateImage πŸ’–

bestie, this one allocates memory for a brand new image with whatever properties you specified. the fields of the new image structure get initialized, and so do the image's row and band indices. πŸŽ€

but here's the tea: its pixel values are not initialized. like at all. so don't come for me when they're weird, okay? πŸ™ˆ

the new image gets an empty attribute list. and its frame band interpretation dimension (nframes) is set to nbands, while its other band interpretation dimensions β€” nviewpoints, ncolors, and ncomponents β€” are all set to 1. one. uno. just the one. ✨

VistaIOCreateImageLike πŸ¦‹

this one is giving copy-paste energy, but the good kind. it allocates memory for a new image with the exact same properties as src β€” same pixel representation, same numbers of bands, rows, and columns. iconic.

fields of the new image structure get initialized, and the image's row and band indices get initialized too. its pixel values, however, are not initialized 😭 (same rule as above, no skipping).

and the new image gets a copy of src's attribute list, plus the sizes of its band interpretation dimensions (nframes, ..., ncomponents) are set identical to those of src. matching outfits. slay. πŸ’…


⭐ RETURN VALUES ⭐

if everything goes well, these routines return a pointer to the newly-allocated image structure. 🫢

if it does not go well, they return NULL. that's the whole story. πŸ’€


πŸ”₯ SEE ALSO πŸ”₯


😭 DIAGNOSTICS 😭

these are the error messages you might get, and what they actually mean. pay attention bestie.
  • Invalid number of dimension: value.'' `` β€” the dimension in question is bands, rows, or columns, and an inappropriate value, value, was specified for that dimension. 🚩
  • Invalid pixel representation: repn.'' `` β€” the representation kind you specified is not one of the valid pixel representations. i told you the list was strict. πŸ’…

πŸ’œ AUTHOR πŸ’œ

  • Art Pope <pope@cs.ubc.ca>
  • Adaption to vistaio: Gert Wollny <gw.fossdev@gmail.com>

and that's the whole page, bestie, you ate πŸ“βœ¨ this was VistaIO Version 1.2.14, dated 24 April 1993, for VistaIOCreateImage(3) πŸ’– go forth and allocate responsibly πŸŽ€πŸ‘‘