flip_vertical Subroutine

private pure elemental subroutine flip_vertical(this)

Flips the image vertically.

Type Bound

format_pnm

Arguments

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

Calls

proc~~flip_vertical~~CallsGraph proc~flip_vertical format_pnm%flip_vertical proc~check_pixel_range format_pnm%check_pixel_range proc~flip_vertical->proc~check_pixel_range proc~set_height format_pnm%set_height proc~flip_vertical->proc~set_height proc~set_width format_pnm%set_width proc~flip_vertical->proc~set_width

Called by

proc~~flip_vertical~~CalledByGraph proc~flip_vertical format_pnm%flip_vertical program~demo_ppm demo_ppm program~demo_ppm->proc~flip_vertical program~test23 test23 program~test23->proc~flip_vertical

Source Code

   elemental pure subroutine flip_vertical(this)
      class(format_pnm), intent(inout) :: this

      this%pixels(:,:) = this%pixels(size(this%pixels,1):1:-1, :)
      call this%check_pixel_range(this%pixels)

      call this%set_height(size(this%pixels,1))

      select case (this%file_format)
       case ('pbm', 'pgm')
         call this%set_width(size(this%pixels,2))
       case ('ppm')
         call this%set_width(size(this%pixels,2)/3)
      end select
   end subroutine flip_vertical