JNIEXPORT void JNICALL SurfaceData_IntersectBounds(SurfaceDataBounds *dst, SurfaceDataBounds *src) { int t; GETMAX(dst->x1, src->x1); GETMAX(dst->y1, src->y1); GETMIN(dst->x2, src->x2); GETMIN(dst->y2, src->y2); }
JNIEXPORT void JNICALL SurfaceData_IntersectBoundsXYXY(SurfaceDataBounds *bounds, jint x1, jint y1, jint x2, jint y2) { int t; GETMAX(bounds->x1, x1); GETMAX(bounds->y1, y1); GETMIN(bounds->x2, x2); GETMIN(bounds->y2, y2); }
JNIEXPORT void JNICALL SurfaceData_IntersectBlitBounds(SurfaceDataBounds *src, SurfaceDataBounds *dst, jint dx, jint dy) { int t; GETMAX(dst->x1, src->x1 + dx); GETMAX(dst->y1, src->y1 + dy); GETMIN(dst->x2, src->x2 + dx); GETMIN(dst->y2, src->y2 + dy); GETMAX(src->x1, dst->x1 - dx); GETMAX(src->y1, dst->y1 - dy); GETMIN(src->x2, dst->x2 - dx); GETMIN(src->y2, dst->y2 - dy); }
void AlignColorSpaceGappedBounded(char *colors, int readLength, char *reference, int referenceLength, ScoringMatrix *sm, AlignedEntry *a, AlignMatrix *matrix, int32_t position, char strand, int32_t maxH, int32_t maxV) { //char *FnName = "AlignColorSpaceGappedBounded"; int i, j; int alphabetSize=ALPHABET_SIZE; assert(0 < readLength); assert(0 < referenceLength); alphabetSize = AlignColorSpaceGetAlphabetSize(colors, readLength, reference, referenceLength); AlignColorSpaceInitializeAtStart(colors, matrix, sm, readLength, referenceLength, alphabetSize, COLOR_SPACE_START_NT); /* Fill in the matrix according to the recursive rules */ for(i=0;i<readLength;i++) { /* read/rows */ /* Get the current color */ for(j=GETMAX(0, i - maxV); j <= GETMIN(referenceLength-1, referenceLength - (readLength - maxH) + i); j++) { /* reference/columns */ assert(i-maxV <= j && j <= referenceLength - (readLength - maxH) + i); AlignColorSpaceFillInCell(colors, readLength, reference, referenceLength, sm, matrix, i, j, colors[i], maxH, maxV, alphabetSize); } } AlignColorSpaceRecoverAlignmentFromMatrix(a, matrix, colors, readLength, reference, referenceLength, 0, 0, readLength - maxV, position, strand, alphabetSize, 0); }