fractint color maps module 1st shoot

This commit is contained in:
tTh 2022-12-23 21:11:46 +01:00
parent 7a254d2c02
commit 3c94d61e24
7 changed files with 1041 additions and 2 deletions

5
Fraktalism/mods/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
t
*.pnm

View File

@ -2,12 +2,23 @@
# compiling fraktalism's modules
#
GFOPT = -Wall -Wextra -time -g
GFOPT = -Wall -Wextra -time -g -I../../Modules
all: xperiment.o points3d.o
all: xperiment.o points3d.o fractcolmap.o
points3d.o: points3d.f90 Makefile
gfortran $(GFOPT) -c $<
xperiment.o: xperiment.f90 Makefile
gfortran $(GFOPT) -c $<
fractcolmap.o: fractcolmap.f90 Makefile
gfortran $(GFOPT) -c $<
# TEST PROGGY --------------------
OBJS = fractcolmap.o xperiment.o points3d.o
t: t.f90 Makefile $(OBJS)
gfortran $(GFOPT) $< $(OBJS) ../../Modules/pixrgb.o -o $@

356
Fraktalism/mods/chroma.map Normal file
View File

@ -0,0 +1,356 @@
48 48 48 'chromatic' color map
56 48 56 by Todd Hedenstrom
64 48 64
72 48 72
80 48 80
88 48 88
96 48 96
104 48 104
112 48 112
120 48 120
128 48 128
136 48 136
144 48 144
152 48 152
160 48 160
168 48 168
176 48 176
184 48 184
192 48 192
200 48 200
208 48 208
216 48 216
224 48 224
216 48 224
208 48 224
200 48 224
192 48 224
184 48 224
176 48 224
168 48 224
160 48 224
152 48 224
144 48 224
136 48 224
128 48 224
120 48 224
112 48 224
104 48 224
96 48 224
88 48 224
80 48 224
72 48 224
64 48 224
56 48 224
48 48 224
48 56 224
48 64 224
48 72 224
48 80 224
48 88 224
48 96 224
48 104 224
48 112 224
48 120 224
48 128 224
48 136 224
48 144 224
48 152 224
48 160 224
48 168 224
48 176 224
48 184 224
48 192 224
48 200 224
48 208 224
48 216 224
48 224 224
48 224 216
48 224 208
48 224 200
48 224 192
48 224 184
48 224 176
48 224 168
48 224 160
48 224 152
48 224 144
48 224 136
48 224 128
48 224 120
48 224 112
48 224 104
48 224 96
48 224 88
48 224 80
48 224 72
48 224 64
48 224 56
48 224 48
56 224 56
64 224 64
72 224 72
80 224 80
88 224 88
96 224 96
104 224 104
112 224 112
120 224 120
128 224 128
136 224 136
144 224 144
152 224 152
160 224 160
168 224 168
176 224 176
184 224 184
192 224 192
200 224 200
208 224 208
216 224 216
224 224 224
224 224 216
224 224 208
224 224 200
224 224 192
224 224 184
224 224 176
224 224 168
224 224 160
224 224 152
224 224 144
224 224 136
224 224 128
224 224 120
224 224 112
224 224 104
224 224 96
224 224 88
224 224 80
224 224 72
224 224 64
224 224 56
224 224 48
224 216 48
224 208 48
224 200 48
224 192 48
224 184 48
224 176 48
224 168 48
224 160 48
224 152 48
224 144 48
224 136 48
224 128 48
224 120 48
224 112 48
224 104 48
224 96 48
224 88 48
224 80 48
224 72 48
224 64 48
224 56 48
224 48 48
216 48 48
208 48 48
200 48 48
192 48 48
184 48 48
176 48 48
168 48 48
160 48 48
152 48 48
144 48 48
136 48 48
128 48 48
120 48 48
112 48 48
104 48 48
96 48 48
88 48 48
80 48 48
72 48 48
64 48 48
56 48 48
48 48 48
40 48 48
48 48 48
56 48 56
64 48 64
72 48 72
80 48 80
88 48 88
96 48 96
104 48 104
112 48 112
120 48 120
128 48 128
136 48 136
144 48 144
152 48 152
160 48 160
168 48 168
176 48 176
184 48 184
192 48 192
200 48 200
208 48 208
216 48 216
224 48 224
216 48 224
208 48 224
200 48 224
192 48 224
184 48 224
176 48 224
168 48 224
160 48 224
152 48 224
144 48 224
136 48 224
128 48 224
120 48 224
112 48 224
104 48 224
96 48 224
88 48 224
80 48 224
72 48 224
64 48 224
56 48 224
48 48 224
48 56 224
48 64 224
48 72 224
48 80 224
48 88 224
48 96 224
48 104 224
48 112 224
48 120 224
48 128 224
48 136 224
48 144 224
48 152 224
48 160 224
48 168 224
48 176 224
48 184 224
48 192 224
48 200 224
48 208 224
48 216 224
48 224 224
48 224 216
48 224 208
48 224 200
48 224 192
48 224 184
48 224 176
48 224 168
48 224 160
48 224 152
48 224 144
48 224 136
48 224 128
48 224 120
48 224 112
48 224 104
48 224 96
48 224 88
48 224 80
48 224 72
48 224 64
48 224 56
48 224 48
56 224 56
64 224 64
72 224 72
80 224 80
88 224 88
96 224 96
104 224 104
112 224 112
120 224 120
128 224 128
136 224 136
144 224 144
152 224 152
160 224 160
168 224 168
176 224 176
184 224 184
192 224 192
200 224 200
208 224 208
216 224 216
224 224 224
224 224 216
224 224 208
224 224 200
224 224 192
224 224 184
224 224 176
224 224 168
224 224 160
224 224 152
224 224 144
224 224 136
224 224 128
224 224 120
224 224 112
224 224 104
224 224 96
224 224 88
224 224 80
224 224 72
224 224 64
224 224 56
224 224 48
224 216 48
224 208 48
224 200 48
224 192 48
224 184 48
224 176 48
224 168 48
224 160 48
224 152 48
224 144 48
224 136 48
224 128 48
224 120 48
224 112 48
224 104 48
224 96 48
224 88 48
224 80 48
224 72 48
224 64 48
224 56 48
224 48 48
216 48 48
208 48 48
200 48 48
192 48 48
184 48 48
176 48 48
168 48 48
160 48 48
152 48 48
144 48 48
136 48 48
128 48 48
120 48 48
112 48 48
104 48 48
96 48 48
88 48 48
80 48 48
72 48 48
64 48 48
56 48 48
48 48 48
40 48 48

View File

@ -0,0 +1,118 @@
module fractcolmap
use pixrgb ! from Modules dir
implicit none
integer :: currmap(0:255, 3)
logical :: initialized = .FALSE.
contains
!-----------------------------------------------------
subroutine fcolm_infos(msg)
character(*), intent(in) :: msg
write(0, *) ' -> fractcolmap infos because [', msg, ']'
write(0, *) ' initialized is ', initialized
end subroutine
!-----------------------------------------------------
subroutine fcolm_load_mapfile(fname)
character(*), intent(in) :: fname
integer :: io, errcode, idx
integer :: ir, ig, ib
write(0, *) ' -> fractcolmap load file [', fname, ']'
! trying to get access to the datas
open(newunit=io, file=fname, iostat=errcode, action='read')
if (errcode .NE. 0) then
write(0, *) ' errcode :', errcode
write(0, *) ' FILE ', fname, ' NOT FOUND'
STOP 'BECAUSE FULL NUCKED, SORRY'
endif
! loop over all the data
do idx=0, 255
read(io, *) ir, ig, ib
! write(*, '("idx ", I5, " got rgb", 3I6)') idx, ir, ig, ib
currmap(idx, 1) = ir
currmap(idx, 2) = ig
currmap(idx, 3) = ib
enddo
! a few cleanup
close(io)
end subroutine
!-----------------------------------------------------
!-
! draw all the colors in a nice picture
!-
subroutine fcolm_plot_mapfile(fname)
character(*), intent(in) :: fname
type(t_pixrgb), allocatable :: prgb(:,:)
integer :: errcode, ix, iy, xx
integer :: rgb(3)
write(0, *) ' -> fractcolmap plot map to [', fname, ']'
allocate(prgb(512, 128), stat=errcode)
! Please, add a molly-guard
if (0 .NE. errcode) then
write(0, *) "errcode allocate in plot_map: ", errcode
STOP 'ABEND'
endif
print *, ' FILE ', fname
do ix = 1, 255
call fcolm_get_rgb(ix-1, rgb)
xx = ix * 2
! print *, ix, xx, " => ", rgb
do iy=1, 128
prgb( xx, iy)%r = rgb(1)
prgb(1+xx, iy)%r = rgb(1)
prgb( xx, iy)%g = rgb(2)
prgb(1+xx, iy)%g = rgb(2)
prgb( xx, iy)%b = rgb(3)
prgb(1+xx, iy)%b = rgb(3)
enddo
enddo
! push all the colred dats to disk
call rgbpix_spit_as_pnm_8(prgb, fname)
deallocate(prgb)
end subroutine
!-----------------------------------------------------
subroutine fcolm_get_rgb(idx, rgb)
integer, intent(in) :: idx
integer, intent(out) :: rgb(3)
rgb(1) = max(min(currmap(idx, 1), 255), 0) ! Red
rgb(2) = max(min(currmap(idx, 2), 255), 0) ! Green
rgb(3) = max(min(currmap(idx, 3), 255), 0) ! Blue
end subroutine
!-----------------------------------------------------
subroutine fcolm_make_gray()
integer :: idx
do idx=0, 255
currmap(idx, 1) = idx
currmap(idx, 2) = idx
currmap(idx, 3) = idx
enddo
initialized = .TRUE.
end subroutine
!-----------------------------------------------------
subroutine fcolm_print_map()
integer :: idx
do idx=0, 255
print *, currmap(idx, 1), currmap(idx, 2), currmap(idx, 3)
enddo
end subroutine
!-----------------------------------------------------
end module

256
Fraktalism/mods/neon.map Normal file
View File

@ -0,0 +1,256 @@
0 0 0 A flashy map ... by D. Egnor
0 0 0
8 0 0
16 4 4
24 4 8
32 8 12
40 12 16
48 12 20
56 16 24
64 20 28
72 20 32
80 24 36
88 28 40
96 28 44
104 32 48
112 36 52
120 36 56
128 40 60
136 40 64
144 44 68
152 48 72
160 48 76
168 52 80
176 56 84
184 56 88
192 60 92
200 64 96
208 64 100
216 68 104
224 72 108
232 72 112
240 76 116
252 80 120
248 80 120
240 76 116
232 76 112
224 72 108
216 68 104
208 68 100
200 64 96
192 60 92
184 60 88
176 56 84
168 56 80
160 52 76
152 48 72
144 48 68
136 44 64
128 40 60
120 40 60
112 36 56
104 36 52
96 32 48
88 28 44
80 28 40
72 24 36
64 20 32
56 20 28
48 16 24
40 16 20
32 12 16
24 8 12
16 8 8
8 4 4
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 4 0
0 12 0
0 20 0
0 28 0
0 36 0
0 44 0
0 52 0
0 60 0
0 68 0
0 76 0
0 84 0
0 92 0
0 100 0
0 108 0
0 116 0
0 124 0
0 132 0
0 140 0
0 148 0
0 156 0
0 164 0
0 172 0
0 180 0
0 188 0
0 196 0
0 204 0
0 212 0
0 220 0
0 228 0
0 236 0
0 244 0
0 252 0
0 248 0
0 240 0
0 232 0
0 224 0
0 216 0
0 208 0
0 200 0
0 192 0
0 184 0
0 176 0
0 168 0
0 160 0
0 152 0
0 144 0
0 136 0
0 128 0
0 120 0
0 112 0
0 104 0
0 96 0
0 88 0
0 80 0
0 72 0
0 64 0
0 56 0
0 48 0
0 40 0
0 32 0
0 24 0
0 16 0
0 8 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
4 4 0
12 12 0
20 20 0
28 28 0
36 36 0
44 44 0
52 52 0
60 60 0
68 68 0
76 76 0
84 84 0
92 92 0
100 100 0
108 108 0
116 116 0
124 124 0
132 132 0
140 140 0
148 148 0
156 156 0
164 164 0
172 172 0
180 180 0
188 188 0
196 196 0
204 204 0
212 212 0
220 220 0
228 228 0
236 236 0
244 244 0
252 252 0
248 248 0
240 240 0
232 232 0
224 224 0
216 216 0
208 208 0
200 200 0
192 192 0
184 184 0
176 176 0
168 168 0
160 160 0
152 152 0
144 144 0
136 136 0
128 128 0
120 120 0
112 112 0
104 104 0
96 96 0
88 88 0
80 80 0
72 72 0
64 64 0
56 56 0
48 48 0
40 40 0
32 32 0
24 24 0
16 16 0
8 8 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0

37
Fraktalism/mods/t.f90 Normal file
View File

@ -0,0 +1,37 @@
program t
use fractcolmap
call fcolm_infos('from main')
! call fcolm_make_gray()
call fcolm_load_mapfile('volcano.map')
call fcolm_plot_mapfile('volcano.pnm')
call fcolm_load_mapfile('neon.map')
call fcolm_plot_mapfile('neon.pnm')
call fcolm_load_mapfile('chroma.map')
call fcolm_plot_mapfile('chroma.pnm')
STOP 'BECAUSE YOU WAS OUMPFED.'
contains
!-------------------
subroutine print_boundaries()
integer :: foo
integer :: cmp(3)
do foo=-2, 5
call fcolm_get_rgb(foo, cmp)
print *, foo, ' --> ', cmp
enddo
do foo=252, 257
call fcolm_get_rgb(foo, cmp)
print *, foo, ' --> ', cmp
enddo
end subroutine
end program

256
Fraktalism/mods/volcano.map Normal file
View File

@ -0,0 +1,256 @@
0 0 0 An explosion of lava ... by D. Egnor
60 60 60
64 60 60
72 60 60
76 56 56
84 56 56
88 52 52
96 52 52
100 48 48
108 48 48
112 44 44
120 44 44
128 40 40
132 40 40
140 36 36
144 36 36
152 32 32
156 32 32
164 28 28
168 28 28
176 24 24
180 24 24
188 20 20
196 20 20
200 16 16
208 16 16
212 12 12
220 12 12
224 8 8
232 8 8
236 4 4
244 4 4
252 0 0
252 4 0
252 12 0
252 20 0
252 28 0
252 36 0
252 44 0
252 52 0
252 60 0
252 68 0
252 76 0
252 84 0
252 92 0
252 100 0
252 108 0
252 116 0
252 124 0
252 132 0
252 140 0
252 148 0
252 156 0
252 164 0
252 172 0
252 180 0
252 188 0
252 196 0
252 204 0
252 212 0
252 220 0
252 228 0
252 236 0
252 244 0
252 252 0
252 252 4
252 252 12
252 252 20
252 252 28
252 252 36
252 252 44
252 252 52
252 252 60
252 252 68
252 252 76
252 252 84
252 252 92
252 252 100
252 252 108
252 252 116
252 252 124
252 252 132
252 252 140
252 252 148
252 252 156
252 252 164
252 252 172
252 252 180
252 252 188
252 252 196
252 252 204
252 252 212
252 252 220
252 252 228
252 252 236
252 252 244
252 252 252
252 252 252
252 248 248
252 248 244
252 244 240
252 244 236
252 240 232
252 240 228
252 236 224
252 236 220
252 232 216
252 232 212
252 228 208
252 228 204
252 224 200
252 224 196
252 220 192
252 220 188
252 216 184
252 216 180
252 212 176
252 212 172
252 208 168
252 208 164
252 204 160
252 204 156
252 200 152
252 200 148
252 196 144
252 196 140
252 192 136
252 192 132
252 188 128
252 184 124
252 184 120
252 180 116
252 180 112
252 176 108
252 176 104
252 172 100
252 172 96
252 168 92
252 168 88
252 164 84
252 164 80
252 160 76
252 160 72
252 156 68
252 156 64
252 152 60
252 152 56
252 148 52
252 148 48
252 144 44
252 144 40
252 140 36
252 140 32
252 136 28
252 136 24
252 132 20
252 132 16
252 128 12
252 128 8
252 124 4
252 120 0
252 120 0
252 116 0
252 112 0
252 108 0
252 104 0
252 100 0
252 96 0
252 92 0
252 88 0
252 84 0
252 80 0
252 76 0
252 72 0
252 68 0
252 64 0
252 60 0
252 60 0
252 56 0
252 52 0
252 48 0
252 44 0
252 40 0
252 36 0
252 32 0
252 28 0
252 24 0
252 20 0
252 16 0
252 12 0
252 8 0
252 4 0
252 0 0
252 0 0
248 0 0
244 0 0
244 0 0
240 0 0
236 0 0
232 0 0
232 0 0
228 0 0
224 0 0
224 0 0
220 0 0
216 0 0
212 0 0
212 0 0
208 0 0
204 0 0
204 0 0
200 0 0
196 0 0
192 0 0
192 0 0
188 0 0
184 0 0
184 0 0
180 0 0
176 0 0
172 0 0
172 0 0
168 0 0
164 0 0
160 0 0
160 0 0
156 4 4
152 4 4
148 8 8
144 8 8
140 12 12
140 12 12
136 16 16
132 16 16
128 20 20
124 20 20
120 24 24
120 24 24
116 28 28
112 28 28
108 32 32
104 32 32
100 36 36
100 36 36
96 40 40
92 40 40
88 44 44
84 44 44
80 48 48
80 48 48
76 52 52
72 52 52
68 56 56
64 56 56
60 60 60
60 60 60