freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][gsoc-anurag-2022] Invert bitmap pitch


From: Anurag Thakur (@AdbhutDev)
Subject: [Git][freetype/freetype][gsoc-anurag-2022] Invert bitmap pitch
Date: Sun, 11 Sep 2022 12:57:47 +0000

Anurag Thakur pushed to branch gsoc-anurag-2022 at FreeType / FreeType

Commits:

  • b0854aaf
    by Anurag Thakur at 2022-09-11T18:27:10+05:30
    Invert bitmap pitch
    

1 changed file:

Changes:

  • src/dense/ftdense.c
    ... ... @@ -65,13 +65,6 @@ swap( long int* a, long int* b )
    65 65
       *b            = temp;
    
    66 66
     }
    
    67 67
     
    
    68
    -void
    
    69
    -swapold( unsigned char* a, unsigned char* b )
    
    70
    -{
    
    71
    -  unsigned char temp = *a;
    
    72
    -  *a                 = *b;
    
    73
    -  *b                 = temp;
    
    74
    -}
    
    75 68
     
    
    76 69
     void
    
    77 70
     dense_render_line( dense_worker* worker, TPos to_x, TPos to_y )
    
    ... ... @@ -437,17 +430,6 @@ dense_render_glyph( dense_worker* worker, const FT_Bitmap* target )
    437 430
         dest++;
    
    438 431
       }
    
    439 432
     
    
    440
    -  for ( int col = 0; col < worker->m_w; col++ )
    
    441
    -  {
    
    442
    -    for ( int row = 0; row < worker->m_h / 2; row++ )
    
    443
    -    {
    
    444
    -      // printf("Swapping position: %d, %d with %d, %d with rows = %d, cols =
    
    445
    -      // %d",row,col, worker->m_h-row, col, worker->m_h, worker->m_w);
    
    446
    -      swapold( target->buffer + worker->m_w * row + col,
    
    447
    -               target->buffer + ( worker->m_h - row - 1 ) * worker->m_w + col );
    
    448
    -    }
    
    449
    -  }
    
    450
    -
    
    451 433
       free(worker->m_a);
    
    452 434
       return error;
    
    453 435
     }
    
    ... ... @@ -456,7 +438,7 @@ static int
    456 438
     dense_raster_render( FT_Raster raster, const FT_Raster_Params* params )
    
    457 439
     {
    
    458 440
       const FT_Outline* outline    = (const FT_Outline*)params->source;
    
    459
    -  const FT_Bitmap*  target_map = params->target;
    
    441
    +  FT_Bitmap*  target_map = params->target;
    
    460 442
     
    
    461 443
       // dense_worker* worker = malloc( sizeof( dense_worker ) );
    
    462 444
       dense_worker worker[1];
    
    ... ... @@ -495,6 +477,10 @@ dense_raster_render( FT_Raster raster, const FT_Raster_Params* params )
    495 477
       {
    
    496 478
         return 0;
    
    497 479
       }
    
    480
    +
    
    481
    +  // Invert the pitch to account for different +ve y-axis direction in dense array
    
    482
    +  // (maybe temporary solution)
    
    483
    +  target_map->pitch *= -1;
    
    498 484
       return dense_render_glyph( worker, target_map );
    
    499 485
     }
    
    500 486
     
    


  • reply via email to

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