Leptonica 1.68
C Image Processing Library
|
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.
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.
void addConstantGrayLow | ( | l_uint32 * | data, |
l_int32 | w, | ||
l_int32 | h, | ||
l_int32 | d, | ||
l_int32 | wpl, | ||
l_int32 | val | ||
) |
Definition at line 56 of file arithlow.c.
References GET_DATA_BYTE, GET_DATA_TWO_BYTES, L_MAX, L_MIN, SET_DATA_BYTE, and SET_DATA_TWO_BYTES.
Referenced by pixAddConstantGray().
void multConstantGrayLow | ( | l_uint32 * | data, |
l_int32 | w, | ||
l_int32 | h, | ||
l_int32 | d, | ||
l_int32 | wpl, | ||
l_float32 | val | ||
) |
Definition at line 113 of file arithlow.c.
References GET_DATA_BYTE, GET_DATA_TWO_BYTES, L_MIN, SET_DATA_BYTE, and SET_DATA_TWO_BYTES.
Referenced by pixMultConstantGray().
void addGrayLow | ( | l_uint32 * | datad, |
l_int32 | w, | ||
l_int32 | h, | ||
l_int32 | d, | ||
l_int32 | wpld, | ||
l_uint32 * | datas, | ||
l_int32 | wpls | ||
) |
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 | ||
) |
Definition at line 205 of file arithlow.c.
References GET_DATA_BYTE, GET_DATA_TWO_BYTES, L_MAX, SET_DATA_BYTE, and SET_DATA_TWO_BYTES.
Referenced by pixSubtractGray().
void thresholdToValueLow | ( | l_uint32 * | datad, |
l_int32 | w, | ||
l_int32 | h, | ||
l_int32 | d, | ||
l_int32 | wpld, | ||
l_int32 | threshval, | ||
l_int32 | setval | ||
) |
Definition at line 251 of file arithlow.c.
References FALSE, GET_DATA_BYTE, GET_DATA_TWO_BYTES, SET_DATA_BYTE, SET_DATA_TWO_BYTES, and TRUE.
Referenced by pixThresholdToValue().
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 | ||
) |
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 | ||
) |
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 | ||
) |
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 | ||
) |
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().