VistaIOCopyImage(3)

πŸ’– VistaIOCopyImage(3) β€” like, the copy-paste of images, bestie πŸ’–

okay so this is a page from the Library Functions Manual, and it's literally all about copying images around. three little functions, one big vibe. let's go πŸ¦‹


✨ NAME ✨

VistaIOCopyImage β€” copy an image πŸ‘‘


🌸 SYNOPSIS 🌸

#include <vistaio.h>

VistaIOImage VistaIOCopyImagePixels (src, dest, band)
       VistaIOImage src, dest;
       VistaIOBand band;

VistaIOImage VistaIOCopyImageAttrs (src, dest)
       VistaIOImage src, dest;

VistaIOImage VistaIOCopyImage (src, dest, band)
       VistaIOImage src, dest; VistaIOBand band;

πŸŽ€ ARGUMENTS πŸŽ€

  • src β€” this is the source image, the one you're copying from. the main character we're all obsessed with.
  • dest β€” may specify a destination image, OR may be NULL to say "bestie, idk, just make me a new destination image." no pressure either way πŸ’…
  • band β€” may specify a particular band of the source image that you wanna copy, OR it can be the constant VistaIOAllBands, which means "yeah girl, copy every single band." 🌈

πŸ’œ DESCRIPTION πŸ’œ

VistaIOCopyImagePixels copies pixel values from the source image over to the destination image. that's it. that's the whole thing. (no other image properties are copied, okay? just pixels. periodt.)

VistaIOCopyImageAttrs copies attributes from the source image to the destination image. (no pixel values are copied β€” she does NOT do pixels, that's not her job.) and here's the tea: if the destination image already has an attribute list, it gets deleted first. gone. then the destination image gets a copy of the source image's attribute list. and finally, if the source and destination images don't have the same number of bands, the destination image's band interpretation attributes may get edited to keep them valid:

  • if they do not have the same number of bands then (a) any band interpretation attributes, such as frame_interp and color_interp, are deleted from the destination image's copy; (b) the size of the destination image's component dimension (ncomponents) is set equal to its number of bands; and (c) the sizes of its other band interpretation dimensions (nframes, nviewpoints, and ncolors) are set to 1. it's giving fresh start, honestly 🧚
  • if they do have the same number of bands then (a) all attributes are copied unchanged from the source image to the destination image; and (b) the sizes of the band interpretation dimensions are copied as well. iconic, no notes πŸ’…

VistaIOCopyImage copies both pixel values and attributes from one image to the other. it's literally equivalent to calling both VistaIOCopyImagePixels and VistaIOCopyImageAttrs. the full package. the whole meal. πŸ“

you can specify NULL as a destination image for any of these routines; they'll then create an appropriate destination image, copy to it, and return it. so easy, so slay.

⚠️ but if you do supply a destination image to VistaIOCopyImage or VistaIOCopyImagePixels, it must have the same number of rows, number of columns, and pixel representation as the source image; also, it must have a number of bands consistent with src and band. no exceptions bestie, the vibe check is strict 😭

⭐ RETURN VALUES ⭐

each of these routines returns the destination image if it's successful, and NULL otherwise. succeed and return, or fail and hand you a NULL. simple as. πŸ’€


πŸ¦‹ SEE ALSO πŸ¦‹

VistaIOCopyBand(3), VistaIOCombineBands(3) VistaIOImage(3),


🌸 NOTES 🌸

VistaIOAttrList(3) β€” wait no, hold on β€” VistaIOCopyAttrList(3) is used to copy attributes from the source image to the destination image. so the destination image's attribute list contains its own copy of each attribute value β€” except that for a VistaIOPointer value, the pointer is copied but not the (opaque) data structure to which it points. so like, the address gets a copy, but the thing living at that address does not. no cap. πŸ‘€


πŸ”₯ DIAGNOSTICS πŸ”₯

  • Band band referenced in image of nbands band(s).'' `` β€” the band argument is invalid given the number of bands in src.
  • Destination image has dest_nbands bands; src_nbands expected.'' `` β€” a destination image was specified but it has the wrong number of bands. if band is VistaIOAllBands, the destination image must have the same number of bands as the source image. otherwise, it must have a single band.
  • Destination image has dest_prop property; src_prop expected.'' β€” property is one of pixels'' , rows'' , or columns'' . a destination image was specified but it does not have the same pixel representation, number of rows, and number of columns as the source image.

πŸ‘‘ AUTHOR πŸ‘‘

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

and that's the whole page, bestie 🫢 shoutout to VistaIO Version 1.2.14, dated 24 April 1993 β€” yeah she's vintage but she still ate πŸ’–βœ¨πŸŽ€