Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ xil_soft_fill(3) — SunOS 5.6

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

xil_fill(3)

xil_soft_fill(3)

NAME

xil_soft_fill − perform soft fill from specified starting point

SYNOPSIS

#include <xil/xil.h>

void xil_soft_fill (XilImage src,

XilImage dst,
float xseed,
float yseed,
float ∗foregnd_color,
unsigned int num_backgnd_color,
float ∗backgnd_color,
float ∗fill_color);

DESCRIPTION

This function performs a soft fill on a region composed of the foreground color and a number of background colors. From the starting coordinates, every 4-connected pixel containing a percentage of foreground color is filled with the corresponding percentage of fill color.  If a pixel does not contain the foreground color, it forms part of the boundary of the region. 

src is the source image handle.  dst is the destination image handle.  xseed is a float that specifies the x start coordinate.  yseed is a float that specifies the y start coordinate.  foregnd_color is a pointer to the floating-point array that specifies the foreground color [0...(nbands-1)] for each pixel in the soft fill region. 

num_backgnd_color is the number of background colors in the background color list.  backgnd_color is a pointer to the floating-point array that specifies the list of background colors [num_backgnd_color][0...(nbands-1)] for each pixel in the soft fill region.  fill_color is a pointer to the floating-point array that specifies the fill color [0...(nbands-1)] for each pixel in the soft fill region. 

ROI Behavior

This function performs the fill operation on the entire source image.  The filled pixels within the ROI (region of interest) are output to the destination image. 

ERRORS

For a complete list of XIL error messages by number, consult Appendix B of the XIL Programmer’s Guide. 

EXAMPLES

For this example, the source and destination images contain 3 bands.  The foreground color and 2 background colors form the soft fill region.  Perform soft fill starting at (x,y) = (7,3). 

XilImage src;
XilImage dst;
float xseed = 7.0;
float yseed = 3.0;
float foregnd_color[3] = {255.0, 0.0, 0.0};
unsigned int num_backgnd_color = 2;
float backgnd_color[6] = {0.0, 0.0, 0.0, 0.0, 0.0, 255.0};
float fill_color [3] =  {0.0, 255.0, 0.0};
xil_soft_fill(src, dst, xseed, yseed, foregnd_color,
num_backgnd_color, backgnd_color, fill_color);

NOTES

Source and destination images must be the same data type, and have the same number of bands.  For an n-band image, the array of floats for foregnd_color and fill_color must be of size n, and backgnd_color must be of size n∗ num_backgnd_color. 

The set of basis colors, the foreground and background colors, must not be coplanar, or the algorithm will fail to determine the correct percentage for fill color.  Only pixels that are changed to the fill color are output to the destination image.  In-place operations are supported.

SEE ALSO

xil_fill(3)
 
 
 
 
 

SunOS 5.6  —  Last change: 16 June 1993

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026