void PageStrings1 (void) { int i; # ifdef MA_DEBUG AllocationsAccountingOpen (); # endif if (nRoots == 0) ErrorEmptyPage(); // ErrorInternal ("Page is empty"); nNextBlockNumber = FIRST_REGULAR_BLOCK_NUMBER; # ifdef LT_DEBUG if (LT_DebugGraphicsLevel > 0) LT_GraphicsOpen (); if (bDebugTimeFlag) tTimeTotal = clock (); # endif RootsSaveNonLayoutData (); CalculatePageParameters (); # ifdef LT_DEBUG if (LT_DebugGraphicsLevel >= 2) LT_GraphicsRootsOutput ("Roots"); # endif // InclinesAccount (); RotatePageToIdeal (); // InclinesFreeData (); RootStripsCalculate (); for (i = 0; i < nRoots; i++) pRoots [i].nBlock = FIRST_REGULAR_BLOCK_NUMBER; # ifdef LT_DEBUG if (LT_DebugGraphicsLevel >= 2) LT_GraphicsRootsOutput ("Roots after page rotation"); # endif BlocksExtract (); //BlockAnalyse(); # ifdef LT_DEBUG if (LT_DebugGraphicsLevel >= 2) LT_GraphicsBlocksOutput ("Blocks after extraction"); # endif }
void StringsExtract(void) { if (pBlocksList == NULL) return; # ifdef SE_DEBUG if (SE_DebugGraphicsLevel > 0) LT_GraphicsOpen (); # endif RootsRestoreNonLayoutData_ForDustAndRemoved(); BlocksAccessTableBuild(); BlocksHystogramsBuild(); nCurrentFillingRoots = 0; for (nCurrentBlock = nMinBlock; nCurrentBlock <= nMaxBlock; nCurrentBlock++) { pCurrentBlock = pBlockPointer[nCurrentBlock]; if (pCurrentBlock != NULL) StringsForming(); } SE_FreeAllData(); }
void PageLayoutPart1 (void) { int i; i=0; i=i; # ifdef MA_DEBUG AllocationsAccountingOpen (); # endif # ifdef LT_DUMP pfListing = fopen ("layout.dmp", "w"); if (pfListing == NULL) ErrorInternal ("Can't open dump file"); fprintf (pfListing, "nRoots: %d\n", (int) nRoots); { int i; for (i = 0; i < nRoots; i++) { fprintf (pfListing, "x: %4d, y: %4d, w: %4d, h: %4d, block: %4d/%4d [%4x %4x] %4x\n", (int) pRoots [i].xColumn, (int) pRoots [i].yRow, (int) pRoots [i].nWidth, (int) pRoots [i].nHeight, (int) pRoots [i].nBlock, (int) pRoots [i].nUserNum, 0, //(int) pRoots [i].wSegmentPtr, 0, //(int) pRoots [i].wLength); (int) pRoots [i].bType); } } fclose (pfListing); # endif if (nRoots == 0) //ErrorInternal ("Page is empty"); return; nNextBlockNumber = FIRST_REGULAR_BLOCK_NUMBER; # ifdef LT_DEBUG //if (LT_DebugGraphicsLevel > 0) if( !LDPUMA_Skip (hPageBeforeEditing) || !LDPUMA_Skip (hPageMatrix) || !LDPUMA_Skip (hInitialBreaking) || !LDPUMA_Skip (hInclineCalculating) || !LDPUMA_Skip (hBlocksBreaking) || !LDPUMA_Skip (hBlocksGlueing) || !LDPUMA_Skip (hFirstDustAbsorbtion) || !LDPUMA_Skip (hRemoveEmptyBlocks) || !LDPUMA_Skip (hSecondDustAbsorbtion)) { LT_GraphicsOpen (); } if (bDebugTimeFlag) tTimeTotal = clock (); # endif RootsSaveNonLayoutData (); CalculatePageParameters (); SeparatorsGet (); # ifdef LT_DEBUG //if (LT_DebugGraphicsLevel >= 2) if (!LDPUMA_Skip(hPageBeforeEditing)) LT_GraphicsRootsOutput ("Page"); # endif if (bOptionInitialBreakingByPageMatrix || bOptionBlocksRemovingByPageMatrix) { PageMatrixBuild (); } # ifdef LT_DEBUG //if (LT_DebugGraphicsLevel >= 2) if (!LDPUMA_Skip(hPageMatrix)) LT_GraphicsPageMatrixOutput ("Page matrix"); # endif // выделить в матрице страницы компоненты связности; // настроить в рутах поле nBlock на хранение этой // полезной информации; сами компоненты связности -- не хранятся. InitialBreakingProceed (); # ifdef LT_DEBUG //if (LT_DebugGraphicsLevel >= 3) if (!LDPUMA_Skip(hInitialBreaking)) LT_GraphicsBlocksOutput ("Initial breaking"); # endif // InclinesAccount (); RotatePageToIdeal (); // InclinesFreeData (); RootStripsCalculate (); # ifdef LT_DEBUG //if (LT_DebugGraphicsLevel >= 3) if(!LDPUMA_Skip(hInclineCalculating)) { LT_GraphicsRootsOutput ("Roots after page rotation"); LT_GraphicsRootStripsOutput ("Root strips"); } # endif BlocksExtract (); //BlockAnalyse(); # ifdef LT_DEBUG //if (LT_DebugGraphicsLevel >= 2) // LT_GraphicsBlocksOutput ("Blocks after extraction.1"); # endif /* Pit 09-27-94 03:42pm new_picture(3,5,300,500); del_picture(0); new_picture(300,500,100,100); BlocksExtract (); # ifdef LT_DEBUG if (LT_DebugGraphicsLevel >= 2) LT_GraphicsBlocksOutput ("Blocks after extraction.2"); # endif */ BlocksBreak (); # ifdef LT_DEBUG //if (LT_DebugGraphicsLevel >= 2) if(!LDPUMA_Skip(hBlocksBreaking)) LT_GraphicsBlocksOutput ("Blocks after breaking"); # endif BlocksAddVirtualSeparatorsBlocks (); # ifdef LT_DEBUG //if (LT_DebugGraphicsLevel >= 2) // LT_GraphicsBlocksOutput ("Blocks after adding separators"); # endif BlocksRemoveFrameLikeRoots (); # ifdef LT_DEBUG //if (LT_DebugGraphicsLevel >= 2) // LT_GraphicsBlocksOutput ("After removing frame like roots"); # endif BlocksGlue (); # ifdef LT_DEBUG //if (LT_DebugGraphicsLevel >= 2) if(!LDPUMA_Skip(hBlocksGlueing)) LT_GraphicsBlocksOutput ("Blocks after glueing"); # endif BlocksBuildEmbeddingLists (); # ifdef LT_DEBUG //if (LT_DebugGraphicsLevel >= 3) //{ // LT_GraphicsHighEmbeddingBlocksListOutput ("High embedding blocks list"); // LT_GraphicsLowEmbeddingBlocksListOutput ("Low embedding blocks list"); //} # endif BlocksAbsorbDust (); # ifdef LT_DEBUG //if (LT_DebugGraphicsLevel >= 2) if(!LDPUMA_Skip(hFirstDustAbsorbtion)) LT_GraphicsBlocksOutput ("After first dust absorbtion"); # endif PageMatrixExcludeSeparators (TRUE); # ifdef LT_DEBUG //if (LT_DebugGraphicsLevel >= 2) // LT_GraphicsPageMatrixOutput ("Matrix after excluding separators"); # endif BlocksRemoveEmptyBlocks (); # ifdef LT_DEBUG //if (LT_DebugGraphicsLevel >= 2) if(!LDPUMA_Skip(hRemoveEmptyBlocks)) LT_GraphicsBlocksOutput ("After removing empty blocks"); # endif BlocksAbsorbDust (); BlocksDisAbsorbBoundaryDust (); # ifdef LT_DEBUG //if (LT_DebugGraphicsLevel >= 2) if(!LDPUMA_Skip(hSecondDustAbsorbtion)) LT_GraphicsBlocksOutput ("After second dust absorbtion"); # endif if (cut_page_left || cut_page_right) { BlocksCutPageEdges (); # ifdef LT_DEBUG // if (LT_DebugGraphicsLevel >= 2) // LT_GraphicsBlocksOutput ("After BlocksCutPageEdges"); # endif } LayoutBackupFreeData (); }