test19.f90 Source File


This file depends on

sourcefile~~test19.f90~~EfferentGraph sourcefile~test19.f90 test19.f90 sourcefile~forimage.f90 forimage.f90 sourcefile~test19.f90->sourcefile~forimage.f90 sourcefile~forcolor.f90 forcolor.f90 sourcefile~forimage.f90->sourcefile~forcolor.f90 sourcefile~forimage_parameters.f90 forimage_parameters.f90 sourcefile~forimage.f90->sourcefile~forimage_parameters.f90 sourcefile~lut.f90 lut.f90 sourcefile~forimage.f90->sourcefile~lut.f90 sourcefile~pnm.f90 pnm.f90 sourcefile~forimage.f90->sourcefile~pnm.f90 sourcefile~forcolor.f90->sourcefile~forimage_parameters.f90 sourcefile~forcolor.f90->sourcefile~pnm.f90 sourcefile~pnm.f90->sourcefile~forimage_parameters.f90

Source Code

program test19
    use forimage, only: format_pnm, ik
    implicit none
    
    type(format_pnm) :: image
    integer(ik), dimension(4,12) :: px

    print*,' '
    print'(a)', 'Test 19'

    px(1,:)  = [14,12,11,0,0,0,0,0,0,15,0,15]
    px(2,:)  = [0,0,0,0,15,7,0,0,0,0,0,0]
    px(3,:)  = [0,0,0,0,0,0,0,15,7,0,0,0]
    px(4,:)  = [15,0,15,0,0,0,0,0,0,0,0,0]

    call image%set_pnm(encoding='binary', file_format='ppm', width=4, height=4, max_color=15, comment='test 2', pixels=px)
    call image%swap_channels(swap='bg')
    call image%export_pnm('pnm_files/img3_binary_swap')
    call image%export_pnm('pnm_files/img3_ascii_swap', 'ascii')
    call image%print_info()
    call image%finalize()
end program test19