org.apache.fop.pdf

Class PDFDeviceColorSpace

Implemented Interfaces:
PDFColorSpace

public class PDFDeviceColorSpace
extends java.lang.Object
implements PDFColorSpace

Represents a device-specific color space. Used for mapping DeviceRGB, DeviceCMYK and DeviceGray.

Field Summary

static int
DEVICE_CMYK
CMYK colorspace
static int
DEVICE_GRAY
Gray colorspace
static int
DEVICE_RGB
RGB colorspace
static int
DEVICE_UNKNOWN
Unknown colorspace
protected int
currentColorSpace
Current color space value.

Constructor Summary

PDFDeviceColorSpace(int theColorSpace)
Create a PDF colorspace object.

Method Summary

int
getColorSpace()
Get the colorspace value
String
getName()
int
getNumComponents()
Get the number of color components for this colorspace
boolean
isCMYKColorSpace()
boolean
isDeviceColorSpace()
boolean
isGrayColorSpace()
boolean
isRGBColorSpace()
void
setColorSpace(int theColorSpace)
Set the current colorspace.

Field Details

DEVICE_CMYK

public static final int DEVICE_CMYK
CMYK colorspace
Field Value:
3

DEVICE_GRAY

public static final int DEVICE_GRAY
Gray colorspace
Field Value:
1

DEVICE_RGB

public static final int DEVICE_RGB
RGB colorspace
Field Value:
2

DEVICE_UNKNOWN

public static final int DEVICE_UNKNOWN
Unknown colorspace
Field Value:
-1

currentColorSpace

protected int currentColorSpace
Current color space value.

Constructor Details

PDFDeviceColorSpace

public PDFDeviceColorSpace(int theColorSpace)
Create a PDF colorspace object.
Parameters:
theColorSpace - the current colorspace

Method Details

getColorSpace

public int getColorSpace()
Get the colorspace value
Returns:
the colorspace value

getName

public String getName()
Specified by:
getName in interface PDFColorSpace
Returns:
the name of the color space

getNumComponents

public int getNumComponents()
Get the number of color components for this colorspace
Specified by:
getNumComponents in interface PDFColorSpace
Returns:
the number of components

isCMYKColorSpace

public boolean isCMYKColorSpace()
Specified by:
isCMYKColorSpace in interface PDFColorSpace

isDeviceColorSpace

public boolean isDeviceColorSpace()
Specified by:
isDeviceColorSpace in interface PDFColorSpace

isGrayColorSpace

public boolean isGrayColorSpace()
Specified by:
isGrayColorSpace in interface PDFColorSpace

isRGBColorSpace

public boolean isRGBColorSpace()
Specified by:
isRGBColorSpace in interface PDFColorSpace

setColorSpace

public void setColorSpace(int theColorSpace)
Set the current colorspace.
Parameters:
theColorSpace - the new color space value

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.