示例#1
0
void PageMatrixExcludeSeparators(Bool bConvertToRealCoords)
{
    LPOINT Begin, End;
    int i;

    for (i = 0; i < nSeps; i++) {
        switch (pSeps[i].Type) {
        case SEP_VERT:
        case SEP_HORZ:
            Begin.x = pSeps[i].xBegin;
            Begin.y = pSeps[i].yBegin;
            End.x = pSeps[i].xEnd;
            End.y = pSeps[i].yEnd;

            if (bConvertToRealCoords) {
                REAL_XY(Begin.x, Begin.y);
                REAL_XY(End.x, End.y);
            }

            RemoveRealPictureLine(Begin, End, pSeps[i].nWidth);
            break;
        default:
            break;
        }
    }
}
示例#2
0
void PageMatrixPutSeparators(Bool bConvertToRealCoords)
{
    LPOINT Begin, End;
    int i;

    for (i = 0; i < nSeps; i++) {
        switch (pSeps[i].Type) {
        case SEP_VERT:
        case SEP_HORZ:
            Begin.x = pSeps[i].xBegin;
            Begin.y = pSeps[i].yBegin;
            End.x = pSeps[i].xEnd;
            End.y = pSeps[i].yEnd;

            // "откатить" (назад) учет наклона
            if (bConvertToRealCoords) {
                REAL_XY(Begin.x, Begin.y);
                REAL_XY(End.x, End.y);
            }

            PutRealPictureLine(Begin, End, pSeps[i].nWidth);
            break;
        default:
            break;
        }
    }
}
示例#3
0
void BlocksCutPageEdges ()
{
    BLOCK * p;
    BLOCK * pNext;

    int x1, y1;
    int x2, y2;

    int xLeftBlockEdge;
    int xRightBlockEdge;

    pNext = pBlocksList;

    while (pNext != NULL)
    {
        p = pNext;
        pNext = pNext -> pNext;

        if (p -> Type != BLOCK_TEXT)
            continue;

        x1 = p -> Rect.xLeft;
        y1 = p -> Rect.yTop;
        x2 = p -> Rect.xLeft;
        y2 = p -> Rect.yBottom;

        REAL_XY (x1, y1);
        REAL_XY (x2, y2);

        xLeftBlockEdge = MIN (x1, x2);

        x1 = p -> Rect.xRight;
        y1 = p -> Rect.yTop;
        x2 = p -> Rect.xRight;
        y2 = p -> Rect.yBottom;

        REAL_XY (x1, y1);
        REAL_XY (x2, y2);

        xRightBlockEdge = MAX (x1, x2);

	if (cut_page_left                          &&
            xLeftBlockEdge  < 32                   &&
            xRightBlockEdge < xLastImagePixel / 2
                ||
	    cut_page_right                         &&
            xRightBlockEdge > xLastImagePixel - 32 &&
            xLeftBlockEdge  > xLastImagePixel / 2)
        {
            BlockRemove (p);
        }
    }
}
示例#4
0
void RootsRemoveFromRulers(void) {
	int x, y;
    for (ROOT * p = cf::Roots::first(); p < pAfterRoots; p++) {
        if (p->nBlock == REMOVED_BLOCK_NUMBER) {
            x = p->xColumn;
            y = p->yRow;
			REAL_XY(x, y);
		}
	}
}
示例#5
0
uchar PageMatrixFlagsByIdealXY(int xIdeal, int yIdeal)
{
    int xReal, yReal;

    if (!bPageMatrixInitialized)
        return (FALSE);

    xReal = xIdeal;
    yReal = yIdeal;
    REAL_XY(xReal, yReal);
    xReal = MIN(MAX(xReal, 0), PAGE_MATRIX_REAL_WIDTH - 1);
    yReal = MIN(MAX(yReal, 0), PAGE_MATRIX_REAL_HEIGHT - 1);
    return (PageMatrix[XY_COMPRESS(xReal) + (XY_COMPRESS(yReal)
                       << PAGE_MATRIX_WIDTH_SHIFT)]);
}
示例#6
0
void RootsRemoveFromRulers (void)
{
    ROOT *p;
    int  x, y;
    extern void del_root (int16_t row, int16_t col, int16_t h, int16_t w);

    for (p = pRoots; p < pAfterRoots; p++)
    {
        if (p -> nBlock == REMOVED_BLOCK_NUMBER)
        {
            x = p -> xColumn;
            y = p -> yRow;

            REAL_XY (x, y);
        }
    }
}