Package org.apache.sanselan.common

Examples of org.apache.sanselan.common.BinaryFileParser.skipBytes()


        int numComponents = 0;
        InputStream is = new ByteArrayInputStream(segmentData);

        // Skip precision(1 Byte), height(2 Bytes), width(2 bytes) bytes.
        if (toBeProcessed > 6) {
          binaryParser.skipBytes(is, 5, INVALID_JPEG_ERROR_MSG);
          numComponents = binaryParser.readByte("Number_of_components", is,
              "Unable to read Number of components from SOF marker");
          toBeProcessed -= 6;
        } else {
          LOG.log(Level.WARNING, "Failed to SOF marker");
View Full Code Here


        // TODO(satya): Extend this library to gray scale images.
        if (numComponents == 3 && toBeProcessed == 9) {
          // Process 'Luma' Channel.
          // Skipping the component Id field.
          binaryParser.skipBytes(is, 1, INVALID_JPEG_ERROR_MSG);
          imageParams.setSamplingMode(binaryParser.readByte("Sampling Factors", is,
              "Unable to read the sampling factor from the 'Y' channel component spec"));
          imageParams.setLumaIndex(binaryParser.readByte("Quantization Table Index", is,
              "Unable to read Quantization table index of 'Y' channel"));
View Full Code Here

          imageParams.setLumaIndex(binaryParser.readByte("Quantization Table Index", is,
              "Unable to read Quantization table index of 'Y' channel"));

          // Process 'Chroma' Channel.
          // Skipping the component Id and sampling factor fields.
          binaryParser.skipBytes(is, 2, INVALID_JPEG_ERROR_MSG);
          imageParams.setChromaIndex(binaryParser.readByte("Quantization Table Index", is,
              "Unable to read Quantization table index of 'Cb' Channel"));
        } else {
          LOG.log(Level.WARNING, "Failed to Component Spec from SOF marker");
        }
View Full Code Here

        int numComponents = 0;
        InputStream is = new ByteArrayInputStream(segmentData);

        // Skip precision(1 Byte), height(2 Bytes), width(2 bytes) bytes.
        if (toBeProcessed > 6) {
          binaryParser.skipBytes(is, 5, INVALID_JPEG_ERROR_MSG);
          numComponents = binaryParser.readByte("Number_of_components", is,
              "Unable to read Number of components from SOF marker");
          toBeProcessed -= 6;
        } else {
          LOG.log(Level.WARNING, "Failed to SOF marker");
View Full Code Here

        // TODO(satya): Extend this library to gray scale images.
        if (numComponents == 3 && toBeProcessed == 9) {
          // Process 'Luma' Channel.
          // Skipping the component Id field.
          binaryParser.skipBytes(is, 1, INVALID_JPEG_ERROR_MSG);
          imageParams.setSamplingMode(binaryParser.readByte("Sampling Factors", is,
              "Unable to read the sampling factor from the 'Y' channel component spec"));
          imageParams.setLumaIndex(binaryParser.readByte("Quantization Table Index", is,
              "Unable to read Quantization table index of 'Y' channel"));
View Full Code Here

          imageParams.setLumaIndex(binaryParser.readByte("Quantization Table Index", is,
              "Unable to read Quantization table index of 'Y' channel"));

          // Process 'Chroma' Channel.
          // Skipping the component Id and sampling factor fields.
          binaryParser.skipBytes(is, 2, INVALID_JPEG_ERROR_MSG);
          imageParams.setChromaIndex(binaryParser.readByte("Quantization Table Index", is,
              "Unable to read Quantization table index of 'Cb' Channel"));
        } else {
          LOG.log(Level.WARNING, "Failed to Component Spec from SOF marker");
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.