Krita Source Code Documentation
Loading...
Searching...
No Matches
scaletab.c File Reference
#include "pixels.h"

Go to the source code of this file.

Functions

void mk_scaletable (void)
 

Variables

int ok_scaletable = 0
 
uint8_t scaletable [256][256]
 

Function Documentation

◆ mk_scaletable()

void mk_scaletable ( void )

Definition at line 26 of file scaletab.c.

27{
28 unsigned p, q, r ;
29 if( ok_scaletable ) return ;
30 for( p = 0 ; p < 128 ; p++ )
31 for( q = 0 ; q <= p ; q++ ) {
32 r = (p*q+127)/255 ;
33 scaletable[p][q] = scaletable[q][p] = r ;
34 scaletable[255-p][q] = scaletable[q][255-p] = q-r ;
35 scaletable[p][255-q] = scaletable[255-q][p] = p-r ;
36 scaletable[255-p][255-q] = scaletable[255-q][255-p] = (255-q)-(p-r) ;
37 }
38 ok_scaletable = 1 ;
39}
const Params2D p
uint8_t scaletable[256][256]
Definition scaletab.c:22
int ok_scaletable
Definition scaletab.c:23

References ok_scaletable, p, and scaletable.

Variable Documentation

◆ ok_scaletable

int ok_scaletable = 0

Definition at line 23 of file scaletab.c.

◆ scaletable

uint8_t scaletable[256][256]

Definition at line 22 of file scaletab.c.