The Colormap class and the colormaps_list.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=*), | public, | parameter, dimension(6+222+4) | :: | colormaps_list | = | [character(colormap_name_length)::miscellaneous_colormaps_list, scientific_colour_maps_list, matplotlib_colormaps_list] |
List of built-in colormaps: |
The Colormap class (attributes are encapsulated):
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | levels | ||||
| integer, | private, | dimension(:, :), allocatable | :: | map | |||
| character(len=colormap_name_length), | private | :: | name | ||||
| real(kind=wp), | private | :: | zmax | ||||
| real(kind=wp), | private | :: | zmin |
| procedure, public :: colorbar => write_ppm_colorbar | |
| procedure, public :: compute_RGB | |
| procedure, public :: create | |
| procedure, public :: create_bezier | |
| procedure, public :: create_lagrange | |
| procedure, public :: extract | |
| procedure, public :: finalize | |
| procedure, public :: get_RGB | |
| procedure, public :: get_levels | |
| procedure, public :: get_name | |
| procedure, public :: get_zmax | |
| procedure, public :: get_zmin | |
| procedure, public :: load | |
| procedure, public :: print | |
| procedure, public :: reverse | |
| procedure, public :: set | |
| procedure, public :: shift | |
| procedure, private :: check |
Create colormap from continuous Bezier interpolation of control colors
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in), | dimension(:,:) | :: | colors | ||
| integer, | intent(in), | optional | :: | levels |
Factorial function used for Bezier interpolation
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Colormap), | intent(in) | :: | self |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Colormap), | intent(in) | :: | self |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Colormap), | intent(in) | :: | self |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Colormap), | intent(in) | :: | self |
Create colormap from Lagrange interpolation of control colors
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in), | dimension(:,:) | :: | colors | ||
| integer, | intent(in), | optional | :: | levels |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | t | |||
| integer, | intent(in) | :: | n |
order + 1 |
Scale the input real array to the integer RGB range [a, b]
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in), | dimension(:) | :: | real_array | ||
| integer, | intent(in) | :: | a | |||
| integer, | intent(in) | :: | b |
Normalize the input real array to the range [0, 1]
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in), | dimension(:) | :: | real_array | ||
| real(kind=wp), | intent(in) | :: | a | |||
| real(kind=wp), | intent(in) | :: | b |
Check validity of the colormap and fix it if necessary
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Colormap), | intent(inout) | :: | self | |||
| logical, | intent(in), | optional | :: | check_name | ||
| logical, | intent(in), | optional | :: | check_bounds | ||
| logical, | intent(in), | optional | :: | check_levels |
Most of the time you will just give z to obtain RGB values:
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Colormap), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | z | |||
| integer, | intent(out) | :: | red | |||
| integer, | intent(out) | :: | green | |||
| integer, | intent(out) | :: | blue |
You can create a custom colormap from a "map" array.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Colormap), | intent(inout) | :: | self | |||
| character(len=*), | intent(in) | :: | name | |||
| real(kind=wp), | intent(in) | :: | zmin | |||
| real(kind=wp), | intent(in) | :: | zmax | |||
| integer, | intent(in), | dimension(:, :) | :: | map | ||
| logical, | intent(in), | optional | :: | reverse |
You can create a custom colormap using Bezier interpolation:
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Colormap), | intent(inout) | :: | self | |||
| character(len=*), | intent(in) | :: | name | |||
| real(kind=wp), | intent(in) | :: | zmin | |||
| real(kind=wp), | intent(in) | :: | zmax | |||
| integer, | intent(in), | dimension(:, :) | :: | colors | ||
| integer, | intent(in) | :: | levels | |||
| logical, | intent(in), | optional | :: | reverse |
You can create a custom colormap using Lagrange interpolation:
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Colormap), | intent(inout) | :: | self | |||
| character(len=*), | intent(in) | :: | name | |||
| real(kind=wp), | intent(in) | :: | zmin | |||
| real(kind=wp), | intent(in) | :: | zmax | |||
| integer, | intent(in), | dimension(:, :) | :: | colors | ||
| integer, | intent(in) | :: | levels | |||
| logical, | intent(in), | optional | :: | reverse |
Extracts colors from the colormap based on specified number of levels (nl)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Colormap), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | extractedLevels | |||
| character(len=*), | intent(in), | optional | :: | name | ||
| real(kind=wp), | intent(in), | optional | :: | zmin | ||
| real(kind=wp), | intent(in), | optional | :: | zmax | ||
| logical, | intent(in), | optional | :: | reverse |
A finalizer procedure for memory cleanup:
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Colormap), | intent(inout) | :: | self |
But you can also obtain RGB by giving directly a level number:
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Colormap), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | level | |||
| integer, | intent(out) | :: | red | |||
| integer, | intent(out) | :: | green | |||
| integer, | intent(out) | :: | blue |
Load a .txt colormap with RGB integers separated by spaces on each line. Remark: if no path is indicated in filename, the .txt must be present at the root of the fpm project of the user.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Colormap), | intent(inout) | :: | self | |||
| character(len=*), | intent(in) | :: | filename | |||
| real(kind=wp), | intent(in) | :: | zmin | |||
| real(kind=wp), | intent(in) | :: | zmax | |||
| logical, | intent(in), | optional | :: | reverse |
Useful for testing and debugging:
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Colormap), | intent(inout) | :: | self |
Reverse the colormap
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Colormap), | intent(inout) | :: | self | |||
| character(len=*), | intent(in), | optional | :: | name |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Colormap), | intent(inout) | :: | self | |||
| character(len=*), | intent(in) | :: | name | |||
| real(kind=wp), | intent(in) | :: | zmin | |||
| real(kind=wp), | intent(in) | :: | zmax | |||
| integer, | intent(in), | optional | :: | levels | ||
| real(kind=wp), | intent(in), | optional, | dimension(:) | :: | varargs | |
| logical, | intent(in), | optional | :: | reverse |
Apply a circular shift to the colormap (left is +, right is -)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Colormap), | intent(inout) | :: | self | |||
| integer, | intent(in) | :: | sh |
The shift |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Colormap), | intent(inout) | :: | self | |||
| character(len=*), | intent(in) | :: | filename | |||
| integer, | intent(in), | optional | :: | width | ||
| integer, | intent(in), | optional | :: | height | ||
| character(len=*), | intent(in), | optional | :: | encoding |