org.jpedal.color.ColorMapping Maven / Gradle / Ivy
/*
* ===========================================
* Java Pdf Extraction Decoding Access Library
* ===========================================
*
* Project Info: http://www.idrsolutions.com
* Help section for developers at http://www.idrsolutions.com/support/
*
* (C) Copyright 1997-2017 IDRsolutions and Contributors.
*
* This file is part of JPedal/JPDF2HTML5
*
@LICENSE@
*
* ---------------
* ColorMapping.java
* ---------------
*/
package org.jpedal.color;
import java.io.Serializable;
import org.jpedal.function.FunctionFactory;
import org.jpedal.function.PDFFunction;
import org.jpedal.io.PdfObjectReader;
import org.jpedal.objects.raw.PdfObject;
/**
* convert to actual RGB colour for Separation/DeviceN using a function
*/
public class ColorMapping implements Serializable {
private static final long serialVersionUID = 2732809266903967232L;
private final PDFFunction function;
public ColorMapping(final PdfObjectReader currentPdfFile, final PdfObject functionObj) {
function = FunctionFactory.getFunction(functionObj, currentPdfFile);
}
/**
* Do the actual conversion
*
* @param values
* @return
*/
public float[] getOperandFloat(final float[] values) {
return function.compute(values);
}
}