trying to use the new rgb pixels module
This commit is contained in:
@@ -4,8 +4,9 @@
|
||||
!-
|
||||
!-----------------------------------------------------------------------
|
||||
program essai
|
||||
use realfield
|
||||
use spitpgm ! XXX
|
||||
use realfield
|
||||
use spitpgm ! XXX
|
||||
use pixrgb
|
||||
|
||||
implicit none
|
||||
|
||||
@@ -23,17 +24,17 @@ contains
|
||||
subroutine essai_near_planet(nbplanets, szfield)
|
||||
integer, intent(in) :: nbplanets, szfield
|
||||
|
||||
integer, dimension(:,:), allocatable :: map
|
||||
integer :: ix, iy
|
||||
real :: fx, fy, dx, dy
|
||||
integer :: near, ipl, errcode
|
||||
real :: curdist, smalldist
|
||||
type(massbody) :: planets(nbplanets)
|
||||
type(t_pixrgb), dimension(:,:), allocatable :: cmap
|
||||
integer :: ix, iy
|
||||
real :: fx, fy, dx, dy
|
||||
integer :: near, ipl, errcode
|
||||
real :: curdist, smalldist
|
||||
type(massbody) :: planets(nbplanets)
|
||||
|
||||
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
|
||||
!-----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user