XieLogical(3X) — Subroutines
Digital
NAME
XieLogical − This routine creates a new photomap from the bitwise logical combination of 2 source photomaps or 1 source photomap and a constant image.
C Format
dst_photo_id = XieLogical(src_id1, src_id2, constant, idc_id, operator)
C Argument Information
XiePhoto dst_photo_id;
XiePhoto src_id1;
XiePhoto src_id2;
unsigned long ∗constant;
XieIdc idc_id;
unsigned long operator;
RETURN VALUES
If the first source image is an unbound photomap, the routine returns the identifier of the resulting photomap in the dst_photo_id argument. Otherwise, the routine returns the identifier of the photoflo to which the processing element is appended. You can free the photomap using the XieFreeResource routine.
PARAMETERS
src_id1The src_id1 argument specifies the first source image. If this 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 image is a photoflo, or implicitly if the image is a phototap or photomap.
src_id2The src_id2 argument specifies the second source image. If the first source image is a photoflo, this image must be a photomap bound to that photoflo using the XieBindMapToFlo routine. If you specify a value of 0, the constant image becomes the second source image.
constantThe constant argument specifies the address of an array containing 1 constant value per component. For example, you could use array entries of constant[0]=pixel_value, constant[1]=pixel_value, and constant[2]=pixel_value. If the value of the src_id2 argument is not 0, the routine ignores the constant image.
idc_idThe idc_id argument specifies the optional CPP or ROI that defines the region of the image or images over which the routine operates. If you specify a value of 0, the routine operates across the entire intersection of the 2 source images.
operatorThe operator argument specifies the type of logical operation the routine performs.
| Symbol | Operation Performed |
| XieK_AND | Logical AND |
| XieK_OR | Logical OR |
| XieK_XOR | Logical XOR |
| XieK_NOT | Logical complement of src_id1 data |
| XieK_ShiftUp | Logical shift up with zero fill |
| XieK_ShiftDown | Logical shift down with zero fill |
DESCRIPTION
This routine creates a new photomap from the bitwise logical combination of 2 source photomaps or 1 source photomap and a constant image.
The 2 source images can be bitonal, gray scale, or multispectral and both must be constrained. In addition, the 2 source images must have the same number of components and are assumed to be spatially aligned. The 2 source images do not have to be the same size, but must be large enough to encompass the entire region defined by the IDC, if you specify 1.
The resulting photomap is either bitonal, gray scale, or multispectral, (depending on the source images) and is constrained. The spacial dimensions are those of the first source image.
If you specify a value of 0 for the second source image, the routine performs the operation between the first source image and a constant image. The constant array must have the same number of components as the first source image. If you specify a value that is not 0 for the second source image, the routine ignores any specified constant image.
The area over which the routine operates is the intersection of the 2 source images and the IDC if you specify 1. This is true even for the XieK_NOT logical operator, which does not actually use the data in the second source image. Any areas not affected by the operator contain the original values in the first source image.
The routine performs the logical operation on a bitwise basis between the 2 pixel values. If the values are of different depths, the routine first zero extends to the left the value with fewer bits.
If the operation is performed immediately and you selected computation events using the XieSelectEvents routine, the routine adds an XieK_ComputationEvent to the X11 event queue when the routine is completed.
XIE Events and Error Messages
Protocol Messages: X_ieLogical
XIE event returned: XieK_ComputationEvent if immediate execution and computation events are selected
XieLib errors: Returns null if the second source image is specified to be 0 and the constant array does not exist
XieServer errors: BadIDChoice -- Invalid identifier
BadAlloc -- Insufficient server resources
BadMatch -- 1 or both source images is not constrained or the 2 source images do not have the same number of components
BadAccess -- 1 source image is a photoflo and the other is not bound to it
BadValue -- IDC does not intersect the source image