set_pixel_b Subroutine

private pure elemental subroutine set_pixel_b(this, grey, r, g, b, i, j)

Sets the pixel values of the PNM image.

Type Bound

format_pnm

Arguments

Type IntentOptional Attributes Name
class(format_pnm), intent(inout) :: this
integer, intent(in), optional :: grey
integer, intent(in), optional :: r
integer, intent(in), optional :: g
integer, intent(in), optional :: b
integer, intent(in) :: i
integer, intent(in) :: j

Called by

proc~~set_pixel_b~~CalledByGraph proc~set_pixel_b format_pnm%set_pixel_b none~set_pixels format_pnm%set_pixels none~set_pixels->proc~set_pixel_b proc~brighten format_pnm%brighten proc~brighten->none~set_pixels proc~crop format_pnm%crop proc~crop->none~set_pixels proc~negative format_pnm%negative proc~negative->none~set_pixels proc~resize format_pnm%resize proc~resize->none~set_pixels proc~rotate format_pnm%rotate proc~rotate->none~set_pixels proc~set_pnm format_pnm%set_pnm proc~set_pnm->none~set_pixels proc~save color%save proc~save->proc~set_pnm program~demo_ppm demo_ppm program~demo_ppm->proc~brighten program~demo_ppm->proc~crop program~demo_ppm->proc~negative program~demo_ppm->proc~resize program~demo_ppm->proc~rotate program~demo_ppm->proc~set_pnm program~test test program~test->proc~set_pnm program~test1 test1 program~test1->proc~set_pnm program~test17 test17 program~test17->proc~negative program~test17->proc~set_pnm program~test18 test18 program~test18->proc~brighten program~test18->proc~set_pnm program~test19 test19 program~test19->proc~set_pnm program~test2 test2 program~test2->proc~set_pnm program~test20 test20 program~test20->proc~set_pnm program~test21 test21 program~test21->proc~set_pnm program~test22 test22 program~test22->proc~rotate program~test22->proc~set_pnm program~test23 test23 program~test23->proc~set_pnm program~test24 test24 program~test24->proc~crop program~test24->proc~set_pnm program~test25 test25 program~test25->proc~resize program~test25->proc~set_pnm program~test3 test3 program~test3->proc~set_pnm program~test4 test4 program~test4->proc~set_pnm program~test6 test6 program~test6->proc~set_pnm

Source Code

   elemental pure subroutine set_pixel_b(this, grey,r,g,b, i, j)
      class(format_pnm), intent(inout) :: this
      integer, intent(in), optional    :: grey
      integer, intent(in), optional    :: r, g, b
      integer, intent(in)              :: i, j
      select case(this%magic_number)
       case('P1')
         this%pixels(i,j) = grey
       case('P2')
         this%pixels(i,j) = grey
       case('P3')
         this%pixels(i,3*j-2) = r
         this%pixels(i,3*j-1) = g
         this%pixels(i,3*j-0) = b
      end select
   end subroutine set_pixel_b