Search
 
SCRIPT & CODE EXAMPLE
 

CPP

c++ code 2d block

for(size_t bx = 0; bx < width;  bx += block_width)
for(size_t by = 0; by < height; by += block_height) {
  float sum = 0;
  for(size_t x = 0; x < block_width; ++x)
  for(size_t y = 0; y < block_height; ++y) {
    sum += array[bx + x][by + y];
  }
  average = sum / (block_width * block_height);
  new_array[bx][by] = average;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: c++ language 
Cpp :: floating point exception 
Cpp :: changing key bindings in visual code not working 
Cpp :: sprintf add two xeroes for a float number 
Cpp :: 2d vector size c++ 
Cpp :: how to define global array in c++ in a scope 
Cpp :: 2d stl array 
Cpp :: C++ Battery Low 
Cpp :: flutter websocket auto reconnect 
Cpp :: lambda - print-out array and add comment 
Cpp :: how to read qlistwidget in c++ 
Cpp :: sort sub vector, sort range of vector c++ 
Cpp :: check if an item is in a vector c++ 
Cpp :: c++ arreglo/array 
Cpp :: lcm recursive program in c++ 
Cpp :: sieve of eratosthenes c++ 
Cpp :: c++ find string in string 
Cpp :: vector remove class 
Cpp :: for statement in c++ 
Cpp :: what do we use c++ vectors for 
Cpp :: how to put string in array c++ 
Cpp :: memsert 
C :: pi in c language 
C :: print an array in c 
C :: shuffle function in c 
C :: octave sum all elements in matrix 
C :: sigaction in c 
C :: program execution time calculate in c 
C :: c convert number to string 
C :: to find greatest of 4 numbers in c 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =