KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > imageio > plugins > jpeg > JPEGImageMetadataFormatResources


1 /*
2  * @(#)JPEGImageMetadataFormatResources.java 1.9 05/08/23
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.imageio.plugins.jpeg;
9
10 import java.util.ListResourceBundle JavaDoc;
11
12 public class JPEGImageMetadataFormatResources
13        extends JPEGMetadataFormatResources {
14
15     static final Object JavaDoc[][] imageContents = {
16         // Node name, followed by description
17
{ "JPEGvariety", "A node grouping all marker segments specific to the variety of stream being read/written (e.g. JFIF) - may be empty" },
18         { "markerSequence", "A node grouping all non-jfif marker segments" },
19         { "app0jfif", "A JFIF APP0 marker segment" },
20         { "app14Adobe", "An Adobe APP14 marker segment" },
21         { "sof", "A Start Of Frame marker segment" },
22         { "sos", "A Start Of Scan marker segment" },
23         { "app0JFXX", "A JFIF extension marker segment" },
24         { "app2ICC", "An ICC profile APP2 marker segment" },
25         { "JFIFthumbJPEG",
26           "A JFIF thumbnail in JPEG format (no JFIF segments permitted)" },
27         { "JFIFthumbPalette", "A JFIF thumbnail as an RGB indexed image" },
28         { "JFIFthumbRGB", "A JFIF thumbnail as an RGB image" },
29         { "componentSpec", "A component specification for a frame" },
30         { "scanComponentSpec", "A component specification for a scan" },
31
32         // Node name + "/" + AttributeName, followed by description
33
{ "app0JFIF/majorVersion",
34           "The major JFIF version number" },
35         { "app0JFIF/minorVersion",
36           "The minor JFIF version number" },
37         { "app0JFIF/resUnits",
38           "The resolution units for Xdensity and Ydensity "
39           + "(0 = no units, just aspect ratio; 1 = dots/inch; 2 = dots/cm)" },
40         { "app0JFIF/Xdensity",
41           "The horizontal density or aspect ratio numerator" },
42         { "app0JFIF/Ydensity",
43           "The vertical density or aspect ratio denominator" },
44         { "app0JFIF/thumbWidth",
45           "The width of the thumbnail, or 0 if there isn't one" },
46         { "app0JFIF/thumbHeight",
47           "The height of the thumbnail, or 0 if there isn't one" },
48         { "app0JFXX/extensionCode",
49           "The JFXX extension code identifying thumbnail type: "
50           + "(16 = JPEG, 17 = indexed, 19 = RGB" },
51         { "JFIFthumbPalette/thumbWidth",
52           "The width of the thumbnail" },
53         { "JFIFthumbPalette/thumbHeight",
54           "The height of the thumbnail" },
55         { "JFIFthumbRGB/thumbWidth",
56           "The width of the thumbnail" },
57         { "JFIFthumbRGB/thumbHeight",
58           "The height of the thumbnail" },
59         { "app14Adobe/version",
60           "The version of Adobe APP14 marker segment" },
61         { "app14Adobe/flags0",
62           "The flags0 variable of an APP14 marker segment" },
63         { "app14Adobe/flags1",
64           "The flags1 variable of an APP14 marker segment" },
65         { "app14Adobe/transform",
66           "The color transform applied to the image "
67           + "(0 = Unknown, 1 = YCbCr, 2 = YCCK)" },
68         { "sof/process",
69           "The JPEG process (0 = Baseline sequential, "
70           + "1 = Extended sequential, 2 = Progressive)" },
71         { "sof/samplePrecision",
72           "The number of bits per sample" },
73         { "sof/numLines",
74           "The number of lines in the image" },
75         { "sof/samplesPerLine",
76           "The number of samples per line" },
77         { "sof/numFrameComponents",
78           "The number of components in the image" },
79         { "componentSpec/componentId",
80           "The id for this component" },
81         { "componentSpec/HsamplingFactor",
82           "The horizontal sampling factor for this component" },
83         { "componentSpec/VsamplingFactor",
84           "The vertical sampling factor for this component" },
85         { "componentSpec/QtableSelector",
86           "The quantization table to use for this component" },
87         { "sos/numScanComponents",
88           "The number of components in the scan" },
89         { "sos/startSpectralSelection",
90           "The first spectral band included in this scan" },
91         { "sos/endSpectralSelection",
92           "The last spectral band included in this scan" },
93         { "sos/approxHigh",
94           "The highest bit position included in this scan" },
95         { "sos/approxLow",
96           "The lowest bit position included in this scan" },
97         { "scanComponentSpec/componentSelector",
98           "The id of this component" },
99         { "scanComponentSpec/dcHuffTable",
100           "The huffman table to use for encoding DC coefficients" },
101         { "scanComponentSpec/acHuffTable",
102           "The huffman table to use for encoding AC coefficients" }
103     };
104
105     public JPEGImageMetadataFormatResources() {}
106
107     protected Object JavaDoc[][] getContents() {
108         // return a copy of the combined commonContents and imageContents;
109
// in theory we want a deep clone of the combined arrays,
110
// but since it only contains (immutable) Strings, this shallow
111
// copy is sufficient
112
Object JavaDoc[][] combinedContents =
113             new Object JavaDoc[commonContents.length + imageContents.length][2];
114         int combined = 0;
115         for (int i = 0; i < commonContents.length; i++, combined++) {
116             combinedContents[combined][0] = commonContents[i][0];
117             combinedContents[combined][1] = commonContents[i][1];
118         }
119         for (int i = 0; i < imageContents.length; i++, combined++) {
120             combinedContents[combined][0] = imageContents[i][0];
121             combinedContents[combined][1] = imageContents[i][1];
122         }
123         return combinedContents;
124     }
125 }
126
Popular Tags