# interpol

## interpol image

### interpol coe(k1,k2,...)image(id1,id2,...)image(id0)

Computes image ni = k1 * id1 + k2 * id2 + ... with ni in (id0,id0+1,...).
Example:
`interpol(0.5,0.5)image(1,2)image(3);` computes image(3)=average of images 1 and 2.
Options:
dim(nx,ny): size of the images.
limit: evoides color overflow.
normal: Normalizes coefficients (k1 + k2 + ... = 1).
Notes:
1) Faster if images id1,id2,... have the same dimensions.
2) If images i3,i3+1,... doesnot exist, they are created.

### interpol(nb)image(id1,id2,...)image(id3)

Generates images id3,id3+1,...,id3+nb-1 interpolated through images id1,id2,... and returns the last generated image number.

### interpol(nb)image(id1)image(id2)bitmap

Changes image id2 as id1,id2 interpolating on nb images.
Note:
`rem bitmap[0,ni-1]image(id2);` is performed in order to fix continuity.

Writes images "Ck.eee" interpolated through images Ai.eee and Bj.eee with i in [i1,i1+nb[, j in [i2,i2+nb[ and k in [1,nb].
Options:
number("nD",i3): k in [i3,i3+nb[ ("4D",1) default.

### interpol(nb)image(i1,i2)write("A.eee")

Writes images "Ak.eee" interpolated through images i1 and i2 with k in [1,nb].
Options:
number("nD",i3): k in [i3,i3+nb[ ("4D",1) default.

## interpol line

### interpol line(L1)line(L2)dim(ni)NP(im)

Returns L = L1 + (L2 - L1) *im / (ni-1).
If im=0 L=L1;
If im=ni-1 L=L2;
Note: requires ni >= 2.

Generates the file volumes "nom3" interpolated according to coefficient c between files "nom1" and "nom2".
Notes:
1) nom3 = (1-c) * nom1 + c * nom2
2) By default c = 0.5
3) Useful for generating intermediate frames for example to improve antialiasing or dynamics calculations.
4) `interpol read("nom1") read("nom2") write("nom3") coe(c) format("Z");`
For compressed files.

### interpol poi(p1,p2,...,pn-1,pn) vol(id)

Interpolates the points p2,...,pn-1 of volume id between points p1 and pn of this volume.

## interpol secx vol

### interpol secx(n1,n2) vol(id)

Interpolates the x sections between n1 and n2 (all by default) of volume id.

## interpol secy vol

### interpol secy(n1,n2) vol(id)

Interpolates the y sections between n1 and n2 (all by default) of volume id.

## interpol texture

### interpol texture obj(id)=ni

Builds property interpol texture of object type obj id (obj can be vol or image):
cpt
ni: number of interpolated images
debug
bit1, inc_bit1, number1, nz1
bit2, inc_bit2, number2, nz2
law
fbit1, fbit2
speed
type1, type2
directory number
If obj=vol allows animated textures on grid from 3D images.
See a simple example in basic1_interpol_texture.func
If obj=image allows animated images.

### interpol texture bitmap obj(id)

Returns (bit1,bit2)

### interpol texture debug(d)obj(id)

sets interpol texture debug obj(id)=d.
if(d==1): debug mode, prints informations.

### interpol texture directory obj(id)

Returns directory
interpol texture directory(d)obj(id): changes directory in [1,texture NP[
Allows limit the images to those of this directory.

Returns law

Changes law.

### interpol texture number obj(id)

Returns number1,number2.

### interpol texture number(number1,number2)obj(id)

texture obj(id) is number1,number2 in turn.

### interpol texture number(number2)obj(id)

Changes only number2 preserving number1 allowing start a second texture layer (smoothly with option law).

### interpol texture secz obj(id)

Returns (nz1,nz2)

### interpol texture speed obj(id)

Returns speed of bitmaps.

### interpol texture speed (s)ol(id)

Changes this speed.

### interpol texture type obj(id)

Returns type
interpol texture type(s)obj(t) or
type interpol texture type obj(t) : changes type
type(-2): inchanged, changed by: interpol texture number(num)obj(id)
type(-1): period
type(0): random
else: type * speed
Options:
directory(d): relative to the layer d of directories in [1,texture directory NP].

## interpol vertex

### interpol vertex(v1,v2)vol(id)

Interpolates vertices [v1,v2] of volume id.

### interpol vertex(v1,v2,v3)vol(id)

does: poi(v3)vol(id)=(poi(v1)vol(id) + poi(v2)vol(id)) / 2.

## interpol vol

### interpol vol(id1)vol(id2)vol(id3)coe(c)

Generates volume id3 as centroid of volumes id1 and id2 with coefficients (c) and (1-c).
Notes:
1) c = 0.5 by default
2) Volumes id1 and id2 must have the same topology.