Method from org.apache.pdfbox.pdmodel.graphics.color.PDLab Detail: |
public ColorModel createColorModel(int bpc) throws IOException {
throw new IOException( "Not implemented" );
}
Create a Java color model for this colorspace. |
protected ColorSpace createColorSpace() throws IOException {
throw new IOException( "Not implemented" );
}
Create a Java colorspace for this colorspace. |
public PDRange getARange() {
COSArray range = getRangeArray();
return new PDRange( range, 0 );
}
This will get the valid range for the a component. If none is found
then the default will be returned, which is -100 to 100. |
public PDRange getBRange() {
COSArray range = getRangeArray();
return new PDRange( range, 1 );
}
This will get the valid range for the b component. If none is found
then the default will be returned, which is -100 to 100. |
public PDTristimulus getBlackPoint() {
COSArray bp = (COSArray)dictionary.getDictionaryObject( COSName.getPDFName( "BlackPoint" ) );
if( bp == null )
{
bp = new COSArray();
bp.add( new COSFloat( 0.0f ) );
bp.add( new COSFloat( 0.0f ) );
bp.add( new COSFloat( 0.0f ) );
dictionary.setItem( COSName.getPDFName( "BlackPoint" ), bp );
}
return new PDTristimulus( bp );
}
This will return the BlackPoint tristimulus. This is an optional field but
has defaults so this will never return null.
A default of 0,0,0 will be returned if the pdf does not have any values yet. |
public COSBase getCOSObject() {
return array;
}
Convert this standard java object to a COS object. |
public String getName() {
return NAME;
}
This will return the name of the color space. |
public int getNumberOfComponents() throws IOException {
//BJL
//hmm is this correct, I am not 100% sure.
return 3;
}
This will get the number of components that this color space is made up of. |
public PDTristimulus getWhitepoint() {
COSArray wp = (COSArray)dictionary.getDictionaryObject( COSName.getPDFName( "WhitePoint" ) );
if( wp == null )
{
wp = new COSArray();
wp.add( new COSFloat( 1.0f ) );
wp.add( new COSFloat( 1.0f ) );
wp.add( new COSFloat( 1.0f ) );
dictionary.setItem( COSName.getPDFName( "WhitePoint" ), wp );
}
return new PDTristimulus( wp );
}
This will return the whitepoint tristimulus. As this is a required field
this will never return null. A default of 1,1,1 will be returned if the
pdf does not have any values yet. |
public void setARange(PDRange range) {
COSArray rangeArray = null;
//if null then reset to defaults
if( range == null )
{
rangeArray = getRangeArray();
rangeArray.set( 0, new COSFloat( -100 ) );
rangeArray.set( 1, new COSFloat( 100 ) );
}
else
{
rangeArray = range.getCOSArray();
}
dictionary.setItem( COSName.getPDFName( "Range" ), rangeArray );
}
This will set the a range for this color space. |
public void setBRange(PDRange range) {
COSArray rangeArray = null;
//if null then reset to defaults
if( range == null )
{
rangeArray = getRangeArray();
rangeArray.set( 2, new COSFloat( -100 ) );
rangeArray.set( 3, new COSFloat( 100 ) );
}
else
{
rangeArray = range.getCOSArray();
}
dictionary.setItem( COSName.getPDFName( "Range" ), rangeArray );
}
This will set the b range for this color space. |
public void setBlackPoint(PDTristimulus bp) {
COSBase bpArray = null;
if( bp != null )
{
bpArray = bp.getCOSObject();
}
dictionary.setItem( COSName.getPDFName( "BlackPoint" ), bpArray );
}
This will set the BlackPoint tristimulus. As this is a required field
this null should not be passed into this function. |
public void setWhitepoint(PDTristimulus wp) {
COSBase wpArray = wp.getCOSObject();
if( wpArray != null )
{
dictionary.setItem( COSName.getPDFName( "WhitePoint" ), wpArray );
}
}
This will set the whitepoint tristimulus. As this is a required field
this null should not be passed into this function. |