VistaIOZeroCrossings(3)

πŸ’– VistaIOZeroCrossings β€” bestie edition πŸ’–

okay so you're in the vistaio manual, section 3 (library functions, the good stuff ✨), and today's main character is VistaIOZeroCrossings. she marks zero crossings in an image. that's it, that's the job, and she does it flawlessly πŸ’…


✨ NAME ✨

VistaIOZeroCrossings β€” mark zero crossings in an image πŸŽ€


🌸 SYNOPSIS 🌸

#include <vistaio.h>

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

πŸ¦‹ ARGUMENTS πŸ¦‹

  • src β€” the source image, aka the one we're hunting zero crossings in. this is where they're located, no cap πŸ‘€
  • dest β€” you may hand over a destination image to hold the results, or you can pass NULL and let her spin up a brand new destination image herself. queen behavior 🫢
  • band β€” you may name one specific band of the source image to process, or you can pass the constant VistaIOAllBands to say "do every band bestie, all of them" 🌈

πŸ’œ DESCRIPTION πŸ’œ

so VistaIOZeroCrossings marks the zero crossings of an image. she goes through the pixels of the source image, src, and sets the destination pixels depending on whether they correspond to zero crossings. here's the vibe check:

  • if a destination pixel does not lie on a zero crossing β†’ it gets set to zero.
  • if it does lie on one β†’ it gets set to the gradient of the zero crossing.

and how's that gradient computed, you ask? it's literally just the magnitude of the difference between the pixels on each side of the zero crossing. simple, elegant, iconic ✨

if the dest argument is NULL, VistaIOZeroCrossings creates a destination image with all the appropriate properties for you. otherwise, dest is an existing destination image that she'll use. no drama either way πŸ’…

now, plot twist: the destination image is smaller than the source image by one row and one column. not a typo, not a glitch, that's just how she rolls.

band count? either the same number of bands as the source image (if band is VistaIOAllBands), or a single band (if band names one particular band).

and the pixel representation of the destination depends on the source's, per this table:

Source Representation β†’ Destination Representation

  • VistaIOBit β†’ not supported πŸ™ˆ
  • VistaIOUByte β†’ not supported πŸ™ˆ
  • VistaIOSByte β†’ VistaIOUByte
  • VistaIOShort β†’ VistaIOLong
  • VistaIOLong β†’ VistaIOLong
  • VistaIOFloat β†’ VistaIOFloat
  • VistaIODouble β†’ VistaIODouble

πŸŽ€ RETURN VALUES πŸŽ€

she returns the destination image if everything slayed, and NULL otherwise. that's the whole story 😌


πŸ”₯ SEE ALSO πŸ”₯

go read those too, iykyk πŸ‘‘


⭐ NOTES ⭐

VistaIOZeroCrossings labels the destination image as a gradient image by giving it these attributes:

  • ncomponents: 1
  • component_interp: gradient

periodt. that's how you'll know it's a gradient image πŸ’«


πŸ’€ DIAGNOSTICS πŸ’€

  • Band band referenced in image of nbands band(s). β€” the band argument is invalid given the number of bands in src. she's not mad, she's just confused πŸ₯²
  • Source image has unsigned pixels. β€” okay genuine question, how can an image of unsigned pixels even have zero crossings?? such source images are not supported, bestie, don't try it 😭
  • Destination image has dest_nbands bands; src_nbands expected. β€” you specified a destination image but it's got the wrong number of bands. reminder: 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. rules are rules πŸ’…
  • Destination image has dest_prop property; src_prop expected. β€” here 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. mismatch detected, vibe ruined 🚨

πŸ‘‘ AUTHORS πŸ‘‘

  • David Lowe <lowe@cs.ubc.ca>
  • Art Pope <pope@cs.ubc.ca>

Adaption to vistaio: Gert Wollny <gw.fossdev@gmail.com>


and that's the whole page, babe 🫢 every flag, every message, every pixel β€” all of it. no skips, no summaries, no cap πŸ’–

okay and before you go, tiny sign-off moment πŸŽ€ this is VistaIO Version 1.2.14, dated 24 April 1993 β€” yeah, she's vintage and she still ate 🌈✨ bye bestie, go mark some zero crossings πŸ’