T
- Either a PdfDictionary
or a PdfStream
public abstract class AbstractPdfFunction<T extends PdfDictionary> extends PdfObjectWrapper<T> implements IPdfFunction
Modifier | Constructor and Description |
---|---|
protected |
AbstractPdfFunction(T pdfObject)
Constructs a PdfFunction from an existing PdfObject.
|
protected |
AbstractPdfFunction(T pdfObject,
int functionType,
double[] domain,
double[] range)
Constructs a PdfFunction from a new PdfObject.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
calculateFromByteArray(byte[] bytes,
int offset,
int length,
int wordSizeInputLength,
int wordSizeOutputLength)
Performs the calculation in bulk on a set of raw data and returns a new set of raw data.
|
byte[] |
calculateFromByteArray(byte[] bytes,
int offset,
int length,
int wordSizeInputLength,
int wordSizeOutputLength,
BaseInputOutPutConvertors.IInputConversionFunction inputConvertor,
BaseInputOutPutConvertors.IOutputConversionFunction outputConvertor)
Performs the calculation in bulk on a set of raw data and returns a new set of raw data.
|
boolean |
checkCompatibilityWithColorSpace(PdfColorSpace alternateSpace)
Chacks wether the output of the function matches in components with the passed by color space.
|
protected static double[] |
clip(double[] values,
double[] limits) |
double[] |
clipInput(double[] input)
Clip input values to the allowed domain.
|
double[] |
clipOutput(double[] input)
Clip output values to the allowed range, if there is a range.
|
protected static double[] |
convertFloatArrayToDoubleArray(float[] array) |
PdfObject |
getAsPdfObject() |
double[] |
getDomain()
The valid input domain, input will be clipped to this domain contains a min max pair per input component.
|
int |
getFunctionType()
The function type, (see ISO-320001 Table 38).
|
int |
getInputSize()
The number of input components.
|
int |
getOutputSize()
The number of output components.
|
double[] |
getRange()
the valid output range, output will be clipped to this range contains a min max pair per output component.
|
protected boolean |
isWrappedObjectMustBeIndirect()
Defines if the object behind this wrapper must be an indirect object in the
resultant document.
|
protected static double[] |
normalize(double[] values,
double[] limits) |
void |
setDomain(double[] value)
The valid input domain, input will be clipped to this domain contains a min max pair per input component.
|
void |
setRange(double[] value)
the valid output range, output will be clipped to this range contains a min max pair per output component.
|
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, flush, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
calculate
protected AbstractPdfFunction(T pdfObject, int functionType, double[] domain, double[] range)
pdfObject
- The new, empty, object, created in a concrete implementationfunctionType
- The function type, can be 0, 2, 3 or 4domain
- the valid input domain, input will be clipped to this domain
contains a min max pair per input componentrange
- the valid output range, oputput will be clipped to this range
contains a min max pair per output componentprotected AbstractPdfFunction(T pdfObject)
pdfObject
- Either a PdfDictionary
or a PdfStream
public int getFunctionType()
getFunctionType
in interface IPdfFunction
public boolean checkCompatibilityWithColorSpace(PdfColorSpace alternateSpace)
checkCompatibilityWithColorSpace
in interface IPdfFunction
alternateSpace
- The color space to verify againstpublic int getInputSize()
getInputSize
in interface IPdfFunction
public int getOutputSize()
getOutputSize
in interface IPdfFunction
public double[] getDomain()
(see ISO-320001 Table 38)
getDomain
in interface IPdfFunction
public void setDomain(double[] value)
(see ISO-320001 Table 38)
setDomain
in interface IPdfFunction
value
- the new set of limitspublic double[] getRange()
(see ISO-320001 Table 38)
getRange
in interface IPdfFunction
public void setRange(double[] value)
(see ISO-320001 Table 38)
setRange
in interface IPdfFunction
value
- the new set of limtspublic byte[] calculateFromByteArray(byte[] bytes, int offset, int length, int wordSizeInputLength, int wordSizeOutputLength) throws IOException
calculateFromByteArray
in interface IPdfFunction
bytes
- The uninterpreted set of data to be transformedoffset
- Where to start converting the datalength
- How many of the input bytes should be convertedwordSizeInputLength
- How many bytes represents one input valuewordSizeOutputLength
- How many bytes represents one output valueIOException
- on data reading errorspublic byte[] calculateFromByteArray(byte[] bytes, int offset, int length, int wordSizeInputLength, int wordSizeOutputLength, BaseInputOutPutConvertors.IInputConversionFunction inputConvertor, BaseInputOutPutConvertors.IOutputConversionFunction outputConvertor) throws IOException
calculateFromByteArray
in interface IPdfFunction
bytes
- The uninterpreted set of data to be transformedoffset
- Where to start converting the datalength
- How many of the input bytes should be convertedwordSizeInputLength
- How many bytes represents one input valuewordSizeOutputLength
- How many bytes represents one output valueinputConvertor
- a custom input convertoroutputConvertor
- a custom output convertorIOException
- on data reading errorspublic double[] clipInput(double[] input)
(see ISO-320001 Table 38)
clipInput
in interface IPdfFunction
input
- the input values to be clippedpublic double[] clipOutput(double[] input)
(see ISO-320001 Table 38)
clipOutput
in interface IPdfFunction
input
- the output values to be clippedpublic PdfObject getAsPdfObject()
getAsPdfObject
in interface IPdfFunction
protected boolean isWrappedObjectMustBeIndirect()
PdfObjectWrapper
isWrappedObjectMustBeIndirect
in class PdfObjectWrapper<T extends PdfDictionary>
protected static double[] clip(double[] values, double[] limits)
protected static double[] normalize(double[] values, double[] limits)
protected static double[] convertFloatArrayToDoubleArray(float[] array)
Copyright © 1998–2023 Apryse Group NV. All rights reserved.