trying to use the new rgb pixels module
This commit is contained in:
parent
fc03c70454
commit
e780a79273
@ -2,8 +2,8 @@
|
||||
# Fortraneries by tTh - Gravity Field
|
||||
#
|
||||
|
||||
GFOPT = -Wall -Wextra -g -pg -time -I../Modules
|
||||
MODOBJ = ../Modules/spitpgm.o
|
||||
GFOPT = -Wall -Wextra -g -time -I../Modules
|
||||
MODOBJ = ../Modules/spitpgm.o ../Modules/pixrgb.o
|
||||
|
||||
all: essai animation
|
||||
|
||||
|
@ -64,6 +64,8 @@ end subroutine
|
||||
|
||||
!-----------------------------------------------------------------------
|
||||
!-
|
||||
! this is going to go very complex
|
||||
!-
|
||||
subroutine make_color_map(moons, fname, width, height)
|
||||
type(massbody), intent(in) :: moons(:)
|
||||
character(len=*), intent(in) :: fname
|
||||
|
@ -6,6 +6,7 @@
|
||||
program essai
|
||||
use realfield
|
||||
use spitpgm ! XXX
|
||||
use pixrgb
|
||||
|
||||
implicit none
|
||||
|
||||
@ -23,7 +24,7 @@ contains
|
||||
subroutine essai_near_planet(nbplanets, szfield)
|
||||
integer, intent(in) :: nbplanets, szfield
|
||||
|
||||
integer, dimension(:,:), allocatable :: map
|
||||
type(t_pixrgb), dimension(:,:), allocatable :: cmap
|
||||
integer :: ix, iy
|
||||
real :: fx, fy, dx, dy
|
||||
integer :: near, ipl, errcode
|
||||
@ -32,8 +33,8 @@ subroutine essai_near_planet(nbplanets, szfield)
|
||||
|
||||
print *, "near planets test", nbplanets, szfield
|
||||
|
||||
allocate(map(szfield, szfield), stat=errcode)
|
||||
map = -1
|
||||
allocate(cmap(szfield, szfield), stat=errcode)
|
||||
! map = -1
|
||||
|
||||
! create some random bodies
|
||||
do ipl=1, nbplanets
|
||||
@ -63,7 +64,9 @@ subroutine essai_near_planet(nbplanets, szfield)
|
||||
endif
|
||||
end do ! loop on ipl
|
||||
|
||||
map(ix, iy) = mod(near, 255)
|
||||
cmap(ix, iy)%r = mod(near*2, 255)
|
||||
cmap(ix, iy)%g = mod(near*3, 255)
|
||||
cmap(ix, iy)%b = mod(near*4, 255)
|
||||
|
||||
enddo
|
||||
|
||||
@ -71,7 +74,7 @@ subroutine essai_near_planet(nbplanets, szfield)
|
||||
|
||||
enddo
|
||||
|
||||
call spit_as_pgm_8(map, "nearest.pgm")
|
||||
call rgbpix_spit_as_pnm(cmap, "rgb.pnm")
|
||||
|
||||
end subroutine
|
||||
!-----------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user