Leptonica 1.68
C Image Processing Library

arithlow.c File Reference

Low-level implementation of grayscale image arithmetic. More...

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

Go to the source code of this file.

Functions

void addConstantGrayLow (l_uint32 *data, l_int32 w, l_int32 h, l_int32 d, l_int32 wpl, l_int32 val)
void multConstantGrayLow (l_uint32 *data, l_int32 w, l_int32 h, l_int32 d, l_int32 wpl, l_float32 val)
void addGrayLow (l_uint32 *datad, l_int32 w, l_int32 h, l_int32 d, l_int32 wpld, l_uint32 *datas, l_int32 wpls)
void subtractGrayLow (l_uint32 *datad, l_int32 w, l_int32 h, l_int32 d, l_int32 wpld, l_uint32 *datas, l_int32 wpls)
void thresholdToValueLow (l_uint32 *datad, l_int32 w, l_int32 h, l_int32 d, l_int32 wpld, l_int32 threshval, l_int32 setval)
void finalAccumulateLow (l_uint32 *datad, l_int32 w, l_int32 h, l_int32 d, l_int32 wpld, l_uint32 *datas, l_int32 wpls, l_uint32 offset)
void finalAccumulateThreshLow (l_uint32 *datad, l_int32 w, l_int32 h, l_int32 wpld, l_uint32 *datas, l_int32 wpls, l_uint32 offset, l_uint32 threshold)
void accumulateLow (l_uint32 *datad, l_int32 w, l_int32 h, l_int32 wpld, l_uint32 *datas, l_int32 d, l_int32 wpls, l_int32 op)
void multConstAccumulateLow (l_uint32 *data, l_int32 w, l_int32 h, l_int32 wpl, l_float32 factor, l_uint32 offset)
void absDifferenceLow (l_uint32 *datad, l_int32 w, l_int32 h, l_int32 wpld, l_uint32 *datas1, l_uint32 *datas2, l_int32 d, l_int32 wpls)

Detailed Description

Low-level implementation of grayscale image arithmetic.

    One image grayscale arithmetic (8, 16 or 32 bpp)
          void       addConstantGrayLow()
          void       multConstantGrayLow()

    Two image grayscale arithmetic (8, 16 or 32 bpp)
          void       addGrayLow()
          void       subtractGrayLow()

    Grayscale threshold operation (8, 16 or 32 bpp)
          void       thresholdToValueLow()

    Image accumulator arithmetic operations (8, 16, 32 bpp)
          void       finalAccumulateLow()
          void       finalAccumulateThreshLow()
          void       accumulateLow()
          void       multConstAccumulateLow()

    Absolute value of difference, component-wise.
          void       absDifferenceLow()

Definition in file arithlow.c.


Function Documentation

void addConstantGrayLow ( l_uint32 data,
l_int32  w,
l_int32  h,
l_int32  d,
l_int32  wpl,
l_int32  val 
)
void multConstantGrayLow ( l_uint32 data,
l_int32  w,
l_int32  h,
l_int32  d,
l_int32  wpl,
l_float32  val 
)
void addGrayLow ( l_uint32 datad,
l_int32  w,
l_int32  h,
l_int32  d,
l_int32  wpld,
l_uint32 datas,
l_int32  wpls 
)

addGrayLow()

Definition at line 161 of file arithlow.c.

References GET_DATA_BYTE, GET_DATA_TWO_BYTES, L_MIN, SET_DATA_BYTE, and SET_DATA_TWO_BYTES.

Referenced by pixAddGray().

void subtractGrayLow ( l_uint32 datad,
l_int32  w,
l_int32  h,
l_int32  d,
l_int32  wpld,
l_uint32 datas,
l_int32  wpls 
)
void thresholdToValueLow ( l_uint32 datad,
l_int32  w,
l_int32  h,
l_int32  d,
l_int32  wpld,
l_int32  threshval,
l_int32  setval 
)
void finalAccumulateLow ( l_uint32 datad,
l_int32  w,
l_int32  h,
l_int32  d,
l_int32  wpld,
l_uint32 datas,
l_int32  wpls,
l_uint32  offset 
)

finalAccumulateLow()

Definition at line 322 of file arithlow.c.

References L_MAX, L_MIN, SET_DATA_BYTE, and SET_DATA_TWO_BYTES.

Referenced by pixFinalAccumulate().

void finalAccumulateThreshLow ( l_uint32 datad,
l_int32  w,
l_int32  h,
l_int32  wpld,
l_uint32 datas,
l_int32  wpls,
l_uint32  offset,
l_uint32  threshold 
)

Definition at line 375 of file arithlow.c.

References SET_DATA_BIT.

Referenced by pixFinalAccumulateThreshold().

void accumulateLow ( l_uint32 datad,
l_int32  w,
l_int32  h,
l_int32  wpld,
l_uint32 datas,
l_int32  d,
l_int32  wpls,
l_int32  op 
)

accumulateLow()

Definition at line 406 of file arithlow.c.

References GET_DATA_BIT, GET_DATA_BYTE, GET_DATA_TWO_BYTES, and L_ARITH_ADD.

Referenced by pixAccumulate().

void multConstAccumulateLow ( l_uint32 data,
l_int32  w,
l_int32  h,
l_int32  wpl,
l_float32  factor,
l_uint32  offset 
)

multConstAccumulateLow()

Definition at line 485 of file arithlow.c.

Referenced by pixMultConstAccumulate().

void absDifferenceLow ( l_uint32 datad,
l_int32  w,
l_int32  h,
l_int32  wpld,
l_uint32 datas1,
l_uint32 datas2,
l_int32  d,
l_int32  wpls 
)

absDifferenceLow()

Finds the absolute value of the difference of each pixel, for 8 and 16 bpp gray and for 32 bpp rgb. For 32 bpp, the differences are found for each of the RGB components separately, and the LSB component is ignored. The results are written into datad.

Definition at line 522 of file arithlow.c.

References COLOR_BLUE, COLOR_GREEN, COLOR_RED, GET_DATA_BYTE, GET_DATA_TWO_BYTES, L_ABS, L_ERROR, PROCNAME, SET_DATA_BYTE, and SET_DATA_TWO_BYTES.

Referenced by pixAbsDifference().

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines