/* * VisiQuest */ /* * Copyright (c) AccuSoft Corporation, 2005. * All rights reserved. See $BOOTSTRAP/repos/license/License or run klicense. */ /* >>>>>>>>>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<< >>>> >>>> Driver code for mytranspose >>>> >>>> Private: >>>> run_mytranspose() >>>> mytranspose_extra_usage_additions(); >>>> mytranspose_extra_free_args(); >>>> Static: >>>> Public: >>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<< */ #include "mytranspose.h" /*----------------------------------------------------------- | | Routine Name: run_mytranspose() - A simple example: transpose a greyscale image | | Purpose: program driver code for mytranspose | | Returns: TRUE (1) on success, FALSE (0) on failure | Written By: gnemeth | Date: Apr 16, 2008 | ------------------------------------------------------------*/ int run_mytranspose(void) { /*-- Put Your Code Here --*/ /* -main_variable_list */ char *lib = "mythreshold_obj"; char *rtn = "main"; kobject in_object = NULL; kobject out_object = NULL; unsigned char *plane; unsigned char *res_plane; int w, h, d, t, e; int cw, ch, ct, pos, res_pos; /* -main_variable_list_end */ /* -main_before_lib_call */ if ((in_object = kpds_open_input_object(clui_info->i_file)) == KOBJECT_INVALID) { kerror(lib, rtn, "Can not open input object %s.\n", clui_info->i_file); kexit(KEXIT_FAILURE); } if ((out_object = kpds_open_output_object(clui_info->o_file)) == KOBJECT_INVALID) { kerror(lib, rtn, "Can not open output object %s.\n", clui_info->o_file); kexit(KEXIT_FAILURE); } kpds_create_value( out_object ); /* if (!kpds_copy_object(in_object, out_object)) { kerror(lib, rtn, "Can not copy input object to output object.\n"); kexit(KEXIT_FAILURE); } */ kpds_set_attribute(in_object, KPDS_VALUE_DATA_TYPE, KUBYTE); kpds_set_attribute(out_object, KPDS_VALUE_DATA_TYPE, KUBYTE); kpds_get_attribute(in_object, KPDS_VALUE_SIZE, &w, &h, &d, &t, &e); /* ALLLITSD BE AZ OUTPUT OBJEKTUM MERETET! */ kpds_set_attribute( out_object, KPDS_VALUE_SIZE, h, w, d, t, e ); plane = (unsigned char *)kmalloc(w*h*sizeof(unsigned char)); res_plane = (char *)kmalloc(w*h*sizeof(unsigned char)); if (!plane || !res_plane) { kerror(lib, rtn, "Could not allocate memory for the image\n"); kexit(KEXIT_FAILURE); } /* -main_before_lib_call_end */ /* -main_library_call */ /* VALOSITSD MEG A TRANSZPONALAST!! */ for ( ct = 0; ct