test21 Program

Uses

  • program~~test21~~UsesGraph program~test21 test21 module~forimage forimage program~test21->module~forimage module~forcolor forcolor module~forimage->module~forcolor module~forimage_parameters forimage_parameters module~forimage->module~forimage_parameters module~lut lut module~forimage->module~lut module~pnm pnm module~forimage->module~pnm module~forcolor->module~forimage_parameters module~forcolor->module~pnm iso_fortran_env iso_fortran_env module~forimage_parameters->iso_fortran_env module~pnm->module~forimage_parameters

Calls

program~~test21~~CallsGraph program~test21 test21 proc~deallocate_pnm format_pnm%deallocate_pnm program~test21->proc~deallocate_pnm proc~export_pnm format_pnm%export_pnm program~test21->proc~export_pnm proc~greyscale format_pnm%greyscale program~test21->proc~greyscale proc~print_info format_pnm%print_info program~test21->proc~print_info proc~set_pnm format_pnm%set_pnm program~test21->proc~set_pnm proc~set_format format_pnm%set_format proc~export_pnm->proc~set_format proc~write_header write_header proc~export_pnm->proc~write_header proc~check_pixel_range format_pnm%check_pixel_range proc~greyscale->proc~check_pixel_range proc~aspect_ratio aspect_ratio proc~print_info->proc~aspect_ratio proc~average_colors average_colors proc~print_info->proc~average_colors proc~pixel_size pixel_size proc~print_info->proc~pixel_size proc~allocate_pixels format_pnm%allocate_pixels proc~set_pnm->proc~allocate_pixels proc~set_file_format format_pnm%set_file_format proc~set_pnm->proc~set_file_format proc~set_pnm->proc~set_format proc~set_header format_pnm%set_header proc~set_pnm->proc~set_header proc~set_pixels format_pnm%set_pixels proc~set_pnm->proc~set_pixels proc~set_comment format_pnm%set_comment proc~set_header->proc~set_comment proc~set_height format_pnm%set_height proc~set_header->proc~set_height proc~set_magicnumber format_pnm%set_magicnumber proc~set_header->proc~set_magicnumber proc~set_max_color format_pnm%set_max_color proc~set_header->proc~set_max_color proc~set_width format_pnm%set_width proc~set_header->proc~set_width proc~set_pixels->proc~check_pixel_range

Variables

Type Attributes Name Initial
type(format_pnm) :: image
integer(kind=ik), dimension(4,12) :: px

Source Code

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

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

    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%greyscale()
    call image%export_pnm('pnm_files/img3_binary_greyscale')
    call image%export_pnm('pnm_files/img3_ascii_greyscale', 'ascii')
    call image%print_info()
    call image%finalize()
end program test21