public static PdfShading simpleRadial(PdfWriter writer, float x0, float y0, float r0, float x1, float y1, float r1, Color startColor, Color endColor, boolean extendStart, boolean extendEnd) { checkCompatibleColors(startColor, endColor); PdfFunction function = PdfFunction.type2(writer, new float[]{0, 1}, null, getColorArray(startColor), getColorArray(endColor), 1); return type3(writer, startColor, new float[]{x0, y0, r0, x1, y1, r1}, null, function, new boolean[]{extendStart, extendEnd}); }
public static PdfShading simpleRadial(PdfWriter writer, float x0, float y0, float r0, float x1, float y1, float r1, Color startColor, Color endColor, boolean extendStart, boolean extendEnd) { checkCompatibleColors(startColor, endColor); PdfFunction function = PdfFunction.type2(writer, new float[]{0, 1}, null, getColorArray(startColor), getColorArray(endColor), 1); return type3(writer, startColor, new float[]{x0, y0, r0, x1, y1, r1}, null, function, new boolean[]{extendStart, extendEnd}); }
public static PdfShading simpleAxial(PdfWriter writer, float x0, float y0, float x1, float y1, Color startColor, Color endColor, boolean extendStart, boolean extendEnd) { checkCompatibleColors(startColor, endColor); PdfFunction function = PdfFunction.type2(writer, new float[]{0, 1}, null, getColorArray(startColor), getColorArray(endColor), 1); return type2(writer, startColor, new float[]{x0, y0, x1, y1}, null, function, new boolean[]{extendStart, extendEnd}); }
public static PdfShading simpleAxial(PdfWriter writer, float x0, float y0, float x1, float y1, Color startColor, Color endColor, boolean extendStart, boolean extendEnd) { checkCompatibleColors(startColor, endColor); PdfFunction function = PdfFunction.type2(writer, new float[]{0, 1}, null, getColorArray(startColor), getColorArray(endColor), 1); return type2(writer, startColor, new float[]{x0, y0, x1, y1}, null, function, new boolean[]{extendStart, extendEnd}); }
public static PdfShading simpleRadial(PdfWriter writer, float x0, float y0, float r0, float x1, float y1, float r1, Color startColor, Color endColor, boolean extendStart, boolean extendEnd) { checkCompatibleColors(startColor, endColor); PdfFunction function = PdfFunction.type2(writer, new float[]{0, 1}, null, getColorArray(startColor), getColorArray(endColor), 1); return type3(writer, startColor, new float[]{x0, y0, r0, x1, y1, r1}, null, function, new boolean[]{extendStart, extendEnd}); }
public static PdfShading simpleAxial(PdfWriter writer, float x0, float y0, float x1, float y1, Color startColor, Color endColor, boolean extendStart, boolean extendEnd) { checkCompatibleColors(startColor, endColor); PdfFunction function = PdfFunction.type2(writer, new float[]{0, 1}, null, getColorArray(startColor), getColorArray(endColor), 1); return type2(writer, startColor, new float[]{x0, y0, x1, y1}, null, function, new boolean[]{extendStart, extendEnd}); }
protected PdfObject getSpotObject(PdfWriter writer) { PdfArray array = new PdfArray(PdfName.SEPARATION); array.add(name); PdfFunction func = null; if (altcs instanceof ExtendedColor) { int type = ((ExtendedColor)altcs).type; switch (type) { case ExtendedColor.TYPE_GRAY: array.add(PdfName.DEVICEGRAY); func = PdfFunction.type2(writer, new float[]{0, 1}, null, new float[]{0}, new float[]{((GrayColor)altcs).getGray()}, 1); break; case ExtendedColor.TYPE_CMYK: array.add(PdfName.DEVICECMYK); CMYKColor cmyk = (CMYKColor)altcs; func = PdfFunction.type2(writer, new float[]{0, 1}, null, new float[]{0, 0, 0, 0}, new float[]{cmyk.getCyan(), cmyk.getMagenta(), cmyk.getYellow(), cmyk.getBlack()}, 1); break; default: throw new RuntimeException("Only RGB, Gray and CMYK are supported as alternative color spaces."); } } else { array.add(PdfName.DEVICERGB); func = PdfFunction.type2(writer, new float[]{0, 1}, null, new float[]{1, 1, 1}, new float[]{(float)altcs.getRed() / 255, (float)altcs.getGreen() / 255, (float)altcs.getBlue() / 255}, 1); } array.add(func.getReference()); return array; } }
protected PdfObject getSpotObject(PdfWriter writer) { PdfArray array = new PdfArray(PdfName.SEPARATION); array.add(name); PdfFunction func = null; if (altcs instanceof ExtendedColor) { int type = ((ExtendedColor)altcs).type; switch (type) { case ExtendedColor.TYPE_GRAY: array.add(PdfName.DEVICEGRAY); func = PdfFunction.type2(writer, new float[]{0, 1}, null, new float[]{0}, new float[]{((GrayColor)altcs).getGray()}, 1); break; case ExtendedColor.TYPE_CMYK: array.add(PdfName.DEVICECMYK); CMYKColor cmyk = (CMYKColor)altcs; func = PdfFunction.type2(writer, new float[]{0, 1}, null, new float[]{0, 0, 0, 0}, new float[]{cmyk.getCyan(), cmyk.getMagenta(), cmyk.getYellow(), cmyk.getBlack()}, 1); break; default: throw new RuntimeException(MessageLocalization.getComposedMessage("only.rgb.gray.and.cmyk.are.supported.as.alternative.color.spaces")); } } else { array.add(PdfName.DEVICERGB); func = PdfFunction.type2(writer, new float[]{0, 1}, null, new float[]{1, 1, 1}, new float[]{(float)altcs.getRed() / 255, (float)altcs.getGreen() / 255, (float)altcs.getBlue() / 255}, 1); } array.add(func.getReference()); return array; } }
protected PdfObject getSpotObject(PdfWriter writer) { PdfArray array = new PdfArray(PdfName.SEPARATION); array.add(name); PdfFunction func = null; if (altcs instanceof ExtendedColor) { int type = ((ExtendedColor)altcs).type; switch (type) { case ExtendedColor.TYPE_GRAY: array.add(PdfName.DEVICEGRAY); func = PdfFunction.type2(writer, new float[]{0, 1}, null, new float[]{0}, new float[]{((GrayColor)altcs).getGray()}, 1); break; case ExtendedColor.TYPE_CMYK: array.add(PdfName.DEVICECMYK); CMYKColor cmyk = (CMYKColor)altcs; func = PdfFunction.type2(writer, new float[]{0, 1}, null, new float[]{0, 0, 0, 0}, new float[]{cmyk.getCyan(), cmyk.getMagenta(), cmyk.getYellow(), cmyk.getBlack()}, 1); break; default: throw new RuntimeException(MessageLocalization.getComposedMessage("only.rgb.gray.and.cmyk.are.supported.as.alternative.color.spaces")); } } else { array.add(PdfName.DEVICERGB); func = PdfFunction.type2(writer, new float[]{0, 1}, null, new float[]{1, 1, 1}, new float[]{(float)altcs.getRed() / 255, (float)altcs.getGreen() / 255, (float)altcs.getBlue() / 255}, 1); } array.add(func.getReference()); return array; } }