Draw this image at a specified location and size as a silohette

@param x The x location to draw the image at
@param y The y location to draw the image at
@param width The width to render the image at
@param height The height to render the image at
431830
public void drawFlash(float x,float y,float width,float height) {
		drawFlash(x,y,width,height,Color.white);
	}
726202
public void setBounds(float x, float y, float width, float height) {
		setX(x);
		setY(y);
		setSize(width, height);
	}
669211
def draw_rectangle(x, y, width, height, attr = {})
            load!

            stroke_color  = attr.fetch(:stroke_color, DEFAULT_STROKE_COLOR)
            fill_color    = attr.fetch(:fill_color, DEFAULT_FILL_COLOR)
            line_cap      = attr.fetch(:line_cap, DEFAULT_LINECAP)
            line_join     = attr.fetch(:line_join, DEFAULT_LINEJOIN)
            line_width    = attr.fetch(:line_width, DEFAULT_LINEWIDTH)
            dash_pattern  = attr.fetch(:dash, DEFAULT_DASHPATTERN)

            stroke        = attr[:stroke].nil? ? true : attr[:stroke]
            fill          = attr[:fill].nil? ? false : attr[:fill]

            stroke = true if fill == false and stroke == false

            set_fill_color(fill_color) if fill
            set_stroke_color(stroke_color) if stroke
            set_line_width(line_width)
            set_line_cap(line_cap)
            set_line_join(line_join)
            set_dash_pattern(dash_pattern)

            if @canvas.gs.text_state.is_in_text_object?
                @instructions << PDF::Instruction.new('ET').render(@canvas)
            end

            @instructions << PDF::Instruction.new('re', x,y,width,height).render(@canvas)

            @instructions << (i =
                if stroke and not fill
                    PDF::Instruction.new('S')
                elsif fill and not stroke
                    PDF::Instruction.new('f')
                elsif fill and stroke
                    PDF::Instruction.new('B')
                end
            )

            i.render(@canvas)

            self
        end
726154
public void set(double x, double y, double width, double height) {
        this.x = x;
        this.y = y;
        this.width = width;
        this.height = height;
    }
335368
public Surface fillRect (float x, float y, float width, float height) {
    if (patternTex != null) {
      batch.addQuad(patternTex, tint, tx(), x, y, width, height);
    } else {
      batch.addQuad(colorTex, Tint.combine(fillColor, tint), tx(), x, y, width, height);
    }
    return this;
  }
157072
public Tile tile (float x, float y, float width, float height) {
    final float tileX = x, tileY = y, tileWidth = width, tileHeight = height;
    return new Tile() {
      @Override public Texture texture () { return Texture.this; }
      @Override public float width () { return tileWidth; }
      @Override public float height () { return tileHeight; }
      @Override public float sx () { return tileX/displayWidth; }
      @Override public float sy () { return tileY/displayHeight; }
      @Override public float tx () { return (tileX+tileWidth)/displayHeight; }
      @Override public float ty () { return (tileY+tileWidth)/displayHeight; }
      @Override public void addToBatch (QuadBatch batch, int tint, AffineTransform tx,
                                        float x, float y, float width, float height) {
        batch.addQuad(texture(), tint, tx, x, y, width, height, tileX, tileY, tileWidth, tileHeight);
      }
      @Override public void addToBatch (QuadBatch batch, int tint, AffineTransform tx,
                                        float dx, float dy, float dw, float dh,
                                        float sx, float sy, float sw, float sh) {
        batch.addQuad(texture(), tint, tx, dx, dy, dw, dh, tileX+sx, tileY+sy, sw, sh);
      }
    };
  }
697713
public void drawFlash(float x,float y,float width,float height, Color col) {
		if (frames.size() == 0) {
			return;
		}
		
		if (autoUpdate) {
			long now = getTime();
			long delta = now - lastUpdate;
			if (firstUpdate) {
				delta = 0;
				firstUpdate = false;
			}
			lastUpdate = now;
			nextFrame(delta);
		}
		
		Frame frame = (Frame) frames.get(currentFrame);
		frame.image.drawFlash(x,y,width,height,col);
	}
499778
public function draw($X, $Y, $Width, $Height, array $Format = [])
    {
        $Values = isset($Format["Values"]) ? $Format["Values"] : VOID;
        $IndicatorSections = isset($Format["IndicatorSections"]) ? $Format["IndicatorSections"] : null;
        $ValueDisplay = isset($Format["ValueDisplay"]) ? $Format["ValueDisplay"] : INDICATOR_VALUE_BUBBLE;
        $SectionsMargin = isset($Format["SectionsMargin"]) ? $Format["SectionsMargin"] : 4;
        $DrawLeftHead = isset($Format["DrawLeftHead"]) ? $Format["DrawLeftHead"] : true;
        $DrawRightHead = isset($Format["DrawRightHead"]) ? $Format["DrawRightHead"] : true;
        $HeadSize = isset($Format["HeadSize"]) ? $Format["HeadSize"] : floor($Height / 4);
        $TextPadding = isset($Format["TextPadding"]) ? $Format["TextPadding"] : 4;
        $CaptionLayout = isset($Format["CaptionLayout"]) ? $Format["CaptionLayout"] : INDICATOR_CAPTION_EXTENDED;
        $CaptionPosition = isset($Format["CaptionPosition"]) ? $Format["CaptionPosition"] : INDICATOR_CAPTION_INSIDE;
        $CaptionColorFactor = isset($Format["CaptionColorFactor"]) ? $Format["CaptionColorFactor"] : null;
        $CaptionR = isset($Format["CaptionR"]) ? $Format["CaptionR"] : 255;
        $CaptionG = isset($Format["CaptionG"]) ? $Format["CaptionG"] : 255;
        $CaptionB = isset($Format["CaptionB"]) ? $Format["CaptionB"] : 255;
        $CaptionAlpha = isset($Format["CaptionAlpha"]) ? $Format["CaptionAlpha"] : 100;
        $SubCaptionColorFactor = isset($Format["SubCaptionColorFactor"]) ? $Format["SubCaptionColorFactor"] : null;
        $SubCaptionR = isset($Format["SubCaptionR"]) ? $Format["SubCaptionR"] : 50;
        $SubCaptionG = isset($Format["SubCaptionG"]) ? $Format["SubCaptionG"] : 50;
        $SubCaptionB = isset($Format["SubCaptionB"]) ? $Format["SubCaptionB"] : 50;
        $SubCaptionAlpha = isset($Format["SubCaptionAlpha"]) ? $Format["SubCaptionAlpha"] : 100;
        $ValueFontName = isset($Format["ValueFontName"]) ? $Format["ValueFontName"] : $this->pChartObject->FontName;
        $ValueFontSize = isset($Format["ValueFontSize"]) ? $Format["ValueFontSize"] : $this->pChartObject->FontSize;
        $CaptionFontName = isset($Format["CaptionFontName"])
            ? $Format["CaptionFontName"] : $this->pChartObject->FontName
        ;
        $CaptionFontSize = isset($Format["CaptionFontSize"])
            ? $Format["CaptionFontSize"] : $this->pChartObject->FontSize
        ;
        $Unit = isset($Format["Unit"]) ? $Format["Unit"] : "";

        /* Convert the Values to display to an array if needed */
        if (!is_array($Values)) {
            $Values = [$Values];
        }

        /* No section, let's die */
        if ($IndicatorSections == null) {
            return 0;
        }

        /* Determine indicator visual configuration */
        $OverallMin = $IndicatorSections[0]["End"];
        $OverallMax = $IndicatorSections[0]["Start"];
        foreach ($IndicatorSections as $Key => $Settings) {
            if ($Settings["End"] > $OverallMax) {
                $OverallMax = $Settings["End"];
            }
            if ($Settings["Start"] < $OverallMin) {
                $OverallMin = $Settings["Start"];
            }
        }
        $RealWidth = $Width - (count($IndicatorSections) - 1) * $SectionsMargin;
        $XScale = $RealWidth / ($OverallMax - $OverallMin);

        $X1 = $X;
        $ValuesPos = [];
        foreach ($IndicatorSections as $Key => $Settings) {
            $Color = ["R" => $Settings["R"], "G" => $Settings["G"], "B" => $Settings["B"]];
            $Caption = $Settings["Caption"];
            $SubCaption = $Settings["Start"] . " - " . $Settings["End"];

            $X2 = $X1 + ($Settings["End"] - $Settings["Start"]) * $XScale;

            if ($Key == 0 && $DrawLeftHead) {
                $Poly = [];
                $Poly[] = $X1 - 1;
                $Poly[] = $Y;
                $Poly[] = $X1 - 1;
                $Poly[] = $Y + $Height;
                $Poly[] = $X1 - 1 - $HeadSize;
                $Poly[] = $Y + ($Height / 2);
                $this->pChartObject->drawPolygon($Poly, $Color);
                $this->pChartObject->drawLine($X1 - 2, $Y, $X1 - 2 - $HeadSize, $Y + ($Height / 2), $Color);
                $this->pChartObject->drawLine(
                    $X1 - 2,
                    $Y + $Height,
                    $X1 - 2 - $HeadSize,
                    $Y + ($Height / 2),
                    $Color
                );
            }

            /* Determine the position of the breaks */
            $Break = [];
            foreach ($Values as $iKey => $Value) {
                if ($Value >= $Settings["Start"] && $Value <= $Settings["End"]) {
                    $XBreak = $X1 + ($Value - $Settings["Start"]) * $XScale;
                    $ValuesPos[$Value] = $XBreak;
                    $Break[] = floor($XBreak);
                }
            }

            if ($ValueDisplay == INDICATOR_VALUE_LABEL) {
                if (!count($Break)) {
                    $this->pChartObject->drawFilledRectangle($X1, $Y, $X2, $Y + $Height, $Color);
                } else {
                    sort($Break);
                    $Poly = [];
                    $Poly[] = $X1;
                    $Poly[] = $Y;
                    $LastPointWritten = false;
                    foreach ($Break as $iKey => $Value) {
                        if ($Value - 5 >= $X1) {
                            $Poly[] = $Value - 5;
                            $Poly[] = $Y;
                        } elseif ($X1 - ($Value - 5) > 0) {
                            $Offset = $X1 - ($Value - 5);
                            $Poly = [$X1, $Y + $Offset];
                        }

                        $Poly[] = $Value;
                        $Poly[] = $Y + 5;

                        if ($Value + 5 <= $X2) {
                            $Poly[] = $Value + 5;
                            $Poly[] = $Y;
                        } elseif (($Value + 5) > $X2) {
                            $Offset = ($Value + 5) - $X2;
                            $Poly[] = $X2;
                            $Poly[] = $Y + $Offset;
                            $LastPointWritten = true;
                        }
                    }
                    if (!$LastPointWritten) {
                        $Poly[] = $X2;
                        $Poly[] = $Y;
                    }
                    $Poly[] = $X2;
                    $Poly[] = $Y + $Height;
                    $Poly[] = $X1;
                    $Poly[] = $Y + $Height;

                    $this->pChartObject->drawPolygon($Poly, $Color);
                }
            } else {
                $this->pChartObject->drawFilledRectangle($X1, $Y, $X2, $Y + $Height, $Color);
            }

            if ($Key == count($IndicatorSections) - 1 && $DrawRightHead) {
                $Poly = [];
                $Poly[] = $X2 + 1;
                $Poly[] = $Y;
                $Poly[] = $X2 + 1;
                $Poly[] = $Y + $Height;
                $Poly[] = $X2 + 1 + $HeadSize;
                $Poly[] = $Y + ($Height / 2);
                $this->pChartObject->drawPolygon($Poly, $Color);
                $this->pChartObject->drawLine($X2 + 1, $Y, $X2 + 1 + $HeadSize, $Y + ($Height / 2), $Color);
                $this->pChartObject->drawLine(
                    $X2 + 1,
                    $Y + $Height,
                    $X2 + 1 + $HeadSize,
                    $Y + ($Height / 2),
                    $Color
                );
            }

            $YOffset = 0;
            $XOffset = 0;
            if ($CaptionPosition == INDICATOR_CAPTION_INSIDE) {
                $TxtPos = $this->pChartObject->getTextBox(
                    $X1,
                    $Y + $Height + $TextPadding,
                    $CaptionFontName,
                    $CaptionFontSize,
                    0,
                    $Caption
                );
                $YOffset = ($TxtPos[0]["Y"] - $TxtPos[2]["Y"]) + $TextPadding;

                if ($CaptionLayout == INDICATOR_CAPTION_EXTENDED) {
                    $TxtPos = $this->pChartObject->getTextBox(
                        $X1,
                        $Y + $Height + $TextPadding,
                        $CaptionFontName,
                        $CaptionFontSize,
                        0,
                        $SubCaption
                    );
                    $YOffset = $YOffset + ($TxtPos[0]["Y"] - $TxtPos[2]["Y"]) + $TextPadding * 2;
                }
                $XOffset = $TextPadding;
            }

            if ($CaptionColorFactor == null) {
                $CaptionColor = [
                    "Align" => TEXT_ALIGN_TOPLEFT,
                    "FontName" => $CaptionFontName,
                    "FontSize" => $CaptionFontSize,
                    "R" => $CaptionR,
                    "G" => $CaptionG,
                    "B" => $CaptionB,
                    "Alpha" => $CaptionAlpha
                ];
            } else {
                $CaptionColor = [
                    "Align" => TEXT_ALIGN_TOPLEFT,
                    "FontName" => $CaptionFontName,
                    "FontSize" => $CaptionFontSize,
                    "R" => $Settings["R"] + $CaptionColorFactor,
                    "G" => $Settings["G"] + $CaptionColorFactor,
                    "B" => $Settings["B"] + $CaptionColorFactor
                ];
            }

            if ($SubCaptionColorFactor == null) {
                $SubCaptionColor = [
                    "Align" => TEXT_ALIGN_TOPLEFT,
                    "FontName" => $CaptionFontName,
                    "FontSize" => $CaptionFontSize,
                    "R" => $SubCaptionR,
                    "G" => $SubCaptionG,
                    "B" => $SubCaptionB,
                    "Alpha" => $SubCaptionAlpha
                ];
            } else {
                $SubCaptionColor = [
                    "Align" => TEXT_ALIGN_TOPLEFT,
                    "FontName" => $CaptionFontName,
                    "FontSize" => $CaptionFontSize,
                    "R" => $Settings["R"] + $SubCaptionColorFactor,
                    "G" => $Settings["G"] + $SubCaptionColorFactor,
                    "B" => $Settings["B"] + $SubCaptionColorFactor
                ];
            }

            $RestoreShadow = $this->pChartObject->Shadow;
            $this->pChartObject->Shadow = false;

            if ($CaptionLayout == INDICATOR_CAPTION_DEFAULT) {
                $this->pChartObject->drawText($X1, $Y + $Height + $TextPadding, $Caption, $CaptionColor);
            } elseif ($CaptionLayout == INDICATOR_CAPTION_EXTENDED) {
                $TxtPos = $this->pChartObject->getTextBox(
                    $X1,
                    $Y + $Height + $TextPadding,
                    $CaptionFontName,
                    $CaptionFontSize,
                    0,
                    $Caption
                );
                $CaptionHeight = $TxtPos[0]["Y"] - $TxtPos[2]["Y"];

                $this->pChartObject->drawText(
                    $X1 + $XOffset,
                    $Y + $Height - $YOffset + $TextPadding,
                    $Caption,
                    $CaptionColor
                );
                $this->pChartObject->drawText(
                    $X1 + $XOffset,
                    $Y + $Height - $YOffset + $CaptionHeight + $TextPadding * 2,
                    $SubCaption,
                    $SubCaptionColor
                );
            }

            $this->pChartObject->Shadow = $RestoreShadow;

            $X1 = $X2 + $SectionsMargin;
        }

        $RestoreShadow = $this->pChartObject->Shadow;
        $this->pChartObject->Shadow = false;

        foreach ($Values as $Key => $Value) {
            if ($Value >= $OverallMin && $Value <= $OverallMax) {
                foreach ($IndicatorSections as $Key => $Settings) {
                    if ($Value >= $Settings["Start"] && $Value <= $Settings["End"]) {
                        $X1 = $ValuesPos[$Value]; //$X + $Key*$SectionsMargin + ($Value - $OverallMin) * $XScale;

                        if ($ValueDisplay == INDICATOR_VALUE_BUBBLE) {
                            $TxtPos = $this->pChartObject->getTextBox(
                                $X1,
                                $Y,
                                $ValueFontName,
                                $ValueFontSize,
                                0,
                                $Value . $Unit
                            );
                            $Radius = floor(($TxtPos[1]["X"] - $TxtPos[0]["X"] + $TextPadding * 4) / 2);

                            $this->pChartObject->drawFilledCircle(
                                $X1,
                                $Y,
                                $Radius + 4,
                                [
                                    "R" => $Settings["R"] + 20,
                                    "G" => $Settings["G"] + 20,
                                    "B" => $Settings["B"] + 20
                                ]
                            );
                            $this->pChartObject->drawFilledCircle(
                                $X1,
                                $Y,
                                $Radius,
                                ["R" => 255, "G" => 255, "B" => 255]
                            );

                            $TextSettings = [
                                "Align" => TEXT_ALIGN_MIDDLEMIDDLE,
                                "FontName" => $ValueFontName,
                                "FontSize" => $ValueFontSize
                            ];
                            $this->pChartObject->drawText($X1 - 1, $Y - 1, $Value . $Unit, $TextSettings);
                        } elseif ($ValueDisplay == INDICATOR_VALUE_LABEL) {
                            $Caption = [
                                [
                                    "Format" => [
                                        "R" => $Settings["R"],
                                        "G" => $Settings["G"],
                                        "B" => $Settings["B"],
                                        "Alpha" => 100
                                    ],
                                    "Caption" => $Value . $Unit
                                ]
                            ];
                            $this->pChartObject->drawLabelBox(
                                floor($X1),
                                floor($Y) + 2,
                                "Value - " . $Settings["Caption"],
                                $Caption
                            );
                        }
                    }
                    $X1 = $X2 + $SectionsMargin;
                }
            }
        }
        $this->pChartObject->Shadow = $RestoreShadow;
    }
541465
public final void init(final int WIDTH, final int HEIGHT) {
        if (WIDTH <= 1 || HEIGHT <= 1) {
            return;
        }

        if (lcdImage != null) {
            lcdImage.flush();
        }
        lcdImage = create_LCD_Image(WIDTH, HEIGHT);

        if (glowImageOn != null) {
            glowImageOn.flush();
        }
        glowImageOn = GlowImageFactory.INSTANCE.createLcdGlow(WIDTH, HEIGHT, glowColor, true);

        final double CORNER_RADIUS = WIDTH > HEIGHT ? (HEIGHT * 0.095) : (WIDTH * 0.095);
        disabledShape = new RoundRectangle2D.Double(0, 0, WIDTH, HEIGHT, CORNER_RADIUS, CORNER_RADIUS);
        if (isDigitalFont()) {
            lcdValueFont = LCD_DIGITAL_FONT.deriveFont(0.5f * getInnerBounds().height);
            lcdFormerValueFont = LCD_DIGITAL_FONT.deriveFont(0.2f * getInnerBounds().height);
            if (useCustomLcdUnitFont) {
                lcdUnitFont = customLcdUnitFont.deriveFont(0.1875f * getInnerBounds().height);
            } else {
                lcdUnitFont = LCD_STANDARD_FONT.deriveFont(0.1875f * getInnerBounds().height);
            }
        } else {
            lcdValueFont = LCD_STANDARD_FONT.deriveFont(0.46875f * getInnerBounds().height);
            lcdFormerValueFont = LCD_STANDARD_FONT.deriveFont(0.1875f * getInnerBounds().height);
            if (useCustomLcdUnitFont) {
                lcdUnitFont = customLcdUnitFont.deriveFont(0.1875f * getInnerBounds().height);
            } else {
                lcdUnitFont = LCD_STANDARD_FONT.deriveFont(0.1875f * getInnerBounds().height);
            }
        }
        lcdInfoFont = LCD_STANDARD_FONT.deriveFont(0.15f * getInnerBounds().height);

        if (lcdThresholdImage != null) {
            lcdThresholdImage.flush();
        }
        lcdThresholdImage = create_LCD_THRESHOLD_Image((int) (HEIGHT * 0.2045454545), (int) (HEIGHT * 0.2045454545), lcdColor.TEXT_COLOR);
    }
1112879
function (x, y, width, height) {
            var points = this._glPoints;
            points[0].x = x;
            points[0].y = y;
            points[1].x = x + width;
            points[1].y = y;
            points[2].x = x + width;
            points[2].y = y + height;
            points[3].x = x;
            points[3].y = y + height;
            this.compositor.drawLine(points, 4);
        }
1205286
public void setDimension(int width, int height) {
        setWidth(String.valueOf(width));
        setHeight(String.valueOf(height));
        reload();
    }
502318
protected void drawBase (Graphics2D gfx, int x, int y)
    {
        gfx.fillRoundRect(
            x, y, _size.width - 1, _size.height - 1, _dia, _dia);
    }
776190
@Override
    public void drawText(Graphics2D graphics, int width, int height) {
        if(StringUtils.isBlank(text) || StringUtils.isBlank(domainName)) {
            return ;
        }
        
        int x = 0, y = 0; 
        int fontsize = ((int)(width * textWidthPercent)) / domainName.length();
        if (fontsize < minFontSize) {
            return;
        }
        
        float fsize = (float)fontsize;
        Font font = domainFont.deriveFont(fsize);
        graphics.setFont(font);
        FontRenderContext context = graphics.getFontRenderContext();
        int sw = (int) font.getStringBounds(domainName, context).getWidth();

        x = width - sw - fontsize;
        y = height - fontsize;
        if(x <= 0 || y <= 0) {
            return ;
        }

        if (fontShadowColor != null) {
            graphics.setColor(fontShadowColor);
            graphics.drawString(domainName, x + getShadowTranslation(fontsize), y + getShadowTranslation(fontsize));
        }
        graphics.setColor(fontColor);
        graphics.drawString(domainName, x, y);
        
        //draw company name
        fsize = (float)fontsize;
        font = defaultFont.deriveFont(fsize);
        graphics.setFont(font);
        context = graphics.getFontRenderContext();
        sw = (int) font.getStringBounds(text, context).getWidth();
        x = width - sw - fontsize;
        y = height - (int)(fontsize * 2.5);
        if(x <= 0 || y <= 0) {
            return ;
        }
        
        if (fontShadowColor != null) {
            graphics.setColor(fontShadowColor);
            graphics.drawString(text, x + getShadowTranslation(fontsize), y + getShadowTranslation(fontsize));
        }
        graphics.setColor(fontColor);
        graphics.drawString(text, x, y);
    }
27173
private BufferedImage create_LCD_Image(final int WIDTH, final int HEIGHT) {
        if (WIDTH <= 0 || HEIGHT <= 0) {
            return null;
        }

        final BufferedImage IMAGE = UTIL.createImage(WIDTH, HEIGHT, Transparency.TRANSLUCENT);
        final Graphics2D G2 = IMAGE.createGraphics();
        G2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        G2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_NORMALIZE);
        G2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
        final int IMAGE_WIDTH = IMAGE.getWidth();
        final int IMAGE_HEIGHT = IMAGE.getHeight();

        // Background rectangle
        final Point2D BACKGROUND_START = new Point2D.Double(0.0, 0.0);
        final Point2D BACKGROUND_STOP = new Point2D.Double(0.0, IMAGE_HEIGHT);
        if (BACKGROUND_START.equals(BACKGROUND_STOP)) {
            BACKGROUND_STOP.setLocation(0.0, BACKGROUND_START.getY() + 1);
        }

        final float[] BACKGROUND_FRACTIONS = {
            0.0f,
            0.08f,
            0.92f,
            1.0f
        };

        final Color[] BACKGROUND_COLORS = {
            new Color(0.4f, 0.4f, 0.4f, 1.0f),
            new Color(0.5f, 0.5f, 0.5f, 1.0f),
            new Color(0.5f, 0.5f, 0.5f, 1.0f),
            new Color(0.9f, 0.9f, 0.9f, 1.0f)
        };
        Util.INSTANCE.validateGradientPoints(BACKGROUND_START, BACKGROUND_STOP);
        final LinearGradientPaint BACKGROUND_GRADIENT = new LinearGradientPaint(BACKGROUND_START, BACKGROUND_STOP, BACKGROUND_FRACTIONS, BACKGROUND_COLORS);
        //final double BACKGROUND_CORNER_RADIUS = WIDTH * 0.09375;
        final double BACKGROUND_CORNER_RADIUS = WIDTH > HEIGHT ? (HEIGHT * 0.095) : (WIDTH * 0.095);
        final java.awt.geom.RoundRectangle2D BACKGROUND = new java.awt.geom.RoundRectangle2D.Double(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT, BACKGROUND_CORNER_RADIUS, BACKGROUND_CORNER_RADIUS);
        G2.setPaint(BACKGROUND_GRADIENT);
        G2.fill(BACKGROUND);

        // Foreground rectangle
        final Point2D FOREGROUND_START = new Point2D.Double(0.0, 1.0);
        final Point2D FOREGROUND_STOP = new Point2D.Double(0.0, IMAGE_HEIGHT - 1);
        if (FOREGROUND_START.equals(FOREGROUND_STOP)) {
            FOREGROUND_STOP.setLocation(0.0, FOREGROUND_START.getY() + 1);
        }

        final float[] FOREGROUND_FRACTIONS = {
            0.0f,
            0.03f,
            0.49f,
            0.5f,
            1.0f
        };

        final Color[] FOREGROUND_COLORS = {
            lcdColor.GRADIENT_START_COLOR,
            lcdColor.GRADIENT_FRACTION1_COLOR,
            lcdColor.GRADIENT_FRACTION2_COLOR,
            lcdColor.GRADIENT_FRACTION3_COLOR,
            lcdColor.GRADIENT_STOP_COLOR
        };

        if (lcdColor == LcdColor.CUSTOM) {
            G2.setPaint(customLcdBackground);
        } else {
            Util.INSTANCE.validateGradientPoints(FOREGROUND_START, FOREGROUND_STOP);
            final LinearGradientPaint FOREGROUND_GRADIENT = new LinearGradientPaint(FOREGROUND_START, FOREGROUND_STOP, FOREGROUND_FRACTIONS, FOREGROUND_COLORS);
            G2.setPaint(FOREGROUND_GRADIENT);
        }
        final double FOREGROUND_CORNER_RADIUS = BACKGROUND.getArcWidth() - 1;
        final java.awt.geom.RoundRectangle2D FOREGROUND = new java.awt.geom.RoundRectangle2D.Double(1, 1, IMAGE_WIDTH - 2, IMAGE_HEIGHT - 2, FOREGROUND_CORNER_RADIUS, FOREGROUND_CORNER_RADIUS);
        G2.fill(FOREGROUND);

        G2.dispose();

        return IMAGE;
    }
89967
function(width, height){
            this.map.setSize(width, height);
            var map = this.map;
            this.map.each(function(val, x, y){
                if(val === void 0){
                    map.set(x, y, []);
                }
            });
        }
966199
def draw_rectangle(x, y, width, height, attr = {})
            last_content_stream.draw_rectangle(x, y, width, height, attr); self
        end
1271569
function(width, height) {

    var _width = width;
    var _height = height;
    var _data = new Array(width * height);

    var _this = {};

    _this.setPixel = function(x, y, pixel) {
	_data[y * _width + x] = pixel;
    };

    _this.write = function(out) {

	//---------------------------------
	// GIF Signature

	out.writeString('GIF87a');

	//---------------------------------
	// Screen Descriptor

	out.writeShort(_width);
	out.writeShort(_height);

	out.writeByte(0x80); // 2bit
	out.writeByte(0);
	out.writeByte(0);

	//---------------------------------
	// Global Color Map

	// black
	out.writeByte(0x00);
	out.writeByte(0x00);
	out.writeByte(0x00);

	// white
	out.writeByte(0xff);
	out.writeByte(0xff);
	out.writeByte(0xff);

	//---------------------------------
	// Image Descriptor

	out.writeString(',');
	out.writeShort(0);
	out.writeShort(0);
	out.writeShort(_width);
	out.writeShort(_height);
	out.writeByte(0);

	//---------------------------------
	// Local Color Map

	//---------------------------------
	// Raster Data

	var lzwMinCodeSize = 2;
	var raster = getLZWRaster(lzwMinCodeSize);

	out.writeByte(lzwMinCodeSize);

	var offset = 0;

	while (raster.length - offset > 255) {
	    out.writeByte(255);
	    out.writeBytes(raster, offset, 255);
	    offset += 255;
	}

	out.writeByte(raster.length - offset);
	out.writeBytes(raster, offset, raster.length - offset);
	out.writeByte(0x00);

	//---------------------------------
	// GIF Terminator
	out.writeString(';');
    };

    var bitOutputStream = function(out) {

	var _out = out;
	var _bitLength = 0;
	var _bitBuffer = 0;

	var _this = {};

	_this.write = function(data, length) {

	    if ( (data >>> length) != 0) {
		throw new Error('length over');
	    }

	    while (_bitLength + length >= 8) {
		_out.writeByte(0xff & ( (data << _bitLength) | _bitBuffer) );
		length -= (8 - _bitLength);
		data >>>= (8 - _bitLength);
		_bitBuffer = 0;
		_bitLength = 0;
	    }

	    _bitBuffer = (data << _bitLength) | _bitBuffer;
	    _bitLength = _bitLength + length;
	};

	_this.flush = function() {
	    if (_bitLength > 0) {
		_out.writeByte(_bitBuffer);
	    }
	};

	return _this;
    };

    var getLZWRaster = function(lzwMinCodeSize) {

	var clearCode = 1 << lzwMinCodeSize;
	var endCode = (1 << lzwMinCodeSize) + 1;
	var bitLength = lzwMinCodeSize + 1;

	// Setup LZWTable
	var table = lzwTable();

	for (var i = 0; i < clearCode; i += 1) {
	    table.add(String.fromCharCode(i) );
	}
	table.add(String.fromCharCode(clearCode) );
	table.add(String.fromCharCode(endCode) );

	var byteOut = byteArrayOutputStream();
	var bitOut = bitOutputStream(byteOut);

	// clear code
	bitOut.write(clearCode, bitLength);

	var dataIndex = 0;

	var s = String.fromCharCode(_data[dataIndex]);
	dataIndex += 1;

	while (dataIndex < _data.length) {

	    var c = String.fromCharCode(_data[dataIndex]);
	    dataIndex += 1;

	    if (table.contains(s + c) ) {

		s = s + c;

	    } else {

		bitOut.write(table.indexOf(s), bitLength);

		if (table.size() < 0xfff) {

		    if (table.size() == (1 << bitLength) ) {
			bitLength += 1;
		    }

		    table.add(s + c);
		}

		s = c;
	    }
	}

	bitOut.write(table.indexOf(s), bitLength);

	// end code
	bitOut.write(endCode, bitLength);

	bitOut.flush();

	return byteOut.toByteArray();
    };

    var lzwTable = function() {

	var _map = {};
	var _size = 0;

	var _this = {};

	_this.add = function(key) {
	    if (_this.contains(key) ) {
		throw new Error('dup key:' + key);
	    }
	    _map[key] = _size;
	    _size += 1;
	};

	_this.size = function() {
	    return _size;
	};

	_this.indexOf = function(key) {
	    return _map[key];
	};

	_this.contains = function(key) {
	    return typeof _map[key] != 'undefined';
	};

	return _this;
    };

    return _this;
}