Beispiel #1
0
int
pc_point_set_double(PCPOINT *pt, const PCDIMENSION *dim, double val)
{
	uint8_t *ptr;

	/* Remove scale and offsets */
	val = pc_value_unscale_unoffset(val, dim);

	/* Get pointer into byte buffer */
	ptr = pt->data + dim->byteoffset;

	return pc_double_to_ptr(ptr, dim->interpretation, val);
}
Beispiel #2
0
int 
pc_point_set_double(PCPOINT *pt, const PCDIMENSION *d, double val)
{
	uint8_t *ptr;

	/* Offset value */
	if ( d->offset )
		val -= d->offset;

	/* Scale value */
	if ( d->scale )
		val /= d->scale;

	/* Get pointer into byte buffer */
	ptr = pt->data + d->byteoffset;
	
	return pc_double_to_ptr(ptr, d->interpretation, val);
}