* </li></p>
*/
@Override
protected void parse(PDFObject obj) throws IOException {
// read the Functions array (required)
PDFObject functionsObj = obj.getDictRef("Functions");
if (functionsObj == null) {
throw new PDFParseException("Functions required for function type 3!");
}
PDFObject[] functionsAry = functionsObj.getArray();
functions = new PDFFunction[functionsAry.length];
for (int i = 0; i < functionsAry.length; i++) {
functions[i] = PDFFunction.getFunction(functionsAry[i]);
}
// read the Bounds array (required)
PDFObject boundsObj = obj.getDictRef("Bounds");
if (boundsObj == null) {
throw new PDFParseException("Bounds required for function type 3!");
}
PDFObject[] boundsAry = boundsObj.getArray();
bounds = new float[boundsAry.length + 2];
if (bounds.length - 2 != functions.length - 1) {
throw new PDFParseException("Bounds array must be of length " + (functions.length - 1));
}
for (int i = 0; i < boundsAry.length; i++) {
bounds[i+1] = boundsAry[i].getFloatValue();
}
bounds[0] = getDomain(0);
bounds[bounds.length-1] = getDomain(1);
// read the encode array (required)
PDFObject encodeObj = obj.getDictRef("Encode");
if (encodeObj == null) {
throw new PDFParseException("Encode required for function type 3!");
}
PDFObject[] encodeAry = encodeObj.getArray();
encode = new float[encodeAry.length];
if (encode.length != 2*functions.length) {
throw new PDFParseException("Encode array must be of length " + 2*functions.length);
}
for (int i = 0; i < encodeAry.length; i++) {