Mercurial > repos > public > sbplib
annotate +anim/setup_img_mov.m @ 1347:ac54767ae1fb feature/poroelastic tip
Add interface, not fully compatible.
| author | Martin Almquist <martin.almquist@it.uu.se> |
|---|---|
| date | Tue, 30 Apr 2024 14:58:35 +0200 |
| parents | 48b6fb693025 |
| children |
| rev | line source |
|---|---|
| 0 | 1 function save_frame = setup_img_mov(dirname,filename_prefix,ulim,map,F) |
| 2 default_arg('map',parula(256)); | |
| 3 default_arg('F',@(x)x); | |
| 4 | |
| 5 fresh_dir(dirname); | |
| 6 | |
| 7 n = size(map,1); | |
| 8 | |
| 9 frame_nr = 0; | |
| 10 function save_frame_F(Z) | |
| 11 filename = sprintf('%s/%s%04d.png',dirname,filename_prefix, frame_nr); | |
| 12 z = uint8(F(Z)/ulim(2)*n); | |
| 13 imwrite(z,map,filename); | |
| 14 frame_nr = frame_nr + 1; | |
| 15 end | |
| 16 | |
| 17 save_frame = @save_frame_F; | |
| 18 end |
