diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/Filter.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/Filter.java b/src/main/java/Filter.java index ddc3e92..73b435b 100644 --- a/src/main/java/Filter.java +++ b/src/main/java/Filter.java | |||
@@ -13,8 +13,16 @@ public final class Filter { | |||
13 | * @return nearest valid pixel color | 13 | * @return nearest valid pixel color |
14 | */ | 14 | */ |
15 | public static float at(float[][] gray, int row, int col) { | 15 | public static float at(float[][] gray, int row, int col) { |
16 | // TODO at | 16 | int maxRow = gray.length - 1; |
17 | return 0.0f; | 17 | int maxCol = gray[0].length - 1; |
18 | |||
19 | if (row < 0) row = 0; | ||
20 | if (col < 0) col = 0; | ||
21 | |||
22 | if (row > maxRow) row = maxRow; | ||
23 | if (col > maxCol) col = maxCol; | ||
24 | |||
25 | return gray[row][col]; | ||
18 | } | 26 | } |
19 | 27 | ||
20 | /** | 28 | /** |