void stretch_memory_R8G8B8A8(int source_height,int source_width,void *source_memory,int destination_height,int destination_width,void *destination_memory) { BYTE *destination_memory_BYTE = (BYTE *)destination_memory; BYTE *source_memory_BYTE = (BYTE *)source_memory; const double local_initial_value_width_0 = double(destination_width)/double(source_width); for(int local_height_counter_source=0;local_height_counter_source<source_height;local_height_counter_source++) { int local_check_value_height = local_height_counter_source*destination_height/source_height+1+destination_height/source_height; if(local_check_value_height>destination_height) { local_check_value_height = destination_height; } for(int local_height_counter_destination=local_height_counter_source*destination_height/source_height; local_height_counter_destination<local_check_value_height; local_height_counter_destination++) { for(int local_width_counter_source=0;local_width_counter_source<source_width;local_width_counter_source++) { int local_initial_value_width = local_width_counter_source*local_initial_value_width_0; int local_check_value_width = local_initial_value_width+1+local_initial_value_width_0; if(local_check_value_width>destination_width) { local_check_value_width = destination_width; } for(int local_width_counter_destination=local_initial_value_width; local_width_counter_destination<local_check_value_width; local_width_counter_destination++) { *(DWORD*)(&destination_memory_BYTE[(local_width_counter_destination+local_height_counter_destination*destination_width)<<2]) = *(DWORD*)(&source_memory_BYTE[(local_width_counter_source+local_height_counter_source*source_width)<<2]); } } } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)