Beispiel #1
0
 /**
  * This will set a color in the color lookup table.
  *
  * @param componentNumber The component number, probably 1,2,3,3.
  * @param lookupIndex The zero-based index into the table, should not exceed the high value.
  * @param color The color that will go into the table.
  * @throws IOException If there is an error looking up the color.
  */
 public void setLookupColor(int componentNumber, int lookupIndex, int color) throws IOException {
   PDColorSpace baseColor = getBaseColorSpace();
   int numberOfComponents = baseColor.getNumberOfComponents();
   byte[] data = getLookupData();
   data[componentNumber * numberOfComponents + lookupIndex] = (byte) color;
   COSString string = new COSString(data);
   array.set(3, string);
 }
Beispiel #2
0
 /**
  * This will set the a range for this color space.
  *
  * @param range The new range for the a component.
  * @param n The component to set the range for.
  */
 public void setRangeForComponent(PDRange range, int n) {
   COSArray rangeArray = getRangeArray(n);
   rangeArray.set(n * 2, new COSFloat(range.getMin()));
   rangeArray.set(n * 2 + 1, new COSFloat(range.getMax()));
 }
Beispiel #3
0
 /**
  * This will set the highest value that is allowed. This cannot be higher than 255.
  *
  * @param high The highest value for the lookup table.
  */
 public void setHighValue(int high) {
   array.set(2, new COSInteger(high));
 }
Beispiel #4
0
 /**
  * This will set the base color space.
  *
  * @param base The base color space to use as the index.
  */
 public void setBaseColorSpace(PDColorSpace base) {
   array.set(1, base.getCOSObject());
 }