Class AbstractPdfFunction<T>
The abstract PdfFunction class that represents the Function Dictionary or Stream PDF object.
public abstract class AbstractPdfFunction<T> : PdfObjectWrapper<T>, IPdfFunction where T : PdfDictionary
Type Parameters
T
Either a PdfDictionary or a PdfStream
- Inheritance
-
AbstractPdfFunction<T>
- Implements
- Derived
- Inherited Members
Remarks
The abstract PdfFunction class that represents the Function Dictionary or Stream PDF object. Holds common properties and methods and a factory method. (see ISO-320001 Chapter 7.10)
Constructors
AbstractPdfFunction(T)
Constructs a PdfFunction from an existing PdfObject.
protected AbstractPdfFunction(T pdfObject)
Parameters
pdfObject
TEither a PdfDictionary or a PdfStream
AbstractPdfFunction(T, int, double[], double[])
Constructs a PdfFunction from a new PdfObject.
protected AbstractPdfFunction(T pdfObject, int functionType, double[] domain, double[] range)
Parameters
pdfObject
TThe new, empty, object, created in a concrete implementation
functionType
intThe function type, can be 0, 2, 3 or 4
domain
double[]the valid input domain, input will be clipped to this domain contains a min max pair per input component
range
double[]the valid output range, oputput will be clipped to this range contains a min max pair per output component
Methods
Calculate(double[])
public abstract double[] Calculate(double[] arg1)
Parameters
arg1
double[]
Returns
- double[]
CalculateFromByteArray(byte[], int, int, int, int)
Performs the calculation in bulk on a set of raw data and returns a new set of raw data.
public virtual byte[] CalculateFromByteArray(byte[] bytes, int offset, int length, int wordSizeInputLength, int wordSizeOutputLength)
Parameters
bytes
byte[]The uninterpreted set of data to be transformed
offset
intWhere to start converting the data
length
intHow many of the input bytes should be converted
wordSizeInputLength
intHow many bytes represents one input value
wordSizeOutputLength
intHow many bytes represents one output value
Returns
- byte[]
the transformed result as a raw byte array
CalculateFromByteArray(byte[], int, int, int, int, IInputConversionFunction, IOutputConversionFunction)
Performs the calculation in bulk on a set of raw data and returns a new set of raw data.
public virtual byte[] CalculateFromByteArray(byte[] bytes, int offset, int length, int wordSizeInputLength, int wordSizeOutputLength, BaseInputOutPutConvertors.IInputConversionFunction inputConvertor, BaseInputOutPutConvertors.IOutputConversionFunction outputConvertor)
Parameters
bytes
byte[]The uninterpreted set of data to be transformed
offset
intWhere to start converting the data
length
intHow many of the input bytes should be converted
wordSizeInputLength
intHow many bytes represents one input value
wordSizeOutputLength
intHow many bytes represents one output value
inputConvertor
BaseInputOutPutConvertors.IInputConversionFunctiona custom input convertor
outputConvertor
BaseInputOutPutConvertors.IOutputConversionFunctiona custom output convertor
Returns
- byte[]
the transformed result as a raw byte array
CheckCompatibilityWithColorSpace(PdfColorSpace)
Chacks wether the output of the function matches in components with the passed by color space.
public virtual bool CheckCompatibilityWithColorSpace(PdfColorSpace alternateSpace)
Parameters
alternateSpace
PdfColorSpaceThe color space to verify against
Returns
- bool
True when compatible
Clip(double[], double[])
protected static double[] Clip(double[] values, double[] limits)
Parameters
Returns
- double[]
ClipInput(double[])
Clip input values to the allowed domain.
public virtual double[] ClipInput(double[] input)
Parameters
input
double[]the input values to be clipped
Returns
- double[]
the values clipped between the boundaries defined in the domain
Remarks
Clip input values to the allowed domain.
(see ISO-320001 Table 38)ClipOutput(double[])
Clip output values to the allowed range, if there is a range.
public virtual double[] ClipOutput(double[] input)
Parameters
input
double[]the output values to be clipped
Returns
- double[]
the values clipped between the boundaries defined in the range
Remarks
Clip output values to the allowed range, if there is a range.
(see ISO-320001 Table 38)ConvertFloatArrayToDoubleArray(float[])
protected static double[] ConvertFloatArrayToDoubleArray(float[] array)
Parameters
array
float[]
Returns
- double[]
GetAsPdfObject()
public virtual PdfObject GetAsPdfObject()
Returns
GetDomain()
The valid input domain, input will be clipped to this domain contains a min max pair per input component.
public virtual double[] GetDomain()
Returns
- double[]
the input domain
Remarks
The valid input domain, input will be clipped to this domain contains a min max pair per input component.
(see ISO-320001 Table 38)GetFunctionType()
The function type, (see ISO-320001 Table 38).
public virtual int GetFunctionType()
Returns
- int
The function type, either 0, 2, 3 or 4
GetInputSize()
The number of input components.
public virtual int GetInputSize()
Returns
- int
The number of input components
GetOutputSize()
The number of output components.
public virtual int GetOutputSize()
Returns
- int
The number of output components
GetRange()
the valid output range, output will be clipped to this range contains a min max pair per output component.
public virtual double[] GetRange()
Returns
- double[]
the output range
Remarks
the valid output range, output will be clipped to this range contains a min max pair per output component.
(see ISO-320001 Table 38)IsWrappedObjectMustBeIndirect()
protected override bool IsWrappedObjectMustBeIndirect()
Returns
Normalize(double[], double[])
protected static double[] Normalize(double[] values, double[] limits)
Parameters
Returns
- double[]
SetDomain(double[])
The valid input domain, input will be clipped to this domain contains a min max pair per input component.
public virtual void SetDomain(double[] value)
Parameters
value
double[]the new set of limits
Remarks
The valid input domain, input will be clipped to this domain contains a min max pair per input component.
(see ISO-320001 Table 38)SetRange(double[])
the valid output range, output will be clipped to this range contains a min max pair per output component.
public virtual void SetRange(double[] value)
Parameters
value
double[]the new set of limts
Remarks
the valid output range, output will be clipped to this range contains a min max pair per output component.
(see ISO-320001 Table 38)