Class PixelDecimator
java.lang.Object
com.arbergashi.charts.internal.PixelDecimator
Algorithm for data reduction for display purposes.
With very large datasets (e.g., 1 million points), it is inefficient to draw lines for every point when the screen is only 2000 pixels wide. The decimator reduces the data to min/max values per pixel column.
- Since:
- 2025-06-01
- Version:
- 1.0.0
- Author:
- Arber Gashi
-
Method Summary
Modifier and TypeMethodDescriptionstatic intdecimate(double[] xIn, double[] yIn, int count, PlotContext context, double[] outX, double[] outY) Reduces the input data to approx. 2 points per pixel column (Min and Max).
-
Method Details
-
decimate
public static int decimate(double[] xIn, double[] yIn, int count, PlotContext context, double[] outX, double[] outY) Reduces the input data to approx. 2 points per pixel column (Min and Max).- Parameters:
xIn- Input XyIn- Input Ycount- Number of pointscontext- PlotContext (for width)outX- Output buffer (must be large enough, e.g., 4 * width)outY- Output buffer- Returns:
- Number of points in the output buffer
-