Leptonica  1.82.0
Image processing and image analysis suite
binexpand.c File Reference
#include <string.h>
#include "allheaders.h"

Go to the source code of this file.

Functions

static l_uint16 * makeExpandTab2x (void)
 
static l_uint32 * makeExpandTab4x (void)
 
static l_uint32 * makeExpandTab8x (void)
 
PIXpixExpandBinaryReplicate (PIX *pixs, l_int32 xfact, l_int32 yfact)
 
PIXpixExpandBinaryPower2 (PIX *pixs, l_int32 factor)
 

Variables

static l_uint32 expandtab16 []
 

Detailed Description


     Replicated expansion (integer scaling)
        PIX     *pixExpandBinaryReplicate()

     Special case: power of 2 replicated expansion
        PIX     *pixExpandBinaryPower2()

     Expansion tables for power of 2 expansion
        static l_uint16    *makeExpandTab2x()
        static l_uint32    *makeExpandTab4x()
        static l_uint32    *makeExpandTab8x()

Definition in file binexpand.c.

Function Documentation

◆ pixExpandBinaryPower2()

PIX* pixExpandBinaryPower2 ( PIX pixs,
l_int32  factor 
)

pixExpandBinaryPower2()

Parameters
[in]pixs1 bpp
[in]factorexpansion factor: 1, 2, 4, 8, 16
Returns
pixd expanded 1 bpp by replication, or NULL on error

Definition at line 135 of file binexpand.c.

References pixCopy(), and pixGetDimensions().

Referenced by pixExpandBinaryReplicate().

◆ pixExpandBinaryReplicate()

PIX* pixExpandBinaryReplicate ( PIX pixs,
l_int32  xfact,
l_int32  yfact 
)

pixExpandBinaryReplicate()

Parameters
[in]pixs1 bpp
[in]xfactinteger scale factor for horiz. replicative expansion
[in]yfactinteger scale factor for vertical replicative expansion
Returns
pixd scaled up, or NULL on error

Definition at line 70 of file binexpand.c.

References pixCopy(), pixExpandBinaryPower2(), and pixGetDimensions().

Referenced by pixExpandReplicate().

Variable Documentation

◆ expandtab16

l_uint32 expandtab16[]
static
Initial value:
= {
0x00000000, 0x0000ffff, 0xffff0000, 0xffffffff}

Definition at line 55 of file binexpand.c.