/** * Checks the pixels for presence of colour against legend background * * @param img given row of the legend * @param req general mechanism for acquiring legend symbols * @return false if no colours are detected */ public static boolean checkColor(BufferedImage img, GetLegendGraphicRequest req) { int w = img.getWidth(); int h = img.getHeight(); boolean colourPresent = false; for (int j = 0; j < w; j++) { for (int k = 0; k < h; k++) { if (img.getRGB(j, k) != LegendUtils.getBackgroundColor(req).getRGB()) { colourPresent = true; } } } return colourPresent; }
ImageUtils.prepareTransparency( false, LegendUtils.getBackgroundColor(legend.request), finalLegend, new HashMap<RenderingHints.Key, Object>());
ImageUtils.prepareTransparency( transparent, LegendUtils.getBackgroundColor(request), image, hintsMap);
ImageUtils.prepareTransparency( transparent, LegendUtils.getBackgroundColor(request), image, hintsMap);
margin, labelMargin, LegendUtils.getBackgroundColor(req), req.isTransparent(), LegendUtils.isFontAntiAliasing(req),
bgColor = LegendUtils.getBackgroundColor(request);