Leptonica 1.68
C Image Processing Library

binexpand.c File Reference

Integer upscaling of 1 bpp images by replicated expansion. More...

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "allheaders.h"

Go to the source code of this file.

Functions

PIXpixExpandBinaryReplicate (PIX *pixs, l_int32 factor)
PIXpixExpandBinaryPower2 (PIX *pixs, l_int32 factor)

Detailed Description

Integer upscaling of 1 bpp images by replicated expansion.

    Replicated expansion (integer scaling)
       PIX     *pixExpandBinaryReplicate()

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

Definition in file binexpand.c.


Function Documentation

PIX* pixExpandBinaryReplicate ( PIX pixs,
l_int32  factor 
)

pixExpandBinaryReplicate()

Input: pixs (1 bpp) factor (integer scale factor for replicative expansion) Return: pixd (scaled up), or null on error

Definition at line 43 of file binexpand.c.

References ERROR_PTR, GET_DATA_BIT, NULL, pixCopy(), pixCopyResolution(), pixCreate(), pixExpandBinaryPower2(), pixGetData(), pixGetDimensions(), pixGetWpl(), pixScaleResolution(), PROCNAME, and SET_DATA_BIT.

Referenced by main(), and pixExpandReplicate().

PIX* pixExpandBinaryPower2 ( PIX pixs,
l_int32  factor 
)

pixExpandBinaryPower2()

Input: pixs (1 bpp) factor (expansion factor: 1, 2, 4, 8, 16) Return: pixd (expanded 1 bpp by replication), or null on error

Definition at line 105 of file binexpand.c.

References ERROR_PTR, expandBinaryPower2Low(), NULL, pixCopy(), pixCopyResolution(), pixCreate(), pixGetData(), pixGetDimensions(), pixGetWpl(), pixScaleResolution(), and PROCNAME.

Referenced by DoPageSegmentation(), main(), and pixExpandBinaryReplicate().

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines