View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.commons.imaging.formats.bmp;
18  
19  final class BmpHeaderInfo {
20      static class ColorSpace {
21          ColorSpaceCoordinate red;
22          ColorSpaceCoordinate green;
23          ColorSpaceCoordinate blue;
24      }
25  
26      static class ColorSpaceCoordinate {
27          int x;
28          int y;
29          int z;
30      }
31  
32      // BM - Windows 3.1x, 95, NT
33      // BA - OS/2 Bitmap Array
34      // CI - OS/2 Color Icon
35      // CP - OS/2 Color Pointer
36      // IC - OS/2 Icon
37      // PT - OS/2 Pointer
38      public final byte identifier1;
39      public final byte identifier2;
40      public final int fileSize;
41  
42      public final int reserved;
43      public final int bitmapDataOffset;
44      public final int bitmapHeaderSize;
45      public final int width;
46      public final int height;
47      public final int planes;
48      public final int bitsPerPixel;
49      public final int compression;
50      public final int bitmapDataSize;
51      public final int hResolution;
52      public final int vResolution;
53  
54      public final int colorsUsed;
55      public final int colorsImportant;
56      public final int redMask;
57      public final int greenMask;
58  
59      public final int blueMask;
60      public final int alphaMask;
61      public final int colorSpaceType;
62      public final ColorSpace colorSpace;
63      public final int gammaRed;
64      public final int gammaGreen;
65      public final int gammaBlue;
66      public final int intent;
67      public final int profileData;
68  
69      public final int profileSize;
70  
71      public final int reservedV5;
72  
73      BmpHeaderInfo(final byte identifier1, final byte identifier2, final int fileSize, final int reserved, final int bitmapDataOffset,
74              final int bitmapHeaderSize, final int width, final int height, final int planes, final int bitsPerPixel, final int compression,
75              final int bitmapDataSize, final int hResolution, final int vResolution, final int colorsUsed, final int colorsImportant, final int redMask,
76              final int greenMask, final int blueMask, final int alphaMask, final int colorSpaceType, final ColorSpace colorSpace, final int gammaRed,
77              final int gammaGreen, final int gammaBlue, final int intent, final int profileData, final int profileSize, final int reservedV5) {
78          this.identifier1 = identifier1;
79          this.identifier2 = identifier2;
80          this.fileSize = fileSize;
81          this.reserved = reserved;
82          this.bitmapDataOffset = bitmapDataOffset;
83  
84          this.bitmapHeaderSize = bitmapHeaderSize;
85          this.width = width;
86          this.height = height;
87          this.planes = planes;
88          this.bitsPerPixel = bitsPerPixel;
89          this.compression = compression;
90          this.bitmapDataSize = bitmapDataSize;
91          this.hResolution = hResolution;
92          this.vResolution = vResolution;
93          this.colorsUsed = colorsUsed;
94          this.colorsImportant = colorsImportant;
95  
96          this.redMask = redMask;
97          this.greenMask = greenMask;
98          this.blueMask = blueMask;
99          this.alphaMask = alphaMask;
100         this.colorSpaceType = colorSpaceType;
101         this.colorSpace = colorSpace;
102         this.gammaRed = gammaRed;
103         this.gammaGreen = gammaGreen;
104         this.gammaBlue = gammaBlue;
105         this.intent = intent;
106         this.profileData = profileData;
107         this.profileSize = profileSize;
108         this.reservedV5 = reservedV5;
109     }
110 
111 }