github-advanced-security[bot] commented on code in PR #884:
URL: 
https://github.com/apache/incubator-baremaps/pull/884#discussion_r1696918062


##########
baremaps-raster/src/main/java/org/apache/baremaps/raster/elevation/HillshadeCalculator.java:
##########
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.baremaps.raster.elevation;
+
+/**
+ * Provides methods for generating hillshade effects on digital elevation 
models (DEMs).
+ */
+public class HillshadeCalculator {
+
+  private static final double DEFAULT_SCALE = 0.1;
+  private static final double ENHANCED_SCALE = 1.0;
+  private static final double MIN_REFLECTANCE = 0.0;
+  private static final double MAX_REFLECTANCE = 255.0;
+  private static final double TWO_PI = 2 * Math.PI;
+
+  private final double[] dem;
+  private final int width;
+  private final int height;
+  private final double scale;
+  private final boolean isSimple;
+
+  public HillshadeCalculator(double[] dem, int width, int height, double 
scale, boolean isSimple) {
+    this.dem = dem;
+    this.width = width;
+    this.height = height;
+    this.scale = scale;
+    this.isSimple = isSimple;
+  }
+
+  /**
+   * Generates a hillshade effect on the DEM.
+   *
+   * @param sunAltitude The sun's altitude in degrees
+   * @param sunAzimuth The sun's azimuth in degrees
+   * @return An array representing the hillshade effect
+   */
+  public double[] calculate(double sunAltitude, double sunAzimuth) {
+    validateInput(dem, width, height, sunAltitude, sunAzimuth);
+    return calculateHillshade(sunAltitude, sunAzimuth);
+  }
+
+  /**
+   * Generates a hillshade effect on the given DEM.
+   *
+   * @param sunAltitude The sun's altitude in degrees
+   * @param sunAzimuth The sun's azimuth in degrees
+   * @return An array representing the hillshade effect
+   */
+  public double[] calculate(double sunAltitude, double sunAzimuth, double 
scale, boolean isSimple) {

Review Comment:
   ## Useless parameter
   
   The parameter 'scale' is never used.
   
   [Show more 
details](https://github.com/apache/incubator-baremaps/security/code-scanning/1524)



##########
baremaps-raster/src/main/java/org/apache/baremaps/raster/elevation/HillshadeCalculator.java:
##########
@@ -0,0 +1,147 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.baremaps.raster.elevation;
+
+/**
+ * Provides methods for generating hillshade effects on digital elevation 
models (DEMs).
+ */
+public class HillshadeCalculator {
+
+  private static final double DEFAULT_SCALE = 0.1;
+  private static final double ENHANCED_SCALE = 1.0;
+  private static final double MIN_REFLECTANCE = 0.0;
+  private static final double MAX_REFLECTANCE = 255.0;
+  private static final double TWO_PI = 2 * Math.PI;
+
+  private final double[] dem;
+  private final int width;
+  private final int height;
+  private final double scale;
+  private final boolean isSimple;
+
+  public HillshadeCalculator(double[] dem, int width, int height, double 
scale, boolean isSimple) {
+    this.dem = dem;
+    this.width = width;
+    this.height = height;
+    this.scale = scale;
+    this.isSimple = isSimple;
+  }
+
+  /**
+   * Generates a hillshade effect on the DEM.
+   *
+   * @param sunAltitude The sun's altitude in degrees
+   * @param sunAzimuth The sun's azimuth in degrees
+   * @return An array representing the hillshade effect
+   */
+  public double[] calculate(double sunAltitude, double sunAzimuth) {
+    validateInput(dem, width, height, sunAltitude, sunAzimuth);
+    return calculateHillshade(sunAltitude, sunAzimuth);
+  }
+
+  /**
+   * Generates a hillshade effect on the given DEM.
+   *
+   * @param sunAltitude The sun's altitude in degrees
+   * @param sunAzimuth The sun's azimuth in degrees
+   * @return An array representing the hillshade effect
+   */
+  public double[] calculate(double sunAltitude, double sunAzimuth, double 
scale, boolean isSimple) {

Review Comment:
   ## Useless parameter
   
   The parameter 'isSimple' is never used.
   
   [Show more 
details](https://github.com/apache/incubator-baremaps/security/code-scanning/1525)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to