Skip to content

Commit

Permalink
Add get_encoding function to pnm module
Browse files Browse the repository at this point in the history
  • Loading branch information
gha3mi committed Feb 15, 2024
1 parent 14daf00 commit 28a1789
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/pnm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module pnm
contains
! Procedures for setting individual attributes
procedure :: set_format !!> Set the encoding of the PNM image.
procedure :: get_format !!> Get the encoding of the PNM image.
procedure, private :: set_file_format !!> Set the file format of the PNM image.
procedure, private :: set_magicnumber !!> Set the magic number of the PNM image.
procedure, private :: set_width !!> Set the width of the PNM image.
Expand Down Expand Up @@ -610,6 +611,19 @@ end subroutine set_format
!===============================================================================


!===============================================================================
!> author: Seyed Ali Ghasemi
!> license: BSD 3-Clause
!!> Gets the encoding of the PNM image.
pure function get_format(this) result(encoding)
class(format_pnm), intent(in) :: this
character(:), allocatable :: encoding

encoding = trim(this%encoding)
end function get_format
!===============================================================================


!===============================================================================
!> author: Seyed Ali Ghasemi
!> license: BSD 3-Clause
Expand Down

0 comments on commit 28a1789

Please sign in to comment.