pixel Derived Type

type, public :: pixel


Components

Type Visibility Attributes Name Initial
character(len=256), public :: image_name
character(len=256), public :: file_name
real(kind=rk), public, dimension(:,:), allocatable :: pixels
real(kind=rk), public, dimension(:,:), allocatable :: pixels_app
integer, public :: nrow
integer, public :: ncol
integer, public :: rank

Type-Bound Procedures

procedure, public :: image_to_pixels

  • private impure subroutine image_to_pixels(this, image_name, file_name)

    Author
    Seyed Ali Ghasemi

    Arguments

    Type IntentOptional Attributes Name
    class(pixel), intent(inout) :: this
    character(len=*), intent(in) :: image_name
    character(len=*), intent(in) :: file_name

procedure, public :: load_pixels

  • private impure subroutine load_pixels(this, file_name)

    Author
    Seyed Ali Ghasemi

    Arguments

    Type IntentOptional Attributes Name
    class(pixel), intent(inout) :: this
    character(len=*), intent(in) :: file_name

procedure, public :: compress_pixels

  • private pure subroutine compress_pixels(this, rank, method)

    Author
    Seyed Ali Ghasemi

    Arguments

    Type IntentOptional Attributes Name
    class(pixel), intent(inout) :: this
    integer, intent(in) :: rank
    character(len=*), intent(in), optional :: method

procedure, public :: save_pixels

  • private impure subroutine save_pixels(this, file_name)

    Author
    Seyed Ali Ghasemi

    Arguments

    Type IntentOptional Attributes Name
    class(pixel), intent(inout) :: this
    character(len=*), intent(in) :: file_name

procedure, public :: pixels_to_image

  • private impure subroutine pixels_to_image(this, file_name, image_name)

    Author
    Seyed Ali Ghasemi

    Arguments

    Type IntentOptional Attributes Name
    class(pixel), intent(inout) :: this
    character(len=*), intent(in) :: file_name
    character(len=*), intent(in) :: image_name

procedure, public :: dlloc => deallocate_pixel

  • private pure elemental subroutine deallocate_pixel(this)

    Author
    Seyed Ali Ghasemi

    Arguments

    Type IntentOptional Attributes Name
    class(pixel), intent(inout) :: this

Source Code

   type :: pixel
      character(256)                        :: image_name
      character(256)                        :: file_name
      real(rk), dimension(:,:), allocatable :: pixels
      real(rk), dimension(:,:), allocatable :: pixels_app
      integer                               :: nrow, ncol
      integer                               :: rank
   contains
      procedure :: image_to_pixels ! TODO:
      procedure :: load_pixels
      procedure :: compress_pixels
      procedure :: save_pixels
      procedure :: pixels_to_image  ! TODO:
      procedure :: dlloc => deallocate_pixel
   end type pixel