Bsoft  1.9
Bernard's software package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
datatypes.h File Reference

Functions to check and convert datatypes. More...

#include "rwimg.h"

Go to the source code of this file.

Functions

DataType getdatatype (char letter)
 Get the data type indicated by a single letter code. More...
 
int set_value_with_datatype (char *ptr, double value, DataType datatype)
 Set a pointer to a value with a given data type. More...
 

Detailed Description

Functions to check and convert datatypes.

Author
Bernard Heymann
Date
Created: 19990321 Modified: 20110815

Definition in file datatypes.h.

Function Documentation

DataType getdatatype ( char  letter)

Get the data type indicated by a single letter code.

This function is used in optional command-line arguments to indicate a new data type for an image.

Parameters
letterletter indicating data type.
Returns
DataType type data type (defined in rwimg.h).

Definition at line 52 of file datatypes.cpp.

int set_value_with_datatype ( char *  ptr,
double  value,
DataType  datatype 
)

Set a pointer to a value with a given data type.

A value is inserted into a given location with the given data type. The size of the allocated memory is channels*typesize.

Parameters
*ptrpointer to location.
valuethe value.
datatypedata type (defined in rwimg.h).
Returns
int 0, <0 on error.

Definition at line 89 of file datatypes.cpp.