Flips the image vertically.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(format_pnm), | intent(inout) | :: | this |
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