DynamicPDF by ceTe Software

com.cete.dynamicpdf
Class Grayscale

java.lang.Object
  extended by com.cete.dynamicpdf.Color
      extended by com.cete.dynamicpdf.DeviceColor
          extended by com.cete.dynamicpdf.Grayscale

public class Grayscale
extends DeviceColor

Class represents a grayscale color.

Licensing:
This class is a DynamicPDF Generator Community Edition feature.


Constructor Summary
Grayscale(byte grayLevel)
          Initializes a new instance of the Grayscale class.
Grayscale(float grayLevel)
          Initializes a new instance of the Grayscale class.
Grayscale(int grayLevel)
          Initializes a new instance of the Grayscale class.
 
Method Summary
 void drawFill(OperatorWriter writer)
          Draws the color data to the given OperatorWriter object.
 void drawStroke(OperatorWriter writer)
          Draws the color data to the given OperatorWriter object.
 boolean equals(java.lang.Object obj)
          Tests equality of colors.
static Grayscale getBlack()
          Gets the color black.
 ColorSpace getColorSpace()
          Gets the color space for the color.
 int getComponents()
          Gets the number of components for the device color.
static Grayscale getDarkGray()
          Gets the color dark gray.
static Grayscale getDimGray()
          Gets the color dim gray.
static Grayscale getGray()
          Gets the color gray.
 float getGrayLevel()
          Gets the gray value.
static Grayscale getLightGrey()
          Gets the color Light grey.
static Grayscale getSilver()
          Gets the color silver.
static Grayscale getWhite()
          Gets the color dim white.
 int hashCode()
          Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
 void toStringBuffer(java.lang.StringBuffer stringBuffer)
          Appends the color information to the given StringBuffer object.
 
Methods inherited from class com.cete.dynamicpdf.DeviceColor
drawFill, drawStroke
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Grayscale

public Grayscale(byte grayLevel)
Initializes a new instance of the Grayscale class.

Parameters:
grayLevel - The gray intensity.
See Also:
Grayscale

Grayscale

public Grayscale(int grayLevel)
Initializes a new instance of the Grayscale class.

Parameters:
grayLevel - The gray intensity.
See Also:
Grayscale

Grayscale

public Grayscale(float grayLevel)
Initializes a new instance of the Grayscale class.

Throws:
java.lang.IllegalArgumentException - Grayscale value must be from 0.0 to 1.0.
Parameters:
grayLevel - The gray intensity.
See Also:
Grayscale
Method Detail

getGrayLevel

public float getGrayLevel()
Gets the gray value.

Returns:
the gray value.

equals

public boolean equals(java.lang.Object obj)
Tests equality of colors.

Specified by:
equals in class Color
Parameters:
obj - Object to compare to the current Color.
Returns:
true if the two colors are equal.

hashCode

public int hashCode()
Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.

Specified by:
hashCode in class Color
Returns:
A hash code for the current Color.

toStringBuffer

public void toStringBuffer(java.lang.StringBuffer stringBuffer)
Appends the color information to the given StringBuffer object.

Specified by:
toStringBuffer in class DeviceColor
Parameters:
stringBuffer - to receive the color information.

drawStroke

public void drawStroke(OperatorWriter writer)
Draws the color data to the given OperatorWriter object.

Overrides:
drawStroke in class Color
Parameters:
writer - OperatorWriter object to receive the color data.
See Also:
OperatorWriter

drawFill

public void drawFill(OperatorWriter writer)
Draws the color data to the given OperatorWriter object.

Overrides:
drawFill in class Color
Parameters:
writer - OperatorWriter object to receive the color data.
See Also:
OperatorWriter

getComponents

public int getComponents()
Gets the number of components for the device color.

Specified by:
getComponents in class DeviceColor
Returns:
the number of components for the device color.

getColorSpace

public ColorSpace getColorSpace()
Gets the color space for the color.

Specified by:
getColorSpace in class Color
Returns:
the color space for the color.

getBlack

public static Grayscale getBlack()
Gets the color black.

Returns:
the color black.

getLightGrey

public static Grayscale getLightGrey()
Gets the color Light grey.

Returns:
the color Light grey.

getSilver

public static Grayscale getSilver()
Gets the color silver.

Returns:
the color silver.

getDarkGray

public static Grayscale getDarkGray()
Gets the color dark gray.

Returns:
the color dark gray.

getGray

public static Grayscale getGray()
Gets the color gray.

Returns:
the color gray.

getDimGray

public static Grayscale getDimGray()
Gets the color dim gray.

Returns:
the color dim gray.

getWhite

public static Grayscale getWhite()
Gets the color dim white.

Returns:
the color dim white.

DynamicPDF by ceTe Software

API Reference for DynamicPDF v10.04 for Java generated on September 25, 2019
© Copyright 2019, ceTe Software