Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Commit

Permalink
Show zone under mouse pointer on Histogram
Browse files Browse the repository at this point in the history
  • Loading branch information
ktgw0316 committed Jan 23, 2022
1 parent 0437fe2 commit d818b98
Showing 1 changed file with 15 additions and 3 deletions.
@@ -1,11 +1,13 @@
/* Copyright (C) 2005-2011 Fabio Riccardi */
/* Copyright (C) 2018- Masahiro Kitagawa */

package com.lightcrafts.model.ImageEditor;

import com.lightcrafts.jai.JAIContext;
import com.lightcrafts.jai.utils.Functions;
import com.lightcrafts.model.Preview;
import com.lightcrafts.model.Region;
import lombok.val;

import javax.media.jai.Histogram;
import javax.media.jai.PlanarImage;
Expand Down Expand Up @@ -33,12 +35,22 @@ public String getName() {

@Override
public void setDropper(Point p) {

if (p == null || engine == null)
return;

Color sample = engine.getPixelValue(p.x, p.y);
final int zone;
if (sample == null) {
zone = -1;
} else {
val lightness = calcLightness(sample.getRed(), sample.getGreen(), sample.getBlue());
zone = (int) calcZone(lightness);
}
setFocusedZone(zone, null);
}

@Override
public void setRegion(Region region) {

}

@Override
Expand Down Expand Up @@ -179,7 +191,7 @@ private int yscale(double y) {
}
}

private static float[] logTable = new float[0x10000];
private static final float[] logTable = new float[0x10000];

static {
for (int i = 0; i < 0x10000; i++)
Expand Down

0 comments on commit d818b98

Please sign in to comment.