Content-type: text/html Man page of mlib_ImageDataTypeConvert

mlib_ImageDataTypeConvert

Section: mediaLib Library Functions (3MLIB)
Updated: 2 Mar 2007
Index Return to Main Contents
 

NAME

mlib_ImageDataTypeConvert - data type conversion  

SYNOPSIS

cc [ flag... ] file... -lmlib [ library... ]
#include <mlib.h>

mlib_status mlib_ImageDataTypeConvert(mlib_image *dst, const mlib_image *src);

 

DESCRIPTION

The mlib_ImageDataTypeConvert() function converts between data types MLIB_BIT, MLIB_BYTE, MLIB_SHORT, MLIB_USHORT, MLIB_INT, MLIB_FLOAT, and MLIB_DOUBLE.

The input and output data images must have the same width, height, and number of channels. Conversion to a smaller pixel format clamps the source value to the dynamic range of the destination pixel.

See the following table for available variations of the data type conversion function.

Source TypeDest. TypeAction

MLIB_BYTEMLIB_BIT(x > 0) ? 1 : 0
MLIB_SHORT

MLIB_USHORT

MLIB_INT

MLIB_FLOAT

MLIB_DOUBLE

MLIB_BIT

MLIB_SHORT

MLIB_USHORT

MLIB_INT

MLIB_FLOAT

MLIB_DOUBLE

MLIB_BIT

MLIB_BYTE

MLIB_USHORT

MLIB_INT

MLIB_FLOAT

MLIB_DOUBLE

MLIB_BIT

MLIB_BYTE

MLIB_SHORT

MLIB_INT

MLIB_FLOAT

MLIB_DOUBLE

MLIB_BIT

MLIB_BYTE

MLIB_SHORT

MLIB_USHORT

MLIB_FLOAT

MLIB_DOUBLE

MLIB_BIT

MLIB_BYTE

MLIB_SHORT

MLIB_USHORT

MLIB_INT

MLIB_DOUBLE

MLIB_BIT

MLIB_BYTE

MLIB_SHORT

MLIB_USHORT

MLIB_INT

MLIB_FLOAT

The actions are defined in C-style pseudo-code. All type casts follow the rules of standard C. clamp() can be defined as a macro: #define clamp(x, low, high) (((x) < (low)) ? (low) : (((x) > (high)) ? (high) : (x)))  

PARAMETERS

The function takes the following arguments:

dst

Pointer to destination image.

src

Pointer to source image.

 

RETURN VALUES

The function returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE.  

ATTRIBUTES

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE

Interface StabilityCommitted

MT-Level

 

SEE ALSO

mlib_ImageReformat(3MLIB), attributes(5)


 

Index

NAME
SYNOPSIS
DESCRIPTION
PARAMETERS
RETURN VALUES
ATTRIBUTES
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 02:38:03 GMT, October 02, 2010