3 package com.pixelmed.codec.jpeg;
12 private static final String identString =
"@(#) $Header: /userland/cvs/codec/com/pixelmed/codec/jpeg/MarkerSegmentSOF.java,v 1.4 2015/10/17 21:20:52 dclunie Exp $";
15 private int SamplePrecision;
17 private int nSamplesPerLine;
18 private int nComponentsInFrame;
19 private int[] ComponentIdentifier;
20 private int[] HorizontalSamplingFactor;
21 private int[] VerticalSamplingFactor;
22 private int[] QuantizationTableDestinationSelector;
42 int lengthExpected = 6+nComponentsInFrame*3;
43 if (length != lengthExpected) {
44 throw new Exception(
"Incorrect length of SOF Parameters Marker Segment, expected "+lengthExpected+
" (based on nComponentsInFrame "+nComponentsInFrame+
") but was "+length);
47 ComponentIdentifier =
new int[nComponentsInFrame];
48 HorizontalSamplingFactor =
new int[nComponentsInFrame];
49 VerticalSamplingFactor =
new int[nComponentsInFrame];
50 QuantizationTableDestinationSelector=
new int[nComponentsInFrame];
52 for (
int i=0; i<nComponentsInFrame; ++i) {
61 StringBuffer buf =
new StringBuffer();
63 buf.append(
"\t\t SamplePrecision = " +SamplePrecision+
"\n");
64 buf.append(
"\t\t nLines = " +nLines+
"\n");
65 buf.append(
"\t\t nSamplesPerLine = " +nSamplesPerLine+
"\n");
66 buf.append(
"\t\t nComponentsInFrame = " +nComponentsInFrame+
"\n");
67 for (
int i=0; i<nComponentsInFrame; ++i) {
68 buf.append(
"\t\t component " +i+
"\n");
69 buf.append(
"\t\t\t ComponentIdentifier = " +ComponentIdentifier[i]+
"\n");
70 buf.append(
"\t\t\t HorizontalSamplingFactor = " +HorizontalSamplingFactor[i]+
"\n");
71 buf.append(
"\t\t\t VerticalSamplingFactor = " +VerticalSamplingFactor[i]+
"\n");
72 buf.append(
"\t\t\t QuantizationTableDestinationSelector = " +QuantizationTableDestinationSelector[i]+
"\n");
74 return buf.toString();