From 28a1789c2f79b2e1dce397a540f8e30f5dec9736 Mon Sep 17 00:00:00 2001 From: Seyed Ali Ghasemi Date: Thu, 15 Feb 2024 11:44:39 +0100 Subject: [PATCH] Add get_encoding function to pnm module --- src/pnm.f90 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/pnm.f90 b/src/pnm.f90 index 90ba766..e44241d 100644 --- a/src/pnm.f90 +++ b/src/pnm.f90 @@ -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. @@ -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