Debian Codegraph @

src/com/drew/imaging/png/PngChromaticities.java

raw symbols SCIP
1 /*
2 * Copyright 2002-2019 Drew Noakes and contributors
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 * More information about this project is available at:
17 *
18 * https://drewnoakes.com/code/exif/
19 * https://github.com/drewnoakes/metadata-extractor
20 */
21 package com.drew.imaging.png;
22
23 import com.drew.lang.SequentialByteArrayReader;
24 import com.drew.lang.annotations.NotNull;
25
26 import java.io.IOException;
27
28 /**
29 * @author Drew Noakes https://drewnoakes.com
30 */
31 public class PngChromaticities
32 {
33 private final int _whitePointX;
34 private final int _whitePointY;
35 private final int _redX;
36 private final int _redY;
37 private final int _greenX;
38 private final int _greenY;
39 private final int _blueX;
40 private final int _blueY;
41
42 public PngChromaticities(@NotNull byte[] bytes) throws PngProcessingException
43 {
44 if (bytes.length != 8 * 4) {
45 throw new PngProcessingException("Invalid number of bytes");
46 }
47
48 SequentialByteArrayReader reader = new SequentialByteArrayReader(bytes);
49 try {
50 _whitePointX = reader.getInt32();
51 _whitePointY = reader.getInt32();
52 _redX = reader.getInt32();
53 _redY = reader.getInt32();
54 _greenX = reader.getInt32();
55 _greenY = reader.getInt32();
56 _blueX = reader.getInt32();
57 _blueY = reader.getInt32();
58 } catch (IOException ex) {
59 throw new PngProcessingException(ex);
60 }
61 }
62
63 public int getWhitePointX()
64 {
65 return _whitePointX;
66 }
67
68 public int getWhitePointY()
69 {
70 return _whitePointY;
71 }
72
73 public int getRedX()
74 {
75 return _redX;
76 }
77
78 public int getRedY()
79 {
80 return _redY;
81 }
82
83 public int getGreenX()
84 {
85 return _greenX;
86 }
87
88 public int getGreenY()
89 {
90 return _greenY;
91 }
92
93 public int getBlueX()
94 {
95 return _blueX;
96 }
97
98 public int getBlueY()
99 {
100 return _blueY;
101 }
102 }