Файл src/fpix1.c

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

Функции

FPIXfpixCreate (l_int32 width, l_int32 height)
FPIXfpixCreateTemplate (FPIX *fpixs)
FPIXfpixClone (FPIX *fpix)
FPIXfpixCopy (FPIX *fpixd, FPIX *fpixs)
l_int32 fpixResizeImageData (FPIX *fpixd, FPIX *fpixs)
void fpixDestroy (FPIX **pfpix)
l_int32 fpixGetDimensions (FPIX *fpix, l_int32 *pw, l_int32 *ph)
l_int32 fpixSetDimensions (FPIX *fpix, l_int32 w, l_int32 h)
l_int32 fpixGetWpl (FPIX *fpix)
l_int32 fpixSetWpl (FPIX *fpix, l_int32 wpl)
l_int32 fpixGetRefcount (FPIX *fpix)
l_int32 fpixChangeRefcount (FPIX *fpix, l_int32 delta)
l_int32 fpixGetResolution (FPIX *fpix, l_int32 *pxres, l_int32 *pyres)
l_int32 fpixSetResolution (FPIX *fpix, l_int32 xres, l_int32 yres)
l_int32 fpixCopyResolution (FPIX *fpixd, FPIX *fpixs)
l_float32fpixGetData (FPIX *fpix)
l_int32 fpixSetData (FPIX *fpix, l_float32 *data)
DPIXdpixCreate (l_int32 width, l_int32 height)
DPIXdpixCreateTemplate (DPIX *dpixs)
DPIXdpixClone (DPIX *dpix)
DPIXdpixCopy (DPIX *dpixd, DPIX *dpixs)
l_int32 dpixResizeImageData (DPIX *dpixd, DPIX *dpixs)
void dpixDestroy (DPIX **pdpix)
l_int32 dpixGetDimensions (DPIX *dpix, l_int32 *pw, l_int32 *ph)
l_int32 dpixSetDimensions (DPIX *dpix, l_int32 w, l_int32 h)
l_int32 dpixGetWpl (DPIX *dpix)
l_int32 dpixSetWpl (DPIX *dpix, l_int32 wpl)
l_int32 dpixGetRefcount (DPIX *dpix)
l_int32 dpixChangeRefcount (DPIX *dpix, l_int32 delta)
l_int32 dpixGetResolution (DPIX *dpix, l_int32 *pxres, l_int32 *pyres)
l_int32 dpixSetResolution (DPIX *dpix, l_int32 xres, l_int32 yres)
l_int32 dpixCopyResolution (DPIX *dpixd, DPIX *dpixs)
l_float64dpixGetData (DPIX *dpix)
l_int32 dpixSetData (DPIX *dpix, l_float64 *data)

Функции

l_int32 dpixChangeRefcount ( DPIX dpix,
l_int32  delta 
)

DPIX* dpixClone ( DPIX dpix  ) 

dpixClone()

Input: dpix Return: same dpix (ptr), or null on error

Notes: (1) See pixClone() for definition and usage.

DPIX* dpixCopy ( DPIX dpixd,
DPIX dpixs 
)

dpixCopy()

Input: dpixd (<optional>; can be null, or equal to dpixs, or different from dpixs) dpixs Return: dpixd, or null on error

Notes: (1) There are three cases: (a) dpixd == null (makes a new dpix; refcount = 1) (b) dpixd == dpixs (no-op) (c) dpixd != dpixs (data copy; no change in refcount) If the refcount of dpixd > 1, case (c) will side-effect these handles. (2) The general pattern of use is: dpixd = dpixCopy(dpixd, dpixs); This will work for all three cases. For clarity when the case is known, you can use: (a) dpixd = dpixCopy(NULL, dpixs); (c) dpixCopy(dpixd, dpixs); (3) For case (c), we check if dpixs and dpixd are the same size. If so, the data is copied directly. Otherwise, the data is reallocated to the correct size and the copy proceeds. The refcount of dpixd is unchanged. (4) This operation, like all others that may involve a pre-existing dpixd, will side-effect any existing clones of dpixd.

l_int32 dpixCopyResolution ( DPIX dpixd,
DPIX dpixs 
)

DPIX* dpixCreate ( l_int32  width,
l_int32  height 
)

dpixCreate()

Input: width, height Return: dpix (with data allocated and initialized to 0), or null on error

Notes: (1) Makes a DPix of specified size, with the data array allocated and initialized to 0.

DPIX* dpixCreateTemplate ( DPIX dpixs  ) 

dpixCreateTemplate()

Input: dpixs Return: dpixd, or null on error

Notes: (1) Makes a DPix of the same size as the input DPix, with the data array allocated and initialized to 0. (2) Copies the resolution.

void dpixDestroy ( DPIX **  pdpix  ) 

dpixDestroy()

Input: &dpix <will be="" nulled>=""> Return: void

Notes: (1) Decrements the ref count and, if 0, destroys the dpix. (2) Always nulls the input ptr.

l_float64* dpixGetData ( DPIX dpix  ) 

l_int32 dpixGetDimensions ( DPIX dpix,
l_int32 pw,
l_int32 ph 
)

dpixGetDimensions()

Input: dpix &w, &h (<optional return>="">; each can be null) Return: 0 if OK, 1 on error

l_int32 dpixGetRefcount ( DPIX dpix  ) 

l_int32 dpixGetResolution ( DPIX dpix,
l_int32 pxres,
l_int32 pyres 
)

l_int32 dpixGetWpl ( DPIX dpix  ) 

l_int32 dpixResizeImageData ( DPIX dpixd,
DPIX dpixs 
)

dpixResizeImageData()

Input: dpixd, dpixs Return: 0 if OK, 1 on error

l_int32 dpixSetData ( DPIX dpix,
l_float64 data 
)

l_int32 dpixSetDimensions ( DPIX dpix,
l_int32  w,
l_int32  h 
)

dpixSetDimensions()

Input: dpix w, h Return: 0 if OK, 1 on error

l_int32 dpixSetResolution ( DPIX dpix,
l_int32  xres,
l_int32  yres 
)

l_int32 dpixSetWpl ( DPIX dpix,
l_int32  wpl 
)

l_int32 fpixChangeRefcount ( FPIX fpix,
l_int32  delta 
)

FPIX* fpixClone ( FPIX fpix  ) 

fpixClone()

Input: fpix Return: same fpix (ptr), or null on error

Notes: (1) See pixClone() for definition and usage.

FPIX* fpixCopy ( FPIX fpixd,
FPIX fpixs 
)

fpixCopy()

Input: fpixd (<optional>; can be null, or equal to fpixs, or different from fpixs) fpixs Return: fpixd, or null on error

Notes: (1) There are three cases: (a) fpixd == null (makes a new fpix; refcount = 1) (b) fpixd == fpixs (no-op) (c) fpixd != fpixs (data copy; no change in refcount) If the refcount of fpixd > 1, case (c) will side-effect these handles. (2) The general pattern of use is: fpixd = fpixCopy(fpixd, fpixs); This will work for all three cases. For clarity when the case is known, you can use: (a) fpixd = fpixCopy(NULL, fpixs); (c) fpixCopy(fpixd, fpixs); (3) For case (c), we check if fpixs and fpixd are the same size. If so, the data is copied directly. Otherwise, the data is reallocated to the correct size and the copy proceeds. The refcount of fpixd is unchanged. (4) This operation, like all others that may involve a pre-existing fpixd, will side-effect any existing clones of fpixd.

l_int32 fpixCopyResolution ( FPIX fpixd,
FPIX fpixs 
)

FPIX* fpixCreate ( l_int32  width,
l_int32  height 
)

fpixCreate()

Input: width, height Return: fpixd (with data allocated and initialized to 0), or null on error

Notes: (1) Makes a FPix of specified size, with the data array allocated and initialized to 0.

FPIX* fpixCreateTemplate ( FPIX fpixs  ) 

fpixCreateTemplate()

Input: fpixs Return: fpixd, or null on error

Notes: (1) Makes a FPix of the same size as the input FPix, with the data array allocated and initialized to 0. (2) Copies the resolution.

void fpixDestroy ( FPIX **  pfpix  ) 

fpixDestroy()

Input: &fpix <will be="" nulled>=""> Return: void

Notes: (1) Decrements the ref count and, if 0, destroys the fpix. (2) Always nulls the input ptr.

l_float32* fpixGetData ( FPIX fpix  ) 

l_int32 fpixGetDimensions ( FPIX fpix,
l_int32 pw,
l_int32 ph 
)

fpixGetDimensions()

Input: fpix &w, &h (<optional return>="">; each can be null) Return: 0 if OK, 1 on error

l_int32 fpixGetRefcount ( FPIX fpix  ) 

l_int32 fpixGetResolution ( FPIX fpix,
l_int32 pxres,
l_int32 pyres 
)

l_int32 fpixGetWpl ( FPIX fpix  ) 

l_int32 fpixResizeImageData ( FPIX fpixd,
FPIX fpixs 
)

fpixResizeImageData()

Input: fpixd, fpixs Return: 0 if OK, 1 on error

l_int32 fpixSetData ( FPIX fpix,
l_float32 data 
)

l_int32 fpixSetDimensions ( FPIX fpix,
l_int32  w,
l_int32  h 
)

fpixSetDimensions()

Input: fpix w, h Return: 0 if OK, 1 on error

l_int32 fpixSetResolution ( FPIX fpix,
l_int32  xres,
l_int32  yres 
)

l_int32 fpixSetWpl ( FPIX fpix,
l_int32  wpl 
)


Документация по Leptonica. Последние изменения: Fri Aug 7 20:31:35 2009. Создано системой  doxygen 1.5.9