freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Git][freetype/freetype][master] * src/raster/ftraster.c (FT_Outline_Get


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype][master] * src/raster/ftraster.c (FT_Outline_Get_CBox ) [STANDALONE_]: Removed.
Date: Tue, 21 Nov 2023 18:12:52 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType

Commits:

  • df39b017
    by Alexei Podtelezhnikov (Алексей Подтележников) at 2023-11-21T18:12:45+00:00
    * src/raster/ftraster.c (FT_Outline_Get_CBox ) [STANDALONE_]: Removed.

1 changed file:

Changes:

  • src/raster/ftraster.c
    ... ... @@ -2427,94 +2427,6 @@
    2427 2427
       }
    
    2428 2428
     
    
    2429 2429
     
    
    2430
    -#ifdef STANDALONE_
    
    2431
    -
    
    2432
    -  /**************************************************************************
    
    2433
    -   *
    
    2434
    -   * The following functions should only compile in stand-alone mode,
    
    2435
    -   * i.e., when building this component without the rest of FreeType.
    
    2436
    -   *
    
    2437
    -   */
    
    2438
    -
    
    2439
    -  /**************************************************************************
    
    2440
    -   *
    
    2441
    -   * @Function:
    
    2442
    -   *   FT_Outline_Get_CBox
    
    2443
    -   *
    
    2444
    -   * @Description:
    
    2445
    -   *   Return an outline's `control box'.  The control box encloses all
    
    2446
    -   *   the outline's points, including Bézier control points.  Though it
    
    2447
    -   *   coincides with the exact bounding box for most glyphs, it can be
    
    2448
    -   *   slightly larger in some situations (like when rotating an outline
    
    2449
    -   *   that contains Bézier outside arcs).
    
    2450
    -   *
    
    2451
    -   *   Computing the control box is very fast, while getting the bounding
    
    2452
    -   *   box can take much more time as it needs to walk over all segments
    
    2453
    -   *   and arcs in the outline.  To get the latter, you can use the
    
    2454
    -   *   `ftbbox' component, which is dedicated to this single task.
    
    2455
    -   *
    
    2456
    -   * @Input:
    
    2457
    -   *   outline ::
    
    2458
    -   *     A pointer to the source outline descriptor.
    
    2459
    -   *
    
    2460
    -   * @Output:
    
    2461
    -   *   acbox ::
    
    2462
    -   *     The outline's control box.
    
    2463
    -   *
    
    2464
    -   * @Note:
    
    2465
    -   *   See @FT_Glyph_Get_CBox for a discussion of tricky fonts.
    
    2466
    -   */
    
    2467
    -
    
    2468
    -  static void
    
    2469
    -  FT_Outline_Get_CBox( const FT_Outline*  outline,
    
    2470
    -                       FT_BBox           *acbox )
    
    2471
    -  {
    
    2472
    -    if ( outline && acbox )
    
    2473
    -    {
    
    2474
    -      Long  xMin, yMin, xMax, yMax;
    
    2475
    -
    
    2476
    -
    
    2477
    -      if ( outline->n_points == 0 )
    
    2478
    -      {
    
    2479
    -        xMin = 0;
    
    2480
    -        yMin = 0;
    
    2481
    -        xMax = 0;
    
    2482
    -        yMax = 0;
    
    2483
    -      }
    
    2484
    -      else
    
    2485
    -      {
    
    2486
    -        FT_Vector*  vec   = outline->points;
    
    2487
    -        FT_Vector*  limit = vec + outline->n_points;
    
    2488
    -
    
    2489
    -
    
    2490
    -        xMin = xMax = vec->x;
    
    2491
    -        yMin = yMax = vec->y;
    
    2492
    -        vec++;
    
    2493
    -
    
    2494
    -        for ( ; vec < limit; vec++ )
    
    2495
    -        {
    
    2496
    -          Long  x, y;
    
    2497
    -
    
    2498
    -
    
    2499
    -          x = vec->x;
    
    2500
    -          if ( x < xMin ) xMin = x;
    
    2501
    -          if ( x > xMax ) xMax = x;
    
    2502
    -
    
    2503
    -          y = vec->y;
    
    2504
    -          if ( y < yMin ) yMin = y;
    
    2505
    -          if ( y > yMax ) yMax = y;
    
    2506
    -        }
    
    2507
    -      }
    
    2508
    -      acbox->xMin = xMin;
    
    2509
    -      acbox->xMax = xMax;
    
    2510
    -      acbox->yMin = yMin;
    
    2511
    -      acbox->yMax = yMax;
    
    2512
    -    }
    
    2513
    -  }
    
    2514
    -
    
    2515
    -#endif /* STANDALONE_ */
    
    2516
    -
    
    2517
    -
    
    2518 2430
       /**************************************************************************
    
    2519 2431
        *
    
    2520 2432
        * @Function:
    


  • reply via email to

    [Prev in Thread] Current Thread [Next in Thread]