-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
94f490f
commit c852e77
Showing
9 changed files
with
526 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
src/Fortran_libraries/VIZ_src/volume_rendering/colormap_grayscales.f90
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
!>@file colormap_grayscales.F90 | ||
!!@brief module colormap_grayscales | ||
!! | ||
!!@author H. Matsui | ||
!!@date Programmed in Apr., 2024 | ||
! | ||
!>@brief Colormapping for grayscales | ||
!! | ||
!!@verbatim | ||
!! subroutine s_colormap_grayscale(rnorm, r, g, b) | ||
!! subroutine s_colormap_sym_grayscale(rnorm, r, g, b) | ||
!! real(kind = kreal), intent(in) :: rnorm | ||
!! real(kind = kreal), intent(inout) :: r, g, b | ||
!!@endverbatim | ||
! | ||
module colormap_grayscales | ||
! | ||
use m_precision | ||
use m_constants | ||
! | ||
implicit none | ||
! | ||
! ------------------------------------------------------------------ | ||
! | ||
contains | ||
! | ||
! ------------------------------------------------------------------ | ||
! | ||
subroutine s_colormap_grayscale(rnorm, r, g, b) | ||
! | ||
real(kind = kreal), intent(in) :: rnorm | ||
real(kind = kreal), intent(inout) :: r, g, b | ||
! | ||
real(kind = kreal), parameter :: black = zero | ||
real(kind = kreal), parameter :: white = one | ||
! | ||
! | ||
if (rnorm .lt. zero ) then | ||
r = zero | ||
g = zero | ||
b = zero | ||
else if (rnorm .ge. zero .and. rnorm.lt.white) then | ||
r = 0.85d0*rnorm | ||
g = 0.85d0*rnorm | ||
b = 0.85d0*rnorm | ||
else if (rnorm .ge. white ) then | ||
r = 0.85d0 | ||
g = 0.85d0 | ||
b = 0.85d0 | ||
end if | ||
! | ||
end subroutine s_colormap_grayscale | ||
! | ||
! ---------------------------------------------------------------------- | ||
! | ||
subroutine s_colormap_sym_grayscale(rnorm, r, g, b) | ||
! | ||
real(kind = kreal), intent(in) :: rnorm | ||
real(kind = kreal), intent(inout) :: r, g, b | ||
! | ||
real(kind = kreal), parameter :: black = zero | ||
real(kind = kreal), parameter :: white = one | ||
real(kind = kreal), parameter :: half = one / two | ||
! | ||
! | ||
if (rnorm .lt. zero ) then | ||
r = zero | ||
g = zero | ||
b = zero | ||
else if (rnorm .ge. zero .and. rnorm.lt.half) then | ||
r = 0.85d0*two*rnorm | ||
g = 0.85d0*two*rnorm | ||
b = 0.85d0*two*rnorm | ||
else if (rnorm .ge. half .and. rnorm.lt.white) then | ||
r = 0.85d0*two*(one - rnorm) | ||
g = 0.85d0*two*(one - rnorm) | ||
b = 0.85d0*two*(one - rnorm) | ||
else if (rnorm .ge. white ) then | ||
r = zero | ||
g = zero | ||
b = zero | ||
end if | ||
! | ||
end subroutine s_colormap_sym_grayscale | ||
! | ||
! ---------------------------------------------------------------------- | ||
! | ||
end module colormap_grayscales |
63 changes: 63 additions & 0 deletions
63
src/Fortran_libraries/VIZ_src/volume_rendering/colormap_metal.f90
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
!>@file colormap_metal.F90 | ||
!!@brief module colormap_metal | ||
!! | ||
!!@author H. Matsui | ||
!!@date Programmed in Apr., 2024 | ||
! | ||
!>@brief Colormapping for molten metal | ||
!! | ||
!!@verbatim | ||
!! subroutine s_colormap_metal(rnorm, r, g, b) | ||
!! real(kind = kreal), intent(in) :: rnorm | ||
!! real(kind = kreal), intent(inout) :: r, g, b | ||
!!@endverbatim | ||
! | ||
module colormap_metal | ||
! | ||
use m_precision | ||
use m_constants | ||
! | ||
implicit none | ||
! | ||
! ------------------------------------------------------------------ | ||
! | ||
contains | ||
! | ||
! ------------------------------------------------------------------ | ||
! | ||
subroutine s_colormap_metal(rnorm, r, g, b) | ||
! | ||
real(kind = kreal), intent(in) :: rnorm | ||
real(kind = kreal), intent(inout) :: r, g, b | ||
! | ||
real(kind = kreal), parameter :: c_g1 = 0.6 | ||
real(kind = kreal), parameter :: r_mul = one / c_g1 | ||
real(kind = kreal), parameter :: g_mul = one / (one - c_g1) | ||
! | ||
real(kind = kreal) :: x | ||
! | ||
! | ||
x = rnorm | ||
if (x .lt. zero) then | ||
r = zero | ||
else if(r .lt. c_g1) then | ||
r = x * r_mul | ||
else | ||
r = one | ||
end if | ||
! | ||
if (x .lt. c_g1) then | ||
g = zero | ||
else if(r .lt. one) then | ||
g = (x - c_g1) * g_mul | ||
else | ||
g = one | ||
end if | ||
! | ||
b = zero | ||
! | ||
end subroutine s_colormap_metal | ||
! | ||
! ---------------------------------------------------------------------- | ||
! | ||
end module colormap_metal |
76 changes: 76 additions & 0 deletions
76
src/Fortran_libraries/VIZ_src/volume_rendering/colormap_rainbow.f90
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
!>@file colormap_rainbow.F90 | ||
!!@brief module colormap_rainbow | ||
!! | ||
!!@author H. Matsui | ||
!!@date Programmed in Apr., 2024 | ||
! | ||
!>@brief Rainbow colormapping | ||
!! | ||
!!@verbatim | ||
!! subroutine s_colormap_rainbow(rnorm, r, g, b) | ||
!! real(kind = kreal), intent(in) :: rnorm | ||
!! real(kind = kreal), intent(inout) :: r, g, b | ||
!!@endverbatim | ||
! | ||
module colormap_rainbow | ||
! | ||
use m_precision | ||
use m_constants | ||
! | ||
implicit none | ||
! | ||
! ------------------------------------------------------------------ | ||
! | ||
contains | ||
! | ||
! ------------------------------------------------------------------ | ||
! | ||
subroutine s_colormap_rainbow(rnorm, r, g, b) | ||
! | ||
real(kind = kreal), intent(in) :: rnorm | ||
real(kind = kreal), intent(inout) :: r, g, b | ||
! | ||
real(kind = kreal), parameter :: purple = zero | ||
real(kind = kreal), parameter :: blue = 0.1e0 | ||
real(kind = kreal), parameter :: ocean = 0.325e0 | ||
real(kind = kreal), parameter :: green = 0.55e0 | ||
real(kind = kreal), parameter :: yellow = 0.775e0 | ||
real(kind = kreal), parameter :: red = one | ||
real(kind = kreal), parameter :: forty = four*ten | ||
! | ||
! | ||
if (rnorm .lt. purple ) then | ||
r = half | ||
g = zero | ||
b = one | ||
else if (rnorm .ge. purple .and. rnorm.lt.blue) then | ||
r = half - five*rnorm | ||
g = zero | ||
b = one | ||
else if (rnorm .ge. blue .and. rnorm.lt.ocean) then | ||
r = zero | ||
g = forty*(rnorm-blue) / dnine | ||
b = one | ||
else if (rnorm .ge. ocean .and. rnorm.lt.green) then | ||
r = zero | ||
g = one | ||
b = one - forty*(rnorm-ocean) / dnine | ||
else if (rnorm .ge. green .and. rnorm.lt.yellow) then | ||
r = forty*(rnorm-green) / dnine | ||
g = one | ||
b = zero | ||
else if (rnorm .ge. yellow .and. rnorm.lt. red) then | ||
r = one | ||
g = one - forty*(rnorm-yellow) / dnine | ||
b = zero | ||
else if (rnorm .ge. red ) then | ||
r = one | ||
g = zero | ||
b = zero | ||
end if | ||
! | ||
end subroutine s_colormap_rainbow | ||
! | ||
! ---------------------------------------------------------------------- | ||
! | ||
end module colormap_rainbow |
117 changes: 117 additions & 0 deletions
117
src/Fortran_libraries/VIZ_src/volume_rendering/colormap_space.f90
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
!>@file colormap_space.F90 | ||
!!@brief module colormap_space | ||
!! | ||
!!@author H. Matsui | ||
!!@date Programmed in Apr., 2024 | ||
! | ||
!>@brief Colormapping | ||
!! | ||
!!@verbatim | ||
!! subroutine s_colormap_space(rnorm, r, g, b) | ||
!! real(kind = kreal), intent(in) :: rnorm | ||
!! real(kind = kreal), intent(inout) :: r, g, b | ||
!!@endverbatim | ||
! | ||
module colormap_space | ||
! | ||
use m_precision | ||
use m_constants | ||
! | ||
implicit none | ||
! | ||
! ------------------------------------------------------------------ | ||
! | ||
contains | ||
! | ||
! ------------------------------------------------------------------ | ||
! | ||
subroutine s_colormap_space(rnorm, r, g, b) | ||
! | ||
real(kind = kreal), intent(in) :: rnorm | ||
real(kind = kreal), intent(inout) :: r, g, b | ||
! | ||
real(kind = kreal), parameter :: c_r1 = 37067.0 / 158860.0 | ||
real(kind = kreal), parameter :: c_r2 = 85181.0 / 230350.0 | ||
real(kind = kreal), parameter & | ||
& :: c_r3 = (sqrt(3196965649.0) + 83129.0) / 310480.0 | ||
real(kind = kreal), parameter :: c_r4 = 231408.0 / 362695.0 | ||
real(kind = kreal), parameter :: c_r5 = 152073.0 / 222340.0 | ||
real(kind = kreal), parameter :: c_r6 = 294791.0 / 397780.0 | ||
real(kind = kreal), parameter :: c_r7 = 491189.0 / 550980.0 | ||
! | ||
real(kind = kreal), parameter & | ||
& :: c_g1 = (-sqrt(166317494.0) + 39104.0) / 183830.0 | ||
real(kind = kreal), parameter & | ||
& :: c_g3 = (3.0 * sqrt(220297369.0) + 58535.0) / 155240.0 | ||
! | ||
real(kind = kreal), parameter :: c_b1 = 51987.0 / 349730.0 | ||
! | ||
real(kind = kreal) :: x, xx | ||
! | ||
! | ||
x = rnorm | ||
if (x .lt. c_r1) then | ||
r = 0.0 | ||
else if (x .lt. c_r2) then | ||
xx = x - c_r1 | ||
r = (780.25 * xx + 319.71) * xx / 255.0 | ||
else if (x .lt. c_r3) then | ||
r = ((1035.33580904442 * x - 82.5380748768798) * x & | ||
& - 52.8985266363332) / 255.0 | ||
else if (x .lt. c_r4) then | ||
r = (339.41 * x - 33.194) / 255.0 | ||
else if (x .lt. c_r5) then | ||
r = (1064.8 * x - 496.01) / 255.0 | ||
else if (x .lt. c_r6) then | ||
r = (397.78 * x - 39.791) / 255.0 | ||
else if (x .lt. c_r7) then | ||
r = 1.0 | ||
else if (x .lt. one) then | ||
r = (5509.8 * x + 597.91) * x / 255.0 | ||
else | ||
r = 1.0 | ||
end if | ||
|
||
if (x .lt. zero) then | ||
g = 0.0 | ||
else if (x .lt. c_g1) then | ||
g = (-1838.3 * x + 464.36) * x / 255.0 | ||
else if (x .lt. c_r1) then | ||
g = (-317.72 * x + 74.134) / 255.0 | ||
else if (x .lt. c_g3) then | ||
g = 0.0 | ||
else if (x .lt. c_r6) then | ||
xx = x - c_g3 | ||
g = (-1945.0 * xx + 1430.2) * xx / 255.0 | ||
else if (x .lt. c_r7) then | ||
g = ((-1770.0 * x + 3.92813840044638e3) * x & | ||
& - 1.84017494792245e3) / 255.0 | ||
else | ||
g = 1.0 | ||
end if | ||
|
||
if (x .lt. zero) then | ||
b = 0.0 | ||
else if (x .lt. c_b1) then | ||
b = (458.79 * x) / 255.0 | ||
else if (x .lt. c_r2) then | ||
b = (109.06 * x + 51.987) / 255.0 | ||
else if (x .lt. c_r3) then | ||
b = (339.41 * x - 33.194) / 255.0 | ||
else if (x .lt. c_g3) then | ||
b = ((-1552.4 * x + 1170.7) * x - 92.996) / 255.0 | ||
else if (x .lt. 27568.0 / 38629.0) then | ||
b = 0.0 | ||
else if (x .lt. 81692.0 / 96241.0) then | ||
b = (386.29 * x - 275.68) / 255.0 | ||
else if (x .lt. 1.0) then | ||
b = (1348.7 * x - 1092.6) / 255.0 | ||
else | ||
b = 1.0 | ||
end if | ||
! | ||
end subroutine s_colormap_space | ||
! | ||
! ---------------------------------------------------------------------- | ||
! | ||
end module colormap_space |
Oops, something went wrong.