Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ xil_paint(3) — Solaris 2.4 x86 SDK

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

xil_kernel_create(3)

xil_kernel_destroy(3)

xil_blend(3)

xil_paint(3)

NAME

xil_paint − perform paint on specified point list

SYNOPSIS

#include <xil/xil.h>

void xil_paint (XilImage src,

XilImage dst,
float ∗color,
XilKernel brush,
unsigned int count,
float ∗coord_list);

DESCRIPTION

This function blends portions of an image with a single color using a 2-D brush.  The brush is applied for each point in a list of coordinates.  For each entry in the brush, the associated pixel in the image is colored.  src is the source image handle.  dst is the destination image handle.  color is a pointer to the floating-point array that specifies the brush color [0...(nbands-1)] for each pixel.  brush is a kernel with values between 0.0 and 1.0. 

The destination value is determined by this equation:

dst_pixel = (brush_value ∗ color) + ((1.0 - brush_value) ∗ src_pixel)

Where the brush value is 0.0, the destination value is the source value.  Where the brush value is 1.0, the destination value is the paint color. 

count is the count of x,y coordinate pairs.  coord_list is a pointer to the floating-point array that specifies the x,y coordinate pairs. 

ROI Behavior

This function performs the paint operation in the source image on each point in the coordinate list.  The painted 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 2 bands.  Create a 2 x 2 brush with the key pixel at the upper left corner of the kernel.  Perform paint at pixel (x,y) = (100,75). 

XilImage src;
XilImage dst;
float paint_color[2] = {127.0, 255.0};
XilKernel brush;
float brush_data[4] = {1.0, 0.5, 0.5, 0.0};
unsigned int count = 1;
float coord_list[2] =  {100.0, 75.0};
brush = xil_kernel_create(system_state,2,2,0,0,brush_data);
xil_paint(src, dst, paint_color, brush, count, coord_list);

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 floating point numbers for color must be of size n.  Only pixels that are blended with the paint color are output to the destination image.  In-place operations are supported. 

SEE ALSO

xil_kernel_create(3), xil_kernel_destroy(3), xil_blend(3). 
 
 
 

SunOS   —  Last change: 16 June 1993

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