| 1 |
package com.drew.metadata.heif.boxes; |
| 2 |
|
| 3 |
import com.drew.lang.ByteArrayReader; |
| 4 |
import com.drew.lang.SequentialReader; |
| 5 |
import com.drew.metadata.Metadata; |
| 6 |
import com.drew.metadata.heif.HeifDirectory; |
| 7 |
import com.drew.metadata.icc.IccReader; |
| 8 |
|
| 9 |
import java.io.IOException; |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
public class ColourInformationBox extends Box |
| 15 |
{ |
| 16 |
String colourType; |
| 17 |
int colourPrimaries; |
| 18 |
int transferCharacteristics; |
| 19 |
int matrixCoefficients; |
| 20 |
int fullRangeFlag; |
| 21 |
|
| 22 |
public ColourInformationBox(SequentialReader reader, Box box, Metadata metadata) throws IOException |
| 23 |
{ |
| 24 |
super(box); |
| 25 |
|
| 26 |
colourType = reader.getString(4); |
| 27 |
if (colourType.equals("nclx")) { |
| 28 |
colourPrimaries = reader.getUInt16(); |
| 29 |
transferCharacteristics = reader.getUInt16(); |
| 30 |
matrixCoefficients = reader.getUInt16(); |
| 31 |
|
| 32 |
fullRangeFlag = (reader.getUInt8() & 0x80) >> 7; |
| 33 |
} else if (colourType.equals("rICC")) { |
| 34 |
byte[] buffer = reader.getBytes((int)(size - 12)); |
| 35 |
new IccReader().extract(new ByteArrayReader(buffer), metadata); |
| 36 |
} else if (colourType.equals("prof")) { |
| 37 |
byte[] buffer = reader.getBytes((int)(size - 12)); |
| 38 |
new IccReader().extract(new ByteArrayReader(buffer), metadata); |
| 39 |
} |
| 40 |
} |
| 41 |
|
| 42 |
public void addMetadata(HeifDirectory directory) |
| 43 |
{ |
| 44 |
|
| 45 |
} |
| 46 |
} |