/* * Khoros: $Id$ */ #if !defined(__lint) && !defined(__CODECENTER__) static char rcsid[] = "Khoros: $Id$"; #endif /* * Copyright (C) 1997, INPE. Sergio Donizete Faria, Gerald Jean Francis Banon * All rights reserved. See $K_PROG/repos/license/License. */ #include "knnsc.h" /*----------------------------------------------------------- | | Routine Name: knnsc_get_args | | Purpose: Gets command line args for knnsc | | Input: None | | Output: None | Written By: ghostwriter -oname knnsc | Date: July 1, 1997 | Modifications: | ------------------------------------------------------------*/ void knnsc_get_args( kaddr opane) { static char *sync_error_mesg = "Generated code for knnsc is out of sync with arguments specified in knnsc's *.pane file; please rerun ghostwriter on knnsc."; kform *pane = (kform *) opane; /* * allocate the knnsc structure */ clui_info = (clui_info_struct *) kcalloc((size_t)1, sizeof (clui_info_struct)); if (!(kclui_get_infile(pane, "i_img", &(clui_info->i_img_file), &(clui_info->i_img_flag)))) { kerror(NULL, "knnsc_get_args", sync_error_mesg); kexit(KEXIT_FAILURE); } if (!(kclui_get_infile(pane, "t_img", &(clui_info->t_img_file), &(clui_info->t_img_flag)))) { kerror(NULL, "knnsc_get_args", sync_error_mesg); kexit(KEXIT_FAILURE); } if (!(kclui_get_int(pane, "ref_img_mean", &(clui_info->ref_img_mean_int), &(clui_info->ref_img_mean_flag)))) { kerror(NULL, "knnsc_get_args", sync_error_mesg); kexit(KEXIT_FAILURE); } if (!(kclui_get_int(pane, "search_img_mean", &(clui_info->search_img_mean_int), &(clui_info->search_img_mean_flag)))) { kerror(NULL, "knnsc_get_args", sync_error_mesg); kexit(KEXIT_FAILURE); } if (!(kclui_get_int(pane, "interval_length", &(clui_info->interval_length_int), &(clui_info->interval_length_flag)))) { kerror(NULL, "knnsc_get_args", sync_error_mesg); kexit(KEXIT_FAILURE); } if (!(kclui_get_outfile(pane, "o_img", &(clui_info->o_img_file), &(clui_info->o_img_flag)))) { kerror(NULL, "knnsc_get_args", sync_error_mesg); kexit(KEXIT_FAILURE); } } /* * internal representation of clui UIS file */ char *clui_uis[] = { "-F 4.3 1 0 52x1+0+0 +0+0 'Cantata' cantata", "-M 1 1 52x1+0+0 +1+0 'Analyse and count if pixel value not belongs to an interval ' subform", "-P 1 0 52x1+0+1 +0+0 ' ' knnsc", "-D 1 0 9x1+0+0 'Options' _gui_options", "-H 1 6x1+0+0 'License' 'license' $BOOTSTRAP/repos/license/License license", "-E", "-R 1 0 1 5x1+46+0 'Run' 'execute operation' $MATCHINGBIN/knnsc", "-H 1 5x1+53+0 'Help' 'help page' $MATCHING/objects/kroutine/knnsc/help help", "-Q 1 0 5.25x1+60+0 'Close'", "-I 1 0 0 1 0 1 66x1+0+2 ' ' 'Search Image' 'Search image' i_img", "-I 1 0 0 1 0 1 66x1+0+3 ' ' 'Template' 'Template image' t_img", "-i 1 0 0 1 0 34x1+1+4 1 1 0 0 0 'Reference Image Mean' 'Reference image mean' ref_img_mean", "-i 1 0 0 1 0 34x1+1+5 1 1 0 0 0 'Search Image Mean' 'Search image mean' search_img_mean", "-i 1 0 0 1 0 34x1+1+6 1 1 0 0 0 'Interval Length' 'Interval length around template' interval_length", "-O 1 0 0 1 0 1 66x1+0+7 ' ' 'Output Image' 'Resulting output image' o_img", "-E", "-E", "-E", }; size_t clui_line_lookup[] = { 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,}; size_t clui_file_lookup[] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,}; /* * array of uis filenames and line numbers for error messaging */ char *clui_filenames[] = { "$MATCHING/objects/kroutine/knnsc/uis/knnsc.pane", }; /* * UIS struct for clui */ uis_struct clui_uis_spec = { clui_uis, 18, clui_file_lookup, clui_line_lookup, clui_filenames, 1, 512};