test3 Program

Uses

  • program~~test3~~UsesGraph program~test3 test3 module~forimage forimage program~test3->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~~test3~~CallsGraph program~test3 test3 proc~deallocate_pnm format_pnm%deallocate_pnm program~test3->proc~deallocate_pnm proc~export_pnm format_pnm%export_pnm program~test3->proc~export_pnm proc~print_info format_pnm%print_info program~test3->proc~print_info proc~set_pnm format_pnm%set_pnm program~test3->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~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~check_pixel_range format_pnm%check_pixel_range 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 test3
    use forimage, only: format_pnm, ik
    implicit none
    
    ! Declare an object of type format_pnm
    type(format_pnm) :: image

    ! Define a 2D array representing pixel values for the image
    integer(ik), dimension(4,12) :: px

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

    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]

    ! Set the properties of the format_pnm object (encoding, file format, width, height, comment and pixels)
    call image%set_pnm(encoding='ascii', file_format='ppm', width=4, height=4, max_color=15, comment='test 2', pixels=px)

    ! Export the PNM image to a file named 'img3_ascii' in the specified format
    call image%export_pnm('pnm_files/img3_ascii')

    ! Print the image information to the screen
    call image%print_info()

    ! Finalize the format_pnm object to release resources
    call image%finalize()

end program test3