Leptonica 1.68
C Image Processing Library

ropiplow.c File Reference

Low-level implementation of in-place rasterops. More...

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

Go to the source code of this file.

Defines

#define COMBINE_PARTIAL(d, s, m)   ( ((d) & ~(m)) | ((s) & (m)) )

Functions

void rasteropVipLow (l_uint32 *data, l_int32 pixw, l_int32 pixh, l_int32 depth, l_int32 wpl, l_int32 x, l_int32 w, l_int32 shift)
void rasteropHipLow (l_uint32 *data, l_int32 pixh, l_int32 depth, l_int32 wpl, l_int32 y, l_int32 h, l_int32 shift)
void shiftDataHorizontalLow (l_uint32 *datad, l_int32 wpld, l_uint32 *datas, l_int32 wpls, l_int32 shift)

Variables

static const l_uint32 lmask32 []
static const l_uint32 rmask32 []

Detailed Description

Low-level implementation of in-place rasterops.

    Low level in-place full height vertical block transfer

         void     rasteropVipLow()

    Low level in-place full width horizontal block transfer

         void     rasteropHipLow()
         void     shiftDataHorizontalLow()

Definition in file ropiplow.c.


Define Documentation

#define COMBINE_PARTIAL (   d,
  s,
 
)    ( ((d) & ~(m)) | ((s) & (m)) )

Definition at line 33 of file ropiplow.c.

Referenced by rasteropVipLow().


Function Documentation

void rasteropVipLow ( l_uint32 data,
l_int32  pixw,
l_int32  pixh,
l_int32  depth,
l_int32  wpl,
l_int32  x,
l_int32  w,
l_int32  shift 
)

rasteropVipLow()

Input: data (ptr to image data) pixw (width) pixh (height) depth (depth) wpl (wpl) x (x val of UL corner of rectangle) w (width of rectangle) shift (+ shifts data downward in vertical column) Return: 0 if OK; 1 on error.

Notes: (1) This clears the pixels that are left exposed after the translation. You can consider them as pixels that are shifted in from outside the image. This can be later overridden by the incolor parameter in higher-level functions that call this. For example, for images with depth > 1, these pixels are cleared to black; to be white they must later be SET to white. See, e.g., pixRasteropVip(). (2) This function scales the width to accommodate any depth, performs clipping, and then does the in-place rasterop.

Definition at line 84 of file ropiplow.c.

References COMBINE_PARTIAL, L_ABS, L_MAX, lmask32, rmask32, and x0.

Referenced by pixRasteropVip().

void rasteropHipLow ( l_uint32 data,
l_int32  pixh,
l_int32  depth,
l_int32  wpl,
l_int32  y,
l_int32  h,
l_int32  shift 
)

rasteropHipLow()

Input: data (ptr to image data) pixh (height) depth (depth) wpl (wpl) y (y val of UL corner of rectangle) h (height of rectangle) shift (+ shifts data to the left in a horizontal column) Return: 0 if OK; 1 on error.

Notes: (1) This clears the pixels that are left exposed after the rasterop. Therefore, for Pix with depth > 1, these pixels become black, and must be subsequently SET if they are to be white. For example, see pixRasteropHip(). (2) This function performs clipping and calls shiftDataHorizontalLine() to do the in-place rasterop on each line.

Definition at line 308 of file ropiplow.c.

References shiftDataHorizontalLow().

Referenced by flipLRLow(), and pixRasteropHip().

void shiftDataHorizontalLow ( l_uint32 datad,
l_int32  wpld,
l_uint32 datas,
l_int32  wpls,
l_int32  shift 
)

shiftDataHorizontalLow()

Input: datad (ptr to beginning of dest line) wpld (wpl of dest) datas (ptr to beginning of src line) wpls (wpl of src) shift (horizontal shift of block; >0 is to right) Return: void

Notes: (1) This can also be used for in-place operation; see, e.g., rasteropHipLow(). (2) We are clearing the pixels that are shifted in from outside the image. This can be overridden by the incolor parameter in higher-level functions that call this.

Definition at line 355 of file ropiplow.c.

References L_MIN, lmask32, and rmask32.

Referenced by rasteropHipLow().


Variable Documentation

const l_uint32 lmask32[] [static]
Initial value:
 {0x0,
    0x80000000, 0xc0000000, 0xe0000000, 0xf0000000,
    0xf8000000, 0xfc000000, 0xfe000000, 0xff000000,
    0xff800000, 0xffc00000, 0xffe00000, 0xfff00000,
    0xfff80000, 0xfffc0000, 0xfffe0000, 0xffff0000,
    0xffff8000, 0xffffc000, 0xffffe000, 0xfffff000,
    0xfffff800, 0xfffffc00, 0xfffffe00, 0xffffff00,
    0xffffff80, 0xffffffc0, 0xffffffe0, 0xfffffff0,
    0xfffffff8, 0xfffffffc, 0xfffffffe, 0xffffffff}

Definition at line 35 of file ropiplow.c.

Referenced by rasteropVipLow(), and shiftDataHorizontalLow().

const l_uint32 rmask32[] [static]
Initial value:
 {0x0,
    0x00000001, 0x00000003, 0x00000007, 0x0000000f,
    0x0000001f, 0x0000003f, 0x0000007f, 0x000000ff,
    0x000001ff, 0x000003ff, 0x000007ff, 0x00000fff,
    0x00001fff, 0x00003fff, 0x00007fff, 0x0000ffff,
    0x0001ffff, 0x0003ffff, 0x0007ffff, 0x000fffff,
    0x001fffff, 0x003fffff, 0x007fffff, 0x00ffffff,
    0x01ffffff, 0x03ffffff, 0x07ffffff, 0x0fffffff,
    0x1fffffff, 0x3fffffff, 0x7fffffff, 0xffffffff}

Definition at line 45 of file ropiplow.c.

Referenced by rasteropVipLow(), and shiftDataHorizontalLow().

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines