Class PDFNet.ColorSpace
PDFNet.ColorSpace
Constructor Attributes | Constructor Name and Description |
---|---|
This abstract class is used to serve as a color space tag to identify the specific
color space of a Color object.
|
Method Attributes | Method Name and Description |
---|---|
assign(right)
Copy Constructor
|
|
convert2CMYK(in_color)
A convenience function used to convert color points from the current
color space to DeviceCMYK color space.
|
|
convert2Gray(in_color)
A convenience function used to convert color points from the current
color space to DeviceGray color space.
|
|
convert2RGB(in_color)
A convenience function used to convert color points from the current
color space to DeviceRGB color space.
|
|
<static> |
PDFNet.ColorSpace.create(color_space)
Create a ColorSpace from the given SDF/Cos object listed under ColorSpaces entry
in page Resource dictionary.
|
<static> |
PDFNet.ColorSpace.createDeviceCMYK()
Create a new DeviceCMYK ColorSpace object
|
<static> |
PDFNet.ColorSpace.createDeviceGray()
Create a new DeviceGray ColorSpace object
|
<static> |
PDFNet.ColorSpace.createDeviceRGB()
Create a new DeviceRGB ColorSpace object
|
<static> |
PDFNet.ColorSpace.createICCFromBuffer(doc, buf)
[Documentation Not Yet Added]
|
<static> |
PDFNet.ColorSpace.createICCFromFilter(doc, filter)
[Documentation Not Yet Added]
|
<static> |
PDFNet.ColorSpace.createPattern()
Create a new Pattern ColorSpace object
|
destroy()
Frees the native memory of the object.
|
|
getBaseColor(color_idx)
Get the base color given a component value (index) in Indexed color space.
|
|
<static> |
PDFNet.ColorSpace.getComponentNumFromObj(cs_type, cs_obj)
|
getType()
|
|
<static> |
PDFNet.ColorSpace.getTypeFromObj(cs_obj)
|
Set color to the initial value used for this color space.
|
|
initComponentRanges(num_comps)
[Documentation Not Yet Added]
|
|
isAll()
|
|
isNone()
|
Class Detail
PDFNet.ColorSpace(id)
This abstract class is used to serve as a color space tag to identify the specific
color space of a Color object. It contains methods that transform colors in a specific
color space to/from several color space such as DeviceRGB and DeviceCMYK.
For purposes of the methods in this class, colors are represented as arrays of color
components represented as doubles in a normalized range defined by each ColorSpace.
For many ColorSpaces (e.g. DeviceRGB), this range is 0.0 to 1.0. However, some ColorSpaces
have components whose values have a different range. Methods are provided to inquire per
component minimum and maximum normalized values.
- Parameters:
- id
Method Detail
assign(right)
Copy Constructor
- Parameters:
- {ColorSpace} right
- (generated documentation)
convert2CMYK(in_color)
A convenience function used to convert color points from the current
color space to DeviceCMYK color space.
- Parameters:
- {colorpt} in_color
- input color point in the current color space
convert2Gray(in_color)
A convenience function used to convert color points from the current
color space to DeviceGray color space.
- Parameters:
- {colorpt} in_color
- input color point in the current color space
convert2RGB(in_color)
A convenience function used to convert color points from the current
color space to DeviceRGB color space.
- Parameters:
- {colorpt} in_color
- input color point in the current color space
<static>
{ColorSpace}
PDFNet.ColorSpace.create(color_space)
Create a ColorSpace from the given SDF/Cos object listed under ColorSpaces entry
in page Resource dictionary. If color_space dictionary is null, a non valid ColorSpace
object is created.
- Parameters:
- {Obj} color_space
- The Cos/SDF object to initialze the ColorSpace object with.
- Returns:
- {ColorSpace} A promise that resolves to an object of type: "ColorSpace" (generated documentation)
<static>
{ColorSpace}
PDFNet.ColorSpace.createDeviceCMYK()
Create a new DeviceCMYK ColorSpace object
- Returns:
- {ColorSpace} A promise that resolves to an object of type: "ColorSpace" (generated documentation)
<static>
{ColorSpace}
PDFNet.ColorSpace.createDeviceGray()
Create a new DeviceGray ColorSpace object
- Returns:
- {ColorSpace} A promise that resolves to an object of type: "ColorSpace" (generated documentation)
<static>
{ColorSpace}
PDFNet.ColorSpace.createDeviceRGB()
Create a new DeviceRGB ColorSpace object
- Returns:
- {ColorSpace} A promise that resolves to an object of type: "ColorSpace" (generated documentation)
<static>
{ColorSpace}
PDFNet.ColorSpace.createICCFromBuffer(doc, buf)
[Documentation Not Yet Added]
- Parameters:
- {SDFDoc} doc
- (generated documentation)
- {Array} buf
- (generated documentation)
- Returns:
- {ColorSpace} A promise that resolves to an object of type: "ColorSpace" (generated documentation)
<static>
{ColorSpace}
PDFNet.ColorSpace.createICCFromFilter(doc, filter)
[Documentation Not Yet Added]
- Parameters:
- {SDFDoc} doc
- (generated documentation)
- {Filter} filter
- (generated documentation)
- Returns:
- {ColorSpace} A promise that resolves to an object of type: "ColorSpace" (generated documentation)
<static>
{ColorSpace}
PDFNet.ColorSpace.createPattern()
Create a new Pattern ColorSpace object
- Returns:
- {ColorSpace} A promise that resolves to an object of type: "ColorSpace" (generated documentation)
destroy()
Frees the native memory of the object.
{ColorSpace}
getAlternateColorSpace()
- Returns:
- {ColorSpace} A promise that resolves to the alternate color space if it is available or NULL otherwise. Color spaces that include alternate color space are e_separation, e_device_n, and e_icc.
getBaseColor(color_idx)
Get the base color given a component value (index) in Indexed color space.
- Parameters:
- {number} color_idx
- color value represented in the index color space
{ColorSpace}
getBaseColorSpace()
- Returns:
- {ColorSpace} A promise that resolves to the base color space if this is an e_indexed or e_pattern with associated base color space; NULL otherwise.
{number}
getComponentNum()
- Returns:
- {number} A promise that resolves to the number of colorants (tint components) used to represent color point in this color space
<static>
{number}
PDFNet.ColorSpace.getComponentNumFromObj(cs_type, cs_obj)
- Parameters:
- {number [Y]} cs_type
- {Obj} cs_obj
- Cos/SDF color space object.
- Returns:
- {number} A promise that resolves to the number of components (tint components) used to represent color point for this color space
{number}
getHighVal()
- Returns:
- {number} A promise that resolves to the highest index for the color lookup table for Indexed color space. Since the color table is indexed from zero to highval, the actual number of entries is highval + 1. For color spaces other than indexed the method returns 0.
{number}
getLookupTable()
- Returns:
- {number} A promise that resolves to the color lookup table for Indexed color space. for color spaces other than indexed the method returns NULL.
{Obj}
getSDFObj()
- Returns:
- {Obj} A promise that resolves to the underlying SDF/Cos object
{Function}
getTintFunction()
- Returns:
- {Function} A promise that resolves to the function that transforms tint values into color component values in the alternate color space.
{number}
getType()
Return value enum:PDFNet.ColorSpace.Type = { e_device_gray : 0 e_device_rgb : 1 e_device_cmyk : 2 e_cal_gray : 3 e_cal_rgb : 4 e_lab : 5 e_icc : 6 e_indexed : 7 e_pattern : 8 e_separation : 9 e_device_n : 10 e_null : 11 }
- Returns:
- {number} A promise that resolves to the type of this color space
<static>
{number}
PDFNet.ColorSpace.getTypeFromObj(cs_obj)
Return value enum:PDFNet.ColorSpace.Type = { e_device_gray : 0 e_device_rgb : 1 e_device_cmyk : 2 e_cal_gray : 3 e_cal_rgb : 4 e_lab : 5 e_icc : 6 e_indexed : 7 e_pattern : 8 e_separation : 9 e_device_n : 10 e_null : 11 }
- Parameters:
- {Obj} cs_obj
- Cos/SDF color space object.
- Returns:
- {number} A promise that resolves to the Type of a given SDF/Cos color space, or e_null for if SDF object is not a valid color space
initColor()
Set color to the initial value used for this color space.
The initial value depends on the color space (see 4.5.7 in PDF Ref. Manual).
initComponentRanges(num_comps)
[Documentation Not Yet Added]
- Parameters:
- {number} num_comps
- (generated documentation)
{boolean}
isAll()
- Returns:
- {boolean} A promise that resolves to true if Separation color space contains the colorant All.
{boolean}
isNone()
- Returns:
- {boolean} A promise that resolves to true if Separation or DeviceN color space contains None colorants. For DeviceN the function returns true only if component colorant names are all None.