src/share/classes/com/sun/imageio/plugins/jpeg/SOSMarkerSegment.java

Print this page
rev 9230 : imported patch 8033716


  73         componentSpecs = new ScanComponentSpec[numComponents];
  74         for (int i = 0; i < numComponents; i++) {
  75             componentSpecs[i] = new ScanComponentSpec(buffer);
  76         }
  77         startSpectralSelection = buffer.buf[buffer.bufPtr++];
  78         endSpectralSelection = buffer.buf[buffer.bufPtr++];
  79         approxHigh = buffer.buf[buffer.bufPtr] >> 4;
  80         approxLow = buffer.buf[buffer.bufPtr++] &0xf;
  81         buffer.bufAvail -= length;
  82     }
  83 
  84     SOSMarkerSegment(Node node) throws IIOInvalidTreeException {
  85         super(JPEG.SOS);
  86         startSpectralSelection = 0;
  87         endSpectralSelection = 63;
  88         approxHigh = 0;
  89         approxLow = 0;
  90         updateFromNativeNode(node, true);
  91     }
  92 
  93     protected Object clone () {
  94         SOSMarkerSegment newGuy = (SOSMarkerSegment) super.clone();
  95         if (componentSpecs != null) {
  96             newGuy.componentSpecs = componentSpecs.clone();
  97             for (int i = 0; i < componentSpecs.length; i++) {
  98                 newGuy.componentSpecs[i] =
  99                     (ScanComponentSpec) componentSpecs[i].clone();
 100             }
 101         }
 102         return newGuy;
 103     }
 104 
 105     IIOMetadataNode getNativeNode() {
 106         IIOMetadataNode node = new IIOMetadataNode("sos");
 107         node.setAttribute("numScanComponents",
 108                           Integer.toString(componentSpecs.length));
 109         node.setAttribute("startSpectralSelection",
 110                           Integer.toString(startSpectralSelection));
 111         node.setAttribute("endSpectralSelection",
 112                           Integer.toString(endSpectralSelection));
 113         node.setAttribute("approxHigh",




  73         componentSpecs = new ScanComponentSpec[numComponents];
  74         for (int i = 0; i < numComponents; i++) {
  75             componentSpecs[i] = new ScanComponentSpec(buffer);
  76         }
  77         startSpectralSelection = buffer.buf[buffer.bufPtr++];
  78         endSpectralSelection = buffer.buf[buffer.bufPtr++];
  79         approxHigh = buffer.buf[buffer.bufPtr] >> 4;
  80         approxLow = buffer.buf[buffer.bufPtr++] &0xf;
  81         buffer.bufAvail -= length;
  82     }
  83 
  84     SOSMarkerSegment(Node node) throws IIOInvalidTreeException {
  85         super(JPEG.SOS);
  86         startSpectralSelection = 0;
  87         endSpectralSelection = 63;
  88         approxHigh = 0;
  89         approxLow = 0;
  90         updateFromNativeNode(node, true);
  91     }
  92 
  93     protected SOSMarkerSegment clone () {
  94         SOSMarkerSegment newGuy = (SOSMarkerSegment) super.clone();
  95         if (componentSpecs != null) {
  96             newGuy.componentSpecs = componentSpecs.clone();
  97             for (int i = 0; i < componentSpecs.length; i++) {
  98                 newGuy.componentSpecs[i] =
  99                     (ScanComponentSpec) componentSpecs[i].clone();
 100             }
 101         }
 102         return newGuy;
 103     }
 104 
 105     IIOMetadataNode getNativeNode() {
 106         IIOMetadataNode node = new IIOMetadataNode("sos");
 107         node.setAttribute("numScanComponents",
 108                           Integer.toString(componentSpecs.length));
 109         node.setAttribute("startSpectralSelection",
 110                           Integer.toString(startSpectralSelection));
 111         node.setAttribute("endSpectralSelection",
 112                           Integer.toString(endSpectralSelection));
 113         node.setAttribute("approxHigh",