Brightens or darkens the image. Only supported for PGM and PPM images.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(format_pnm), | intent(inout) | :: | this | |||
integer, | intent(in) | :: | factor |
elemental pure subroutine brighten(this, factor) class(format_pnm), intent(inout) :: this integer, intent(in) :: factor select case (this%file_format) case ('pbm') error stop 'brighten: This function is not supported for pbm files.' case ('pgm', 'ppm') call this%set_pixels(min(this%max_color, max(0, this%pixels + factor))) end select end subroutine brighten