Example usage for com.itextpdf.text.pdf CMYKColor getCyan

List of usage examples for com.itextpdf.text.pdf CMYKColor getCyan

Introduction

In this page you can find the example usage for com.itextpdf.text.pdf CMYKColor getCyan.

Prototype

public float getCyan() 

Source Link

Usage

From source file:org.scantegrity.common.InvisibleInkFactory.java

License:Open Source License

private static void fillRect(BufferedImage p_img, CMYKColor p_color, int p_x, int p_y, int p_width,
        int p_height) {
    /*if (p_x + p_width > p_img.getWidth() 
    || p_y + p_height > p_img.getHeight())
    {//from w  w w .  j  a  va2 s .  com
       System.err.println("Array index out of bounds on fillrect!");
       return;
    }*/

    float[] l_c = { p_color.getCyan(), p_color.getMagenta(), p_color.getYellow(), p_color.getBlack() };
    float[] l_dbuf = ((DataBufferFloat) p_img.getRaster().getDataBuffer()).getData();
    int l_doff = 0;
    for (int y = 0; y < p_height; y++) {
        //            ROW                   X offset
        l_doff = ((y + p_y) * p_img.getWidth() + p_x) * 4;
        for (int x = 0; x < p_width; x++) {
            System.arraycopy(l_c, 0, l_dbuf, l_doff, 4);
            l_doff += 4;
        }
    }
}