Woolz Image Processing  Version 1.8.3
WlzValueUtils.c File Reference

Many small functions for setting, copying and converting values. More...

Functions

void WlzValueSetInt (int *vec, int value, size_t count)
 Sets the elements of the given vector to a given value, where the vector type is int. More...
 
void WlzValueSetShort (short *vec, short value, size_t count)
 Sets the elements of the given vector to a given value, where the vector type is short. More...
 
void WlzValueSetUByte (WlzUByte *vec, WlzUByte value, size_t count)
 Sets the elements of the given vector to a given value, where the vector type is WlzUByte. More...
 
void WlzValueSetFloat (float *vec, float value, size_t count)
 Sets the elements of the given vector to a given value, where the vector type is float. More...
 
void WlzValueSetDouble (double *vec, double value, size_t count)
 Sets the elements of the given vector to a given value, where the vector type is double. More...
 
void WlzValueSetRGBA (WlzUInt *vec, WlzUInt value, size_t count)
 Sets the elements of the given vector to a given value, where the vector type is rgb-alpha. More...
 
void WlzValueSetDVertex (WlzDVertex2 *vec, WlzDVertex2 value, size_t count)
 Sets the elements of the given vector to a given value, where the vector type is WlzDVertex2. More...
 
void WlzValueSetFVertex (WlzFVertex2 *vec, WlzFVertex2 value, size_t count)
 Sets the elements of the given vector to a given value, where the vector type is WlzFVertex2. More...
 
void WlzValueSetIVertex (WlzIVertex2 *vec, WlzIVertex2 value, size_t count)
 Sets the elements of the given vector to a given value, where the vector type is WlzIVertex2. More...
 
void WlzValueSetGrey (WlzGreyP vec, size_t vecOff, WlzGreyV value, WlzGreyType gType, size_t count)
 Sets the elements of the given vector to a given value, where the vector type is any one of int, short, WlzUByte, float, double. More...
 
WlzGreyP WlzValueSetGreyP (WlzGreyP base, WlzGreyType gType, size_t off)
 Sets a grey pointer using the given base grey pointer and an offset. More...
 
void WlzValueClampIntToShort (int *vec, size_t count)
 Clamps a vector of int values to the limits of short. More...
 
void WlzValueClampIntToUByte (int *vec, size_t count)
 Clamps a vector of int values to the limits of WlzUByte. More...
 
void WlzValueClampShortToUByte (short *vec, size_t count)
 Clamps a vector of short values to the limits of WlzUByte. More...
 
void WlzValueClampDoubleToInt (double *vec, size_t count)
 Clamps a vector of double values to the limits of int. More...
 
void WlzValueClampDoubleToShort (double *vec, size_t count)
 Clamps a vector of double values to the limits of short. More...
 
void WlzValueClampDoubleToUByte (double *vec, size_t count)
 Clamps a vector of double values to the limits of WlzUByte. More...
 
void WlzValueClampDoubleToRGBA (double *vec, size_t count)
 Clamps a vector of double values to the limits of RGBA. More...
 
void WlzValueClampDoubleToFloat (double *vec, size_t count)
 Clamps a vector of double values to the limits of float. More...
 
void WlzValueClampFloatToInt (float *vec, size_t count)
 Clamps a vector of float values to the limits of int. More...
 
void WlzValueClampFloatToShort (float *vec, size_t count)
 Clamps a vector of float values to the limits of short. More...
 
void WlzValueClampFloatToUByte (float *vec, size_t count)
 Clamps a vector of float values to the limits of WlzUByte. More...
 
void WlzValueClampIntIntoShort (short *dst, int *src, size_t count)
 Clamps a vector of int values into a vector of short values. More...
 
void WlzValueClampIntIntoUByte (WlzUByte *dst, int *src, size_t count)
 Clamps a vector of nt values into a vector of WlzUByte values. More...
 
void WlzValueClampShortIntoUByte (WlzUByte *dst, short *src, size_t count)
 Clamps a vector of short values into a vector of WlzUByte values. More...
 
void WlzValueClampFloatIntoInt (int *dst, float *src, size_t count)
 Clamps a vector of float values into a vector of int values. More...
 
void WlzValueClampFloatIntoShort (short *dst, float *src, size_t count)
 Clamps a vector of float values into a vector of short values. More...
 
void WlzValueClampFloatIntoUByte (WlzUByte *dst, float *src, size_t count)
 Clamps a vector of float values into a vector of WlzUByte values. More...
 
void WlzValueClampDoubleIntoInt (int *dst, double *src, size_t count)
 Clamps a vector of into double values into a vector of int values. More...
 
void WlzValueClampDoubleIntoShort (short *dst, double *src, size_t count)
 Clamps a vector of double values into a vector of short values. More...
 
void WlzValueClampDoubleIntoUByte (WlzUByte *dst, double *src, size_t count)
 Clamps a vector of double values into a vector of WlzUByte values. More...
 
void WlzValueClampDoubleIntoFloat (float *dst, double *src, size_t count)
 Clamps a vector of double values into a vector of float values. More...
 
void WlzValueClampIntIntoRGBA (WlzUInt *dst, int *src, size_t count)
 Clamps a vector of int values into a vector of RGBA values. More...
 
void WlzValueClampShortIntoRGBA (WlzUInt *dst, short *src, size_t count)
 Clamps a vector of short values into a vector of RGBA values. More...
 
void WlzValueClampFloatIntoRGBA (WlzUInt *dst, float *src, size_t count)
 Clamps a vector of float values into a vector of RGBA values. More...
 
void WlzValueClampDoubleIntoRGBA (WlzUInt *dst, double *src, size_t count)
 Clamps a vector of double values into a vector of RGBA values. More...
 
void WlzValueClampGreyIntoGrey (WlzGreyP dst, size_t dstOff, WlzGreyType dstType, WlzGreyP src, size_t srcOff, WlzGreyType srcType, size_t count)
 Clamps a source vector into a destination vector, where the source and destination types are any combination of int, short, WlzUByte, float or double. More...
 
void WlzValueCopyIntToInt (int *dst, int *src, size_t count)
 Copies a vector of int to a vector of int. More...
 
void WlzValueCopyIntToShort (short *dst, int *src, size_t count)
 Copies a vector of int to a vector of short. More...
 
void WlzValueCopyIntToUByte (WlzUByte *dst, int *src, size_t count)
 Copies a vector of int to a vector of WlzUByte. More...
 
void WlzValueCopyIntToFloat (float *dst, int *src, size_t count)
 Copies a vector of int to a vector of float. More...
 
void WlzValueCopyIntToDouble (double *dst, int *src, size_t count)
 Copies a vector of int to a vector of double. More...
 
void WlzValueCopyIntToRGBA (WlzUInt *dst, int *src, size_t count)
 Copies a vector of int to a vector of RGBA. More...
 
void WlzValueCopyShortToInt (int *dst, short *src, size_t count)
 Copies a vector of short to a vector of int. More...
 
void WlzValueCopyShortToShort (short *dst, short *src, size_t count)
 Copies a vector of short to a vector of short. More...
 
void WlzValueCopyShortToUByte (WlzUByte *dst, short *src, size_t count)
 Copies a vector of short to a vector of WlzUByte. More...
 
void WlzValueCopyShortToFloat (float *dst, short *src, size_t count)
 Copies a vector of short to a vector of float. More...
 
void WlzValueCopyShortToDouble (double *dst, short *src, size_t count)
 Copies a vector of short to a vector of double. More...
 
void WlzValueCopyUByteToInt (int *dst, WlzUByte *src, size_t count)
 Copies a vector of WlzUByte to a vector of int. More...
 
void WlzValueCopyShortToRGBA (WlzUInt *dst, short *src, size_t count)
 Copies a vector of short to a vector of RGBA. More...
 
void WlzValueCopyUByteToShort (short *dst, WlzUByte *src, size_t count)
 Copies a vector of WlzUByte to a vector of short. More...
 
void WlzValueCopyUByteToUByte (WlzUByte *dst, WlzUByte *src, size_t count)
 Copies a vector of WlzUByte to a vector of WlzUByte. More...
 
void WlzValueCopyUByteToFloat (float *dst, WlzUByte *src, size_t count)
 Copies a vector of WlzUByte to a vector of float. More...
 
void WlzValueCopyUByteToDouble (double *dst, WlzUByte *src, size_t count)
 Copies a vector of WlzUByte to a vector of double. More...
 
void WlzValueCopyUByteToRGBA (WlzUInt *dst, WlzUByte *src, size_t count)
 Copies a vector of WlzUByte to a vector of RGBA. More...
 
void WlzValueCopyFloatToInt (int *dst, float *src, size_t count)
 Copies a vector of float to a vector of int. More...
 
void WlzValueCopyFloatToShort (short *dst, float *src, size_t count)
 Copies a vector of float to a vector of short. More...
 
void WlzValueCopyFloatToUByte (WlzUByte *dst, float *src, size_t count)
 Copies a vector of float to a vector of WlzUByte. More...
 
void WlzValueCopyFloatToFloat (float *dst, float *src, size_t count)
 Copies a vector of float to a vector of float. More...
 
void WlzValueCopyFloatToDouble (double *dst, float *src, size_t count)
 Copies a vector of float to a vector of double. More...
 
void WlzValueCopyFloatToRGBA (WlzUInt *dst, float *src, size_t count)
 Copies a vector of float to a vector of RGBA. More...
 
void WlzValueCopyDoubleToInt (int *dst, double *src, size_t count)
 Copies a vector of double to a vector of int. More...
 
void WlzValueCopyDoubleToShort (short *dst, double *src, size_t count)
 Copies a vector of double to a vector of short. More...
 
void WlzValueCopyDoubleToUByte (WlzUByte *dst, double *src, size_t count)
 Copies a vector of double to a vector of WlzUByte. More...
 
void WlzValueCopyDoubleToFloat (float *dst, double *src, size_t count)
 Copies a vector of double to a vector of float. More...
 
void WlzValueCopyDoubleToDouble (double *dst, double *src, size_t count)
 Copies a vector of double to a vector of double. More...
 
void WlzValueCopyDoubleToRGBA (WlzUInt *dst, double *src, size_t count)
 Copies a vector of double to a vector of RGBA. More...
 
void WlzValueCopyRGBAToInt (int *dst, WlzUInt *src, size_t count)
 Copies a vector of RGBA to a vector of int - uses modulus. More...
 
void WlzValueCopyRGBAToShort (short *dst, WlzUInt *src, size_t count)
 Copies a vector of RGBA to a vector of short - uses modulus. More...
 
void WlzValueCopyRGBAToUByte (WlzUByte *dst, WlzUInt *src, size_t count)
 Copies a vector of RGBA to a vector of WlzUByte - uses modulus. More...
 
void WlzValueCopyRGBAToFloat (float *dst, WlzUInt *src, size_t count)
 Copies a vector of RGBA to a vector of float - uses modulus. More...
 
void WlzValueCopyRGBAToDouble (double *dst, WlzUInt *src, size_t count)
 Copies a vector of RGBA to a vector of double - uses modulus. More...
 
void WlzValueCopyRGBAToRGBA (WlzUInt *dst, WlzUInt *src, size_t count)
 Copies a vector of RGBA to a vector of RGBA. More...
 
void WlzValueCopyGreyToGrey (WlzGreyP dst, size_t dstOff, WlzGreyType dstType, WlzGreyP src, size_t srcOff, WlzGreyType srcType, size_t count)
 Copies a source vector to a destination vector, where the source and destination types are any combination of int, short, WlzUByte, float or double. More...
 
void WlzValueCopyDVertexToDVertex (WlzDVertex2 *dst, WlzDVertex2 *src, size_t count)
 Copies a vector of 2D double vertices to a vector of 2D double vertices. More...
 
void WlzValueCopyDVertexToFVertex (WlzFVertex2 *dst, WlzDVertex2 *src, size_t count)
 Copies a vector of 2D double vertices to a vector of 2D float vertices. More...
 
void WlzValueCopyDVertexToIVertex (WlzIVertex2 *dst, WlzDVertex2 *src, size_t count)
 Copies a vector of 2D double vertices to a vector of 2D int vertices. More...
 
void WlzValueCopyFVertexToDVertex (WlzDVertex2 *dst, WlzFVertex2 *src, size_t count)
 Copies a vector of 2D float vertices to a vector of 2D double vertices. More...
 
void WlzValueCopyFVertexToFVertex (WlzFVertex2 *dst, WlzFVertex2 *src, size_t count)
 Copies a vector of 2D float vertices to a vector of 2D float vertices. More...
 
void WlzValueCopyFVertexToIVertex (WlzIVertex2 *dst, WlzFVertex2 *src, size_t count)
 Copies a vector of 2D float vertices to a vector of 2D int vertices. More...
 
void WlzValueCopyIVertexToDVertex (WlzDVertex2 *dst, WlzIVertex2 *src, size_t count)
 Copies a vector of 2D int vertices to a vector of 2D double vertices. More...
 
void WlzValueCopyIVertexToFVertex (WlzFVertex2 *dst, WlzIVertex2 *src, size_t count)
 Copies a vector of 2D int vertices to a vector of 2D float vertices. More...
 
void WlzValueCopyIVertexToIVertex (WlzIVertex2 *dst, WlzIVertex2 *src, size_t count)
 Copies a vector of 2D int vertices to a vector of 2D int vertices. More...
 
void WlzValueCopyDVertexToDVertex3 (WlzDVertex3 *dst, WlzDVertex3 *src, size_t count)
 Copies a vector of 3D double vertices to a vector of 3D double vertices. More...
 
void WlzValueCopyDVertexToFVertex3 (WlzFVertex3 *dst, WlzDVertex3 *src, size_t count)
 Copies a vector of 3D double vertices to a vector of 3D float vertices. More...
 
void WlzValueCopyDVertexToIVertex3 (WlzIVertex3 *dst, WlzDVertex3 *src, size_t count)
 Copies a vector of 3D double vertices to a vector of 3D int vertices. More...
 
void WlzValueCopyFVertexToDVertex3 (WlzDVertex3 *dst, WlzFVertex3 *src, size_t count)
 Copies a vector of 3D float vertices to a vector of 3D double vertices. More...
 
void WlzValueCopyFVertexToFVertex3 (WlzFVertex3 *dst, WlzFVertex3 *src, size_t count)
 Copies a vector of 3D float vertices to a vector of 3D float vertices. More...
 
void WlzValueCopyFVertexToIVertex3 (WlzIVertex3 *dst, WlzFVertex3 *src, size_t count)
 Copies a vector of 3D float vertices to a vector of 3D int vertices. More...
 
void WlzValueCopyIVertexToDVertex3 (WlzDVertex3 *dst, WlzIVertex3 *src, size_t count)
 Copies a vector of 3D int vertices to a vector of 3D double vertices. More...
 
void WlzValueCopyIVertexToFVertex3 (WlzFVertex3 *dst, WlzIVertex3 *src, size_t count)
 Copies a vector of 3D int vertices to a vector of 3D float vertices. More...
 
void WlzValueCopyIVertexToIVertex3 (WlzIVertex3 *dst, WlzIVertex3 *src, size_t count)
 Copies a vector of 3D int vertices to a vector of 3D int vertices. More...
 
WlzErrorNum WlzValueConvertPixel (WlzPixelV *dstPix, WlzPixelV srcPix, WlzGreyType dstType)
 Converts a single pixel value. Source values are clamped to the the destination value range. More...
 
int WlzValueMedianInt (int *values, size_t nVal)
 Computes the median of the given vector (the vector's values are overwritten), where the vector type is of int values. The algorithm is based on min-max elimination as used by Peath A W. Median finding on a 3x3 Grid. Graphics Gems, 171-175. Academic Press. 1990. If the vector has less than 1 element 0 is returned. In the trivial case of 1 or 2 elements, the first element's value is returned. If the vector has more than 3 elements: More...
 
double WlzValueMedianDouble (double *values, size_t nVal)
 Computes the median of the given vector (the vector's values are overwritten), where the vector type is of double values. The algorithm is based on min-max elimination as used by Peath A W. Median finding on a 3x3 Grid. Graphics Gems, 171-175. Academic Press. 1990. If the vector has less than 1 element 0 is returned. In the trivial case of 1 or 2 elements, the first element's value is returned. If the vector has more than 3 elements: More...
 
int WlzValueDitherI (int p0, int p1, int p2)
 Given three consecutive values, possibly in an integer look up table, this function returns a value dithered to lie between the means of the first and last pairs of values with equal probability. Because this function calls AlgRandUniform() is may be slow. More...
 
void WlzIndexedValueBufWeight (WlzGreyP gP, int gO, WlzIndexedValues *ixv, double *wgt, int nIdx, int *idx, int ixi)
 Given an indexed values, weights and an array of indices into the indexed values; weights and sums the indexed values setting the grey value to the sum of the weighted values. The type of the grey pointer must be the same as the type of the indexed values. More...
 
size_t WlzIndexedValueSize (WlzIndexedValues *ixv, size_t *dstNDat, WlzErrorNum *dstErr)
 Computes the size of the data at each location of the indxed values. More...
 
size_t WlzValueSqueeze (size_t n, void *val, size_t sz, WlzUByte *keep, WlzErrorNum *dstErr)
 Squeezes out values from an array by replacing those that are to be removed so that the values remain contiguous. More...
 
WlzErrorNum WlzGreyValueFromGreyP (WlzGreyV *gV, WlzGreyP gP, size_t n, WlzGreyType gType)
 Sets Woolz grey values using the given Woolz grey pointer as the source of contiguous values. More...
 

Detailed Description

Many small functions for setting, copying and converting values.

Author
Bill Hill
Date
March 1999
Version
Id
bfa8fb0815dd47cf5aa602b5406f29b63210f0b7
Address: MRC Human Genetics Unit, MRC Institute of Genetics and Molecular Medicine, University of Edinburgh, Western General Hospital, Edinburgh, EH4 2XU, UK.
Copyright (C), [2012], The University Court of the University of Edinburgh, Old College, Edinburgh, UK.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Function Documentation

◆ WlzValueClampGreyIntoGrey()

void WlzValueClampGreyIntoGrey ( WlzGreyP  dst,
size_t  dstOff,
WlzGreyType  dstType,
WlzGreyP  src,
size_t  srcOff,
WlzGreyType  srcType,
size_t  count 
)

Clamps a source vector into a destination vector, where the source and destination types are any combination of int, short, WlzUByte, float or double.

Returns
void
Parameters
dstDestination vector.
dstOffDestination offset.
dstTypeDestination type, eg: WLZ_GREY_INT.
srcSource vector.
srcOffSource offset.
srcTypeSource type, eg: WLZ_GREY_SHORT.
countNumber of vector elements to be clamped and copied.

References _WlzGreyP::dbp, _WlzGreyP::flp, _WlzGreyP::inp, _WlzGreyP::rgbp, _WlzGreyP::shp, _WlzGreyP::ubp, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WlzValueClampDoubleIntoFloat(), WlzValueClampDoubleIntoInt(), WlzValueClampDoubleIntoRGBA(), WlzValueClampDoubleIntoShort(), WlzValueClampDoubleIntoUByte(), WlzValueClampFloatIntoInt(), WlzValueClampFloatIntoRGBA(), WlzValueClampFloatIntoShort(), WlzValueClampFloatIntoUByte(), WlzValueClampIntIntoRGBA(), WlzValueClampIntIntoShort(), WlzValueClampIntIntoUByte(), WlzValueClampShortIntoRGBA(), WlzValueClampShortIntoUByte(), WlzValueCopyDoubleToDouble(), WlzValueCopyFloatToDouble(), WlzValueCopyFloatToFloat(), WlzValueCopyIntToDouble(), WlzValueCopyIntToFloat(), WlzValueCopyIntToInt(), WlzValueCopyRGBAToDouble(), WlzValueCopyRGBAToFloat(), WlzValueCopyRGBAToInt(), WlzValueCopyRGBAToRGBA(), WlzValueCopyRGBAToShort(), WlzValueCopyRGBAToUByte(), WlzValueCopyShortToDouble(), WlzValueCopyShortToFloat(), WlzValueCopyShortToInt(), WlzValueCopyShortToShort(), WlzValueCopyUByteToDouble(), WlzValueCopyUByteToFloat(), WlzValueCopyUByteToInt(), WlzValueCopyUByteToRGBA(), WlzValueCopyUByteToShort(), and WlzValueCopyUByteToUByte().

◆ WlzValueCopyIntToInt()

void WlzValueCopyIntToInt ( int *  dst,
int *  src,
size_t  count 
)

Copies a vector of int to a vector of int.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

Referenced by WlzValueClampGreyIntoGrey(), and WlzValueCopyGreyToGrey().

◆ WlzValueCopyIntToShort()

void WlzValueCopyIntToShort ( short *  dst,
int *  src,
size_t  count 
)

Copies a vector of int to a vector of short.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References WLZ_CLAMP.

Referenced by WlzValueCopyGreyToGrey().

◆ WlzValueCopyIntToUByte()

void WlzValueCopyIntToUByte ( WlzUByte dst,
int *  src,
size_t  count 
)

Copies a vector of int to a vector of WlzUByte.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References WLZ_CLAMP.

Referenced by WlzValueCopyGreyToGrey().

◆ WlzValueCopyIntToFloat()

void WlzValueCopyIntToFloat ( float *  dst,
int *  src,
size_t  count 
)

Copies a vector of int to a vector of float.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

Referenced by WlzValueClampGreyIntoGrey(), and WlzValueCopyGreyToGrey().

◆ WlzValueCopyIntToDouble()

void WlzValueCopyIntToDouble ( double *  dst,
int *  src,
size_t  count 
)

Copies a vector of int to a vector of double.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

Referenced by WlzValueClampGreyIntoGrey(), and WlzValueCopyGreyToGrey().

◆ WlzValueCopyIntToRGBA()

void WlzValueCopyIntToRGBA ( WlzUInt dst,
int *  src,
size_t  count 
)

Copies a vector of int to a vector of RGBA.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References WlzValueClampIntIntoRGBA().

Referenced by WlzValueCopyGreyToGrey().

◆ WlzValueCopyShortToInt()

void WlzValueCopyShortToInt ( int *  dst,
short *  src,
size_t  count 
)

Copies a vector of short to a vector of int.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

Referenced by WlzValueClampGreyIntoGrey(), and WlzValueCopyGreyToGrey().

◆ WlzValueCopyShortToShort()

void WlzValueCopyShortToShort ( short *  dst,
short *  src,
size_t  count 
)

Copies a vector of short to a vector of short.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

Referenced by WlzValueClampGreyIntoGrey(), and WlzValueCopyGreyToGrey().

◆ WlzValueCopyShortToUByte()

void WlzValueCopyShortToUByte ( WlzUByte dst,
short *  src,
size_t  count 
)

Copies a vector of short to a vector of WlzUByte.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References WLZ_CLAMP.

Referenced by WlzValueCopyGreyToGrey().

◆ WlzValueCopyShortToFloat()

void WlzValueCopyShortToFloat ( float *  dst,
short *  src,
size_t  count 
)

Copies a vector of short to a vector of float.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

Referenced by WlzValueClampGreyIntoGrey(), and WlzValueCopyGreyToGrey().

◆ WlzValueCopyShortToDouble()

void WlzValueCopyShortToDouble ( double *  dst,
short *  src,
size_t  count 
)

Copies a vector of short to a vector of double.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

Referenced by WlzValueClampGreyIntoGrey(), and WlzValueCopyGreyToGrey().

◆ WlzValueCopyUByteToInt()

void WlzValueCopyUByteToInt ( int *  dst,
WlzUByte src,
size_t  count 
)

Copies a vector of WlzUByte to a vector of int.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

Referenced by WlzValueClampGreyIntoGrey(), and WlzValueCopyGreyToGrey().

◆ WlzValueCopyShortToRGBA()

void WlzValueCopyShortToRGBA ( WlzUInt dst,
short *  src,
size_t  count 
)

Copies a vector of short to a vector of RGBA.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References WlzValueClampShortIntoRGBA().

Referenced by WlzValueCopyGreyToGrey().

◆ WlzValueCopyUByteToShort()

void WlzValueCopyUByteToShort ( short *  dst,
WlzUByte src,
size_t  count 
)

Copies a vector of WlzUByte to a vector of short.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

Referenced by WlzValueClampGreyIntoGrey(), and WlzValueCopyGreyToGrey().

◆ WlzValueCopyUByteToUByte()

void WlzValueCopyUByteToUByte ( WlzUByte dst,
WlzUByte src,
size_t  count 
)

Copies a vector of WlzUByte to a vector of WlzUByte.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

Referenced by WlzValueClampGreyIntoGrey(), and WlzValueCopyGreyToGrey().

◆ WlzValueCopyUByteToFloat()

void WlzValueCopyUByteToFloat ( float *  dst,
WlzUByte src,
size_t  count 
)

Copies a vector of WlzUByte to a vector of float.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

Referenced by WlzValueClampGreyIntoGrey(), and WlzValueCopyGreyToGrey().

◆ WlzValueCopyUByteToDouble()

void WlzValueCopyUByteToDouble ( double *  dst,
WlzUByte src,
size_t  count 
)

Copies a vector of WlzUByte to a vector of double.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

Referenced by WlzValueClampGreyIntoGrey(), and WlzValueCopyGreyToGrey().

◆ WlzValueCopyUByteToRGBA()

void WlzValueCopyUByteToRGBA ( WlzUInt dst,
WlzUByte src,
size_t  count 
)

Copies a vector of WlzUByte to a vector of RGBA.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References WLZ_RGBA_RGBA_SET.

Referenced by WlzValueClampGreyIntoGrey(), and WlzValueCopyGreyToGrey().

◆ WlzValueCopyFloatToInt()

void WlzValueCopyFloatToInt ( int *  dst,
float *  src,
size_t  count 
)

Copies a vector of float to a vector of int.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References WLZ_CLAMP, and WLZ_NINT.

Referenced by WlzValueCopyGreyToGrey().

◆ WlzValueCopyFloatToShort()

void WlzValueCopyFloatToShort ( short *  dst,
float *  src,
size_t  count 
)

Copies a vector of float to a vector of short.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References WLZ_CLAMP, and WLZ_NINT.

Referenced by WlzValueCopyGreyToGrey().

◆ WlzValueCopyFloatToUByte()

void WlzValueCopyFloatToUByte ( WlzUByte dst,
float *  src,
size_t  count 
)

Copies a vector of float to a vector of WlzUByte.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References WLZ_CLAMP, and WLZ_NINT.

Referenced by WlzValueCopyGreyToGrey().

◆ WlzValueCopyFloatToFloat()

void WlzValueCopyFloatToFloat ( float *  dst,
float *  src,
size_t  count 
)

Copies a vector of float to a vector of float.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

Referenced by WlzValueClampGreyIntoGrey(), and WlzValueCopyGreyToGrey().

◆ WlzValueCopyFloatToDouble()

void WlzValueCopyFloatToDouble ( double *  dst,
float *  src,
size_t  count 
)

Copies a vector of float to a vector of double.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

Referenced by WlzValueClampGreyIntoGrey(), and WlzValueCopyGreyToGrey().

◆ WlzValueCopyFloatToRGBA()

void WlzValueCopyFloatToRGBA ( WlzUInt dst,
float *  src,
size_t  count 
)

Copies a vector of float to a vector of RGBA.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References WlzValueClampFloatIntoRGBA().

Referenced by WlzValueCopyGreyToGrey().

◆ WlzValueCopyDoubleToInt()

void WlzValueCopyDoubleToInt ( int *  dst,
double *  src,
size_t  count 
)

Copies a vector of double to a vector of int.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References WLZ_CLAMP, and WLZ_NINT.

Referenced by WlzValueCopyGreyToGrey().

◆ WlzValueCopyDoubleToShort()

void WlzValueCopyDoubleToShort ( short *  dst,
double *  src,
size_t  count 
)

Copies a vector of double to a vector of short.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References WLZ_CLAMP, and WLZ_NINT.

Referenced by WlzValueCopyGreyToGrey().

◆ WlzValueCopyDoubleToUByte()

void WlzValueCopyDoubleToUByte ( WlzUByte dst,
double *  src,
size_t  count 
)

Copies a vector of double to a vector of WlzUByte.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References WLZ_CLAMP, and WLZ_NINT.

Referenced by WlzValueCopyGreyToGrey().

◆ WlzValueCopyDoubleToFloat()

void WlzValueCopyDoubleToFloat ( float *  dst,
double *  src,
size_t  count 
)

Copies a vector of double to a vector of float.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References WLZ_CLAMP.

Referenced by WlzValueCopyGreyToGrey().

◆ WlzValueCopyDoubleToDouble()

void WlzValueCopyDoubleToDouble ( double *  dst,
double *  src,
size_t  count 
)

Copies a vector of double to a vector of double.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

Referenced by WlzBSplineCopy(), WlzBSplineEval(), WlzBSplineFromVertices(), WlzValueClampGreyIntoGrey(), and WlzValueCopyGreyToGrey().

◆ WlzValueCopyDoubleToRGBA()

void WlzValueCopyDoubleToRGBA ( WlzUInt dst,
double *  src,
size_t  count 
)

Copies a vector of double to a vector of RGBA.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References WlzValueClampDoubleIntoRGBA().

Referenced by WlzValueCopyGreyToGrey().

◆ WlzValueCopyRGBAToInt()

void WlzValueCopyRGBAToInt ( int *  dst,
WlzUInt src,
size_t  count 
)

Copies a vector of RGBA to a vector of int - uses modulus.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References WLZ_RGBA_MODULUS.

Referenced by WlzValueClampGreyIntoGrey(), and WlzValueCopyGreyToGrey().

◆ WlzValueCopyRGBAToShort()

void WlzValueCopyRGBAToShort ( short *  dst,
WlzUInt src,
size_t  count 
)

Copies a vector of RGBA to a vector of short - uses modulus.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References WLZ_RGBA_MODULUS.

Referenced by WlzValueClampGreyIntoGrey(), and WlzValueCopyGreyToGrey().

◆ WlzValueCopyRGBAToUByte()

void WlzValueCopyRGBAToUByte ( WlzUByte dst,
WlzUInt src,
size_t  count 
)

Copies a vector of RGBA to a vector of WlzUByte - uses modulus.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References WLZ_CLAMP, and WLZ_RGBA_MODULUS.

Referenced by WlzValueClampGreyIntoGrey(), and WlzValueCopyGreyToGrey().

◆ WlzValueCopyRGBAToFloat()

void WlzValueCopyRGBAToFloat ( float *  dst,
WlzUInt src,
size_t  count 
)

Copies a vector of RGBA to a vector of float - uses modulus.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References WLZ_RGBA_MODULUS.

Referenced by WlzValueClampGreyIntoGrey(), and WlzValueCopyGreyToGrey().

◆ WlzValueCopyRGBAToDouble()

void WlzValueCopyRGBAToDouble ( double *  dst,
WlzUInt src,
size_t  count 
)

Copies a vector of RGBA to a vector of double - uses modulus.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References WLZ_RGBA_MODULUS.

Referenced by WlzValueClampGreyIntoGrey(), and WlzValueCopyGreyToGrey().

◆ WlzValueCopyRGBAToRGBA()

void WlzValueCopyRGBAToRGBA ( WlzUInt dst,
WlzUInt src,
size_t  count 
)

Copies a vector of RGBA to a vector of RGBA.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

Referenced by WlzValueClampGreyIntoGrey(), and WlzValueCopyGreyToGrey().

◆ WlzValueCopyGreyToGrey()

void WlzValueCopyGreyToGrey ( WlzGreyP  dst,
size_t  dstOff,
WlzGreyType  dstType,
WlzGreyP  src,
size_t  srcOff,
WlzGreyType  srcType,
size_t  count 
)

Copies a source vector to a destination vector, where the source and destination types are any combination of int, short, WlzUByte, float or double.

Returns
void
Parameters
dstDestination vector.
dstOffDestination offset.
dstTypeDestination type, eg WLZ_GREY_INT.
srcSource vector.
srcOffSource offset.
srcTypeSource type, eg WLZ_GREY_SHORT.
countNumber of vector elements to copy.

References _WlzGreyP::dbp, _WlzGreyP::flp, _WlzGreyP::inp, _WlzGreyP::rgbp, _WlzGreyP::shp, _WlzGreyP::ubp, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WlzValueCopyDoubleToDouble(), WlzValueCopyDoubleToFloat(), WlzValueCopyDoubleToInt(), WlzValueCopyDoubleToRGBA(), WlzValueCopyDoubleToShort(), WlzValueCopyDoubleToUByte(), WlzValueCopyFloatToDouble(), WlzValueCopyFloatToFloat(), WlzValueCopyFloatToInt(), WlzValueCopyFloatToRGBA(), WlzValueCopyFloatToShort(), WlzValueCopyFloatToUByte(), WlzValueCopyIntToDouble(), WlzValueCopyIntToFloat(), WlzValueCopyIntToInt(), WlzValueCopyIntToRGBA(), WlzValueCopyIntToShort(), WlzValueCopyIntToUByte(), WlzValueCopyRGBAToDouble(), WlzValueCopyRGBAToFloat(), WlzValueCopyRGBAToInt(), WlzValueCopyRGBAToRGBA(), WlzValueCopyRGBAToShort(), WlzValueCopyRGBAToUByte(), WlzValueCopyShortToDouble(), WlzValueCopyShortToFloat(), WlzValueCopyShortToInt(), WlzValueCopyShortToRGBA(), WlzValueCopyShortToShort(), WlzValueCopyShortToUByte(), WlzValueCopyUByteToDouble(), WlzValueCopyUByteToFloat(), WlzValueCopyUByteToInt(), WlzValueCopyUByteToRGBA(), WlzValueCopyUByteToShort(), and WlzValueCopyUByteToUByte().

Referenced by WlzContourGrdObj2D(), WlzCopyDomain(), WlzTiledValuesCopyLine(), and WlzToArray1D().

◆ WlzValueCopyDVertexToDVertex()

void WlzValueCopyDVertexToDVertex ( WlzDVertex2 dst,
WlzDVertex2 src,
size_t  count 
)

Copies a vector of 2D double vertices to a vector of 2D double vertices.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

Referenced by WlzConvertPolyType(), and WlzMeshPolyDomAdd().

◆ WlzValueCopyDVertexToFVertex()

void WlzValueCopyDVertexToFVertex ( WlzFVertex2 dst,
WlzDVertex2 src,
size_t  count 
)

Copies a vector of 2D double vertices to a vector of 2D float vertices.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References _WlzFVertex2::vtX, and _WlzFVertex2::vtY.

Referenced by WlzConvertPolyType().

◆ WlzValueCopyDVertexToIVertex()

void WlzValueCopyDVertexToIVertex ( WlzIVertex2 dst,
WlzDVertex2 src,
size_t  count 
)

Copies a vector of 2D double vertices to a vector of 2D int vertices.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References _WlzIVertex2::vtX, _WlzIVertex2::vtY, and WLZ_NINT.

Referenced by WlzConvertPolyType(), WlzConvexHullCopy2(), and WlzPolyTo8Polygon().

◆ WlzValueCopyFVertexToDVertex()

void WlzValueCopyFVertexToDVertex ( WlzDVertex2 dst,
WlzFVertex2 src,
size_t  count 
)

Copies a vector of 2D float vertices to a vector of 2D double vertices.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References _WlzFVertex2::vtX, _WlzDVertex2::vtX, _WlzFVertex2::vtY, and _WlzDVertex2::vtY.

Referenced by WlzConvertPolyType(), WlzMeshPolyDomAdd(), and WlzSnapFit().

◆ WlzValueCopyFVertexToFVertex()

void WlzValueCopyFVertexToFVertex ( WlzFVertex2 dst,
WlzFVertex2 src,
size_t  count 
)

Copies a vector of 2D float vertices to a vector of 2D float vertices.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

Referenced by WlzConvertPolyType().

◆ WlzValueCopyFVertexToIVertex()

void WlzValueCopyFVertexToIVertex ( WlzIVertex2 dst,
WlzFVertex2 src,
size_t  count 
)

Copies a vector of 2D float vertices to a vector of 2D int vertices.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References _WlzIVertex2::vtX, _WlzIVertex2::vtY, and WLZ_NINT.

Referenced by WlzConvertPolyType(), and WlzPolyTo8Polygon().

◆ WlzValueCopyIVertexToDVertex()

void WlzValueCopyIVertexToDVertex ( WlzDVertex2 dst,
WlzIVertex2 src,
size_t  count 
)

Copies a vector of 2D int vertices to a vector of 2D double vertices.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References _WlzIVertex2::vtX, _WlzDVertex2::vtX, _WlzIVertex2::vtY, and _WlzDVertex2::vtY.

Referenced by WlzConvertPolyType(), WlzConvexHullCopy2(), WlzMeshPolyDomAdd(), and WlzSnapFit().

◆ WlzValueCopyIVertexToFVertex()

void WlzValueCopyIVertexToFVertex ( WlzFVertex2 dst,
WlzIVertex2 src,
size_t  count 
)

Copies a vector of 2D int vertices to a vector of 2D float vertices.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References _WlzFVertex2::vtX, and _WlzFVertex2::vtY.

Referenced by WlzConvertPolyType().

◆ WlzValueCopyIVertexToIVertex()

void WlzValueCopyIVertexToIVertex ( WlzIVertex2 dst,
WlzIVertex2 src,
size_t  count 
)

Copies a vector of 2D int vertices to a vector of 2D int vertices.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

Referenced by WlzConvertPolyType().

◆ WlzValueCopyDVertexToDVertex3()

void WlzValueCopyDVertexToDVertex3 ( WlzDVertex3 dst,
WlzDVertex3 src,
size_t  count 
)

Copies a vector of 3D double vertices to a vector of 3D double vertices.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

◆ WlzValueCopyDVertexToFVertex3()

void WlzValueCopyDVertexToFVertex3 ( WlzFVertex3 dst,
WlzDVertex3 src,
size_t  count 
)

Copies a vector of 3D double vertices to a vector of 3D float vertices.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References _WlzFVertex3::vtX, _WlzFVertex3::vtY, and _WlzFVertex3::vtZ.

◆ WlzValueCopyDVertexToIVertex3()

void WlzValueCopyDVertexToIVertex3 ( WlzIVertex3 dst,
WlzDVertex3 src,
size_t  count 
)

Copies a vector of 3D double vertices to a vector of 3D int vertices.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References _WlzIVertex3::vtX, _WlzIVertex3::vtY, _WlzIVertex3::vtZ, and WLZ_NINT.

Referenced by WlzConvexHullCopy3().

◆ WlzValueCopyFVertexToDVertex3()

void WlzValueCopyFVertexToDVertex3 ( WlzDVertex3 dst,
WlzFVertex3 src,
size_t  count 
)

Copies a vector of 3D float vertices to a vector of 3D double vertices.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References _WlzFVertex3::vtX, _WlzDVertex3::vtX, _WlzFVertex3::vtY, _WlzDVertex3::vtY, _WlzFVertex3::vtZ, and _WlzDVertex3::vtZ.

◆ WlzValueCopyFVertexToFVertex3()

void WlzValueCopyFVertexToFVertex3 ( WlzFVertex3 dst,
WlzFVertex3 src,
size_t  count 
)

Copies a vector of 3D float vertices to a vector of 3D float vertices.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

◆ WlzValueCopyFVertexToIVertex3()

void WlzValueCopyFVertexToIVertex3 ( WlzIVertex3 dst,
WlzFVertex3 src,
size_t  count 
)

Copies a vector of 3D float vertices to a vector of 3D int vertices.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References _WlzIVertex3::vtX, _WlzIVertex3::vtY, _WlzIVertex3::vtZ, and WLZ_NINT.

◆ WlzValueCopyIVertexToDVertex3()

void WlzValueCopyIVertexToDVertex3 ( WlzDVertex3 dst,
WlzIVertex3 src,
size_t  count 
)

Copies a vector of 3D int vertices to a vector of 3D double vertices.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References _WlzIVertex3::vtX, _WlzDVertex3::vtX, _WlzIVertex3::vtY, _WlzDVertex3::vtY, _WlzIVertex3::vtZ, and _WlzDVertex3::vtZ.

Referenced by WlzConvexHullCopy3(), and WlzSnapFit().

◆ WlzValueCopyIVertexToFVertex3()

void WlzValueCopyIVertexToFVertex3 ( WlzFVertex3 dst,
WlzIVertex3 src,
size_t  count 
)

Copies a vector of 3D int vertices to a vector of 3D float vertices.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

References _WlzFVertex3::vtX, _WlzFVertex3::vtY, and _WlzFVertex3::vtZ.

◆ WlzValueCopyIVertexToIVertex3()

void WlzValueCopyIVertexToIVertex3 ( WlzIVertex3 dst,
WlzIVertex3 src,
size_t  count 
)

Copies a vector of 3D int vertices to a vector of 3D int vertices.

Returns
void
Parameters
dstDestination vector.
srcSource vector.
countNumber of vector elements to copy.

◆ WlzValueConvertPixel()

◆ WlzValueMedianInt()

int WlzValueMedianInt ( int *  values,
size_t  nVal 
)

Computes the median of the given vector (the vector's values are overwritten), where the vector type is of int values. The algorithm is based on min-max elimination as used by Peath A W. Median finding on a 3x3 Grid. Graphics Gems, 171-175. Academic Press. 1990. If the vector has less than 1 element 0 is returned. In the trivial case of 1 or 2 elements, the first element's value is returned. If the vector has more than 3 elements:

Returns
Median value.
  • The given vector is partitioned into two portions: the 1st having ((n + 1) / 2) + 1 elements.
  • While all the elements have not been examined:
    • Find maximum and minimum values in the 1st
    • Replace the min value with the first in the partition and the max with the last in the partition.
    • Replace the first value in the first partition with the next value from the second partition.
    • Reduce the length of the first partion by 1, ie omit the last value.
  • This leaves 3 values in the 1st partion, their median is found by direct comparison.
Parameters
valuesVector of int values.
nValNumber of values in vector.

◆ WlzValueMedianDouble()

double WlzValueMedianDouble ( double *  values,
size_t  nVal 
)

Computes the median of the given vector (the vector's values are overwritten), where the vector type is of double values. The algorithm is based on min-max elimination as used by Peath A W. Median finding on a 3x3 Grid. Graphics Gems, 171-175. Academic Press. 1990. If the vector has less than 1 element 0 is returned. In the trivial case of 1 or 2 elements, the first element's value is returned. If the vector has more than 3 elements:

Returns
Median value.
  • The given vector is partitioned into two portions: the 1st having ((n + 1) / 2) + 1 elements.
  • While all the elements have not been examined:
    • Find maximum and minimum values in the 1st
    • Replace the min value with the first in the partition and the max with the last in the partition.
    • Replace the first value in the first partition with the next value from the second partition.
    • Reduce the length of the first partion by 1, ie omit the last value.
  • This leaves 3 values in the 1st partion, their median is found by direct comparison.
Parameters
valuesVector of double values.
nValNumber of values in vector.

◆ WlzValueDitherI()

int WlzValueDitherI ( int  p0,
int  p1,
int  p2 
)

Given three consecutive values, possibly in an integer look up table, this function returns a value dithered to lie between the means of the first and last pairs of values with equal probability. Because this function calls AlgRandUniform() is may be slow.

Returns
Dithered value.
Parameters
p0First integral value.
p1Second integral value.
p2Third integral value.

References AlgRandUniform(), and WLZ_NINT.

Referenced by WlzLUTTransformGreyValues().

◆ WlzIndexedValueBufWeight()

void WlzIndexedValueBufWeight ( WlzGreyP  gP,
int  gO,
WlzIndexedValues ixv,
double *  wgt,
int  nIdx,
int *  idx,
int  ixi 
)

Given an indexed values, weights and an array of indices into the indexed values; weights and sums the indexed values setting the grey value to the sum of the weighted values. The type of the grey pointer must be the same as the type of the indexed values.

Parameters
gPGrey pointer.
gOGrey pointer offset.
ixvIndexed values.
wgtWeights.
nIdxNumber of indices into the indexed values and the number of weights.
idxIndices into the indexed values.
ixiIndex into the indexed values.

References _WlzKrigModelFn::a, _WlzGreyP::dbp, _WlzGreyP::flp, _WlzGreyP::inp, _WlzGreyP::rgbp, _WlzGreyP::shp, _WlzGreyP::ubp, _WlzIndexedValues::vType, WLZ_CLAMP, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_RGBA, WLZ_GREY_SHORT, WLZ_GREY_UBYTE, WLZ_RGBA_ALPHA_GET, WLZ_RGBA_BLUE_GET, WLZ_RGBA_GREEN_GET, WLZ_RGBA_RED_GET, WLZ_RGBA_RGBA_SET, and WlzIndexedValueGet().

◆ WlzIndexedValueSize()

size_t WlzIndexedValueSize ( WlzIndexedValues ixv,
size_t *  dstNDat,
WlzErrorNum dstErr 
)

Computes the size of the data at each location of the indxed values.

Returns
Size of data at each location of the indxed values.
Parameters
ixvGiven indexed values structure.
dstNDatDestination pointer for the number of data at each location of the indxed values, may be NULL.
dstErrDestination error pointer, may be NULL.

References _WlzIndexedValues::dim, _WlzIndexedValues::rank, _WlzIndexedValues::type, _WlzIndexedValues::vType, WLZ_ERR_GREY_TYPE, WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, WLZ_ERR_VALUES_DATA, WLZ_ERR_VALUES_NULL, WLZ_ERR_VALUES_TYPE, WLZ_GREY_BIT, WLZ_INDEXED_VALUES, and WlzGreySize().

Referenced by WlzCMeshDispToField(), WlzCopyIndexedValues(), and WlzCopyObject().

◆ WlzValueSqueeze()

size_t WlzValueSqueeze ( size_t  n,
void *  val,
size_t  sz,
WlzUByte keep,
WlzErrorNum dstErr 
)

Squeezes out values from an array by replacing those that are to be removed so that the values remain contiguous.

Returns
Number of values remaining.
Parameters
nNumber of values in the array.
valArray of values.
szSize of an element in the array.
keepArray of byte values. Values are kept when the keep value (with the corresponding index) is non zero.
dstErrDestination error pointer, may be NULL.

References WLZ_ERR_NONE, WLZ_ERR_PARAM_DATA, and WLZ_ERR_PARAM_NULL.

◆ WlzGreyValueFromGreyP()

WlzErrorNum WlzGreyValueFromGreyP ( WlzGreyV gV,
WlzGreyP  gP,
size_t  n,
WlzGreyType  gType 
)

Sets Woolz grey values using the given Woolz grey pointer as the source of contiguous values.

Returns
Woolz error code.
Parameters
gVDestination pointer for grey value(s).
gPSource grep value pointer.
nNumber of values to be set.
gTypeGrey type.

References _WlzGreyP::dbp, _WlzGreyV::dbv, _WlzGreyP::flp, _WlzGreyV::flv, _WlzGreyP::inp, _WlzGreyV::inv, _WlzGreyP::lnp, _WlzGreyV::lnv, _WlzGreyP::rgbp, _WlzGreyV::rgbv, _WlzGreyP::shp, _WlzGreyV::shv, _WlzGreyP::ubp, _WlzGreyV::ubv, WLZ_ERR_GREY_TYPE, WLZ_ERR_NONE, WLZ_GREY_DOUBLE, WLZ_GREY_FLOAT, WLZ_GREY_INT, WLZ_GREY_LONG, WLZ_GREY_RGBA, WLZ_GREY_SHORT, and WLZ_GREY_UBYTE.