Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created Nov 17, 2021
Embed
What would you like to do?
# Vamos a recorrer una mini matriz en la caja
inicio_y = y-1
inicio_x = x-1
fin_y = y+1
fin_x = x+1
if inicio_y < 0:
inicio_y = 0
if inicio_x < 0:
inicio_x = 0
if fin_x >= ancho:
fin_x = ancho - 1
if fin_y >= alto:
fin_y = alto - 1
suma_red = 0
suma_green = 0
suma_blue = 0
conteo = 0
while inicio_y <= fin_y:
indice_x = inicio_x
while indice_x <= fin_x:
# Aquí calculamos el promedio
indice_x += 1
conteo += 1
inicio_y += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment