XieArea(3X) — Subroutines
Digital
NAME
XieArea − This routine creates a new image by transforming a source image using an area operator.
C Format
dst_photo_id = XieArea(src_id, tmp_id, idc_id, op1, op2, constrain)
C Argument Information
XiePhoto dst_photo_id;
XiePhoto src_id;
XieTmp tmp_id;
XieIdc idc_id;
unsigned long op1;
unsigned long op2;
unsigned long constrain;
RETURN VALUES
If the source image is an unbound photomap, the routine returns the identifier of the newly created photomap in the dst_photo_id argument. Otherwise, the routine returns the identifier of the photoflo to which the routine is appended. You can free the photomap using the XieFreeResource routine.
PARAMETERS
src_idThe src_id argument specifies the identifier of the source image. If the source image is an unbound photomap, the operation is performed immediately. Otherwise, a processing element is appended to the specified photoflo with execution pending a call to the XieExecuteFlo routine. The photoflo is specified explicitly if the source image is a photoflo, or implicitly if the source image argument is a photomap or a phototap bound to the photoflo.
tmp_idThe tmp_id argument specifies the Image Domain Context (IDC) of type TMP (template) that contains the coefficients used in the area transformation. The spatial registration of the template relative to each pixel is established by the x-coordinate and the y-coordinate of the template center. The template is specified in the positive x- and positive y-quadrant of the Cartesian coordinate system.
idc_idThe idc_id argument specifies the optional IDC of type CPP (control processing plane) or ROI (region of interest) that defines the region of the image over which the routine operates. If you specify a value of 0, the routine operates across the entire source image.
op1The op1 argument specifies the first operation performed between each element of the template and the corresponding pixel in the source image.
op2The op2 argument specifies the second operation performed between the results obtained from the first operation. The result of the second operation is the resultant pixel value.
| Symbol | Operation Performed |
| XieK_AreaOp1Add | Adds the corresponding pixel and template values |
| XieK_AreaOp1Mult | Multiplies the corresponding pixel and template values |
| XieK_AreaOp2Min | Selects the minimum value resulting from applying the first operator |
| XieK_AreaOp2Max | Selects the maximum value resulting from applying the first operator |
| XieK_AreaOp2Sum | Sums the values resulting from applying the first operator |
constrainThe constrain argument is a Boolean flag that indicates whether or not the routine constrains the resulting image data before being written to the destination image. If you specify True, the routine constrains the image data based on the current constraint model. If you specify False, the resulting image data remains unconstrained.
DESCRIPTION
This routine creates a new image by transforming an existing image using an area operator. The routine calculates the transformed value of each pixel based on the pixel values in the area surrounding the pixel. The routine performs the calculation in 2 steps, controlled by the op1 and op2 arguments. In the first step, the pointwise sum or product of the template coefficients and the source image is calculated, producing a two-dimensional array of values. In the second step, the minimum, maximum, or sum is applied to the two-dimensional array to yield a single, transformed pixel value. The registration of the template relative to a particular pixel is established by the x-coordinate and the y-coordinate values of the template center.
The destination image has the same spatial dimensions as those of the source image. The routine transforms the entire source image unless you specify an IDC. When you do use an IDC, the region outside the area defined by the IDC contains the original source values. If positioning of the template causes some of the template values to extend beyond the boundaries of the source image, the routine extends the image and sets the resulting pixel values in the extended area to 0. However, if the template extends outside the boundaries of the IDC, the routine uses the template values within for the extended area. This avoids introducing artifacts into the resulting image.
The routine converts the source image and the template to be unconstrained before performing the transformation. If the value of the constrain argument is True, the routine constrains the resulting image data before writing it to the destination image.
If the operation is performed immediately and you selected computation events using the XieSelectEvents routine, the routine adds an XieM_ComputationEvent to the X11 event queue when the routine is completed.
XIE Events and Error Messages
Protocol Messages: X_ieArea
XIE event returned: XieK_ComputationEvent if immediate execution and computation events are selected
XieLib errors: None
XieServer errors: BadIDChoice -- Invalid identifier
BadAlloc -- Insufficient server resources
BadValue -- Invalid area operator or IDC does not intersect the image