com.lowagie.text.pdf

## Class PdfShading

- java.lang.Object
- - com.lowagie.text.pdf.PdfShading

-     public class PdfShading
      extends java.lang.Object

  Implements the shading dictionary (or stream).
  Author:
    Paulo Soares (psoares@consiste.pt)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `antiAlias` Holds value of property antiAlias.
    `protected float[]` | `bBox` Holds value of property bBox.
    `protected ColorDetails` | `colorDetails`
    `private java.awt.Color` | `cspace`
    `protected PdfDictionary` | `shading`
    `protected PdfName` | `shadingName`
    `protected PdfIndirectReference` | `shadingReference`
    `protected int` | `shadingType`
    `protected PdfWriter` | `writer`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `PdfShading(PdfWriter writer)` Creates new PdfShading

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) void` | `addToBody()`
    `static void` | `checkCompatibleColors(java.awt.Color c1, java.awt.Color c2)`
    `float[]` | `getBBox()`
    `static float[]` | `getColorArray(java.awt.Color color)`
    `(package private) ColorDetails` | `getColorDetails()`
    `java.awt.Color` | `getColorSpace()`
    `(package private) PdfName` | `getShadingName()`
    `(package private) PdfIndirectReference` | `getShadingReference()`
    `(package private) PdfWriter` | `getWriter()`
    `boolean` | `isAntiAlias()`
    `void` | `setAntiAlias(boolean antiAlias)`
    `void` | `setBBox(float[] bBox)`
    `protected void` | `setColorSpace(java.awt.Color color)`
    `(package private) void` | `setName(int number)`
    `static PdfShading` | `simpleAxial(PdfWriter writer, float x0, float y0, float x1, float y1, java.awt.Color startColor, java.awt.Color endColor)`
    `static PdfShading` | `simpleAxial(PdfWriter writer, float x0, float y0, float x1, float y1, java.awt.Color startColor, java.awt.Color endColor, boolean extendStart, boolean extendEnd)`
    `static PdfShading` | `simpleRadial(PdfWriter writer, float x0, float y0, float r0, float x1, float y1, float r1, java.awt.Color startColor, java.awt.Color endColor)`
    `static PdfShading` | `simpleRadial(PdfWriter writer, float x0, float y0, float r0, float x1, float y1, float r1, java.awt.Color startColor, java.awt.Color endColor, boolean extendStart, boolean extendEnd)`
    `static void` | `throwColorSpaceError()`
    `static PdfShading` | `type1(PdfWriter writer, java.awt.Color colorSpace, float[] domain, float[] tMatrix, PdfFunction function)`
    `static PdfShading` | `type2(PdfWriter writer, java.awt.Color colorSpace, float[] coords, float[] domain, PdfFunction function, boolean[] extend)`
    `static PdfShading` | `type3(PdfWriter writer, java.awt.Color colorSpace, float[] coords, float[] domain, PdfFunction function, boolean[] extend)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### shading

          protected PdfDictionary shading

    - #### writer

          protected PdfWriter writer

    - #### shadingType

          protected int shadingType

    - #### colorDetails

          protected ColorDetails colorDetails

    - #### shadingName

          protected PdfName shadingName

    - #### shadingReference

          protected PdfIndirectReference shadingReference

    - #### cspace

          private java.awt.Color cspace

    - #### bBox

          protected float[] bBox

      Holds value of property bBox.

    - #### antiAlias

          protected boolean antiAlias

      Holds value of property antiAlias.

  - ### Constructor Detail

    - #### PdfShading

          protected PdfShading(PdfWriter writer)

      Creates new PdfShading

  - ### Method Detail

    - #### setColorSpace

          protected void setColorSpace(java.awt.Color color)

    - #### getColorSpace

          public java.awt.Color getColorSpace()

    - #### throwColorSpaceError

          public static void throwColorSpaceError()

    - #### checkCompatibleColors

          public static void checkCompatibleColors(java.awt.Color c1,
                                   java.awt.Color c2)

    - #### getColorArray

          public static float[] getColorArray(java.awt.Color color)

    - #### type1

          public static PdfShading type1(PdfWriter writer,
                         java.awt.Color colorSpace,
                         float[] domain,
                         float[] tMatrix,
                         PdfFunction function)

    - #### type2

          public static PdfShading type2(PdfWriter writer,
                         java.awt.Color colorSpace,
                         float[] coords,
                         float[] domain,
                         PdfFunction function,
                         boolean[] extend)

    - #### type3

          public static PdfShading type3(PdfWriter writer,
                         java.awt.Color colorSpace,
                         float[] coords,
                         float[] domain,
                         PdfFunction function,
                         boolean[] extend)

    - #### simpleAxial

          public static PdfShading simpleAxial(PdfWriter writer,
                               float x0,
                               float y0,
                               float x1,
                               float y1,
                               java.awt.Color startColor,
                               java.awt.Color endColor,
                               boolean extendStart,
                               boolean extendEnd)

    - #### simpleAxial

          public static PdfShading simpleAxial(PdfWriter writer,
                               float x0,
                               float y0,
                               float x1,
                               float y1,
                               java.awt.Color startColor,
                               java.awt.Color endColor)

    - #### simpleRadial

          public static PdfShading simpleRadial(PdfWriter writer,
                                float x0,
                                float y0,
                                float r0,
                                float x1,
                                float y1,
                                float r1,
                                java.awt.Color startColor,
                                java.awt.Color endColor,
                                boolean extendStart,
                                boolean extendEnd)

    - #### simpleRadial

          public static PdfShading simpleRadial(PdfWriter writer,
                                float x0,
                                float y0,
                                float r0,
                                float x1,
                                float y1,
                                float r1,
                                java.awt.Color startColor,
                                java.awt.Color endColor)

    - #### getShadingName

          PdfName getShadingName()

    - #### getShadingReference

          PdfIndirectReference getShadingReference()

    - #### setName

          void setName(int number)

    - #### addToBody

          void addToBody()
                   throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### getWriter

          PdfWriter getWriter()

    - #### getColorDetails

          ColorDetails getColorDetails()

    - #### getBBox

          public float[] getBBox()

    - #### setBBox

          public void setBBox(float[] bBox)

    - #### isAntiAlias

          public boolean isAntiAlias()

    - #### setAntiAlias

          public void setAntiAlias(boolean antiAlias)