Lib:Architecture/Base Layer/Floating Point Arithmetic Module

From GNUpdf

Library Module
Floating-Point Arithmetic Module
Layer Base
API Documentation Reference Manual
Source Files src/base/pdf-fp.h

src/base/pdf-fp.c

Contents

Overview

This module provides system-independent floating point real numbers and several related facilities such as matrix and points manipulations, interpolation routines, real to string and string to real conversion and rounding.

Floating-Point Numbers

Points

This module should support the notion of two-dimensional cartesian points. Points are defined by a horizontal coordinate and a vertical coordinate. The coordinates are floating-point numbers.

Rectangles

A floating-point rectangle
Enlarge
A floating-point rectangle

This module should support the notion of rectangles characterized by a upper coordinate, a bottom coordinate, a left coordinate and a right coordinate. The sides defining the rectangle are thus vertical or horizontal and two opposite sides are always parallel.

Quadrilaterals

A floating-point quadrilateral
Enlarge
A floating-point quadrilateral

Quadrilaterals are like rectangles but the sides can be of a distinct length, vertical and horizontal orientation is not mandatory and opposite sides doesn't need to be parallel.

Matrices

A floating-point matrix
Enlarge
A floating-point matrix

This module supports matrices composed by three rows of three floating-point numbers. Several matrix-related operations should be supported and are described below.

Matrix concatenation

Matrix inversion

Point transform

Rectangle transform

Interpolation

N-dimensional Linear Interpolation

N-dimensional Cubic Spline Interpolation