private int readPartitionSize(long l) throws IOException { frame.seek(l); int size =frame.readUnsignedByte() + (frame.readUnsignedByte() << 8) + (frame.readUnsignedByte() << 16); return size; } private int readSubBlockMode(BoolDecoder bc, int A, int L) throws IOException {
value |= data.readUnsignedByte() << (-count);
private void initBoolDecoder() throws IOException { value = 0; /* value = first 16 input bits */ data.seek(offset); value = data.readUnsignedByte() << 8; // value = (data[offset]) << 8; offset++; range = 255; /* initial range is full */ bit_count = 0; /* have not yet shifted out any bits */ }
private int parseEncoding(final ImageInputStream pInput, int tagByteCount) throws IOException { return tagByteCount == 3 && (pInput.readUnsignedByte() << 16 | pInput.readUnsignedByte() << 8 | pInput.readUnsignedByte()) == ENCODING_UTF_8 ? ENCODING_UTF_8 : ENCODING_UNKNOWN; }
segmentQuants = new SegmentQuants(); int c; frame.seek(offset++); c=frame.readUnsignedByte(); frameType = getBitAsInt(c, 0); if(frameType!=0) firstPartitionLengthInBytes += getBitAsInt(c, 6) << 1; firstPartitionLengthInBytes += getBitAsInt(c, 7) << 2; frame.seek(offset++); c=frame.readUnsignedByte(); firstPartitionLengthInBytes += c << 3; frame.seek(offset++); c=frame.readUnsignedByte(); firstPartitionLengthInBytes += c << 11; frame.seek(offset++); c=frame.readUnsignedByte(); frame.seek(offset++); c=frame.readUnsignedByte(); frame.seek(offset++); c=frame.readUnsignedByte(); frame.seek(offset++); c=frame.readUnsignedByte(); int hBytes = c; frame.seek(offset++); c=frame.readUnsignedByte(); hBytes += c << 8; width = (hBytes & 0x3fff); frame.seek(offset++); c=frame.readUnsignedByte(); int vBytes = c; frame.seek(offset++); c=frame.readUnsignedByte(); vBytes += c << 8; height = (vBytes & 0x3fff);
@Override public int getThumbnailHeight(final int imageIndex, final int thumbnailIndex) throws IOException { getThumbnailWidth(imageIndex, thumbnailIndex); // Laziness... return imageInput.readUnsignedByte(); }
input = this.input.readUnsignedByte(); if (input == 0xFF) { marker = this.input.readUnsignedByte(); if (marker != 0) { markerIndex = 9; input = this.input.readUnsignedByte(); marker = this.input.readUnsignedByte(); if (marker != 0) { markerIndex = 9;
input = this.input.readUnsignedByte(); marker = this.input.readUnsignedByte(); if (marker != 0) { markerIndex = 9; input = this.input.readUnsignedByte(); marker = this.input.readUnsignedByte(); if (marker != 0) { markerIndex = 9;
public PSDLayerBlendMode(final ImageInputStream pInput) throws IOException { int blendModeSig = pInput.readInt(); if (blendModeSig != PSD.RESOURCE_TYPE) { throw new IIOException("Illegal PSD Blend Mode signature, expected 8BIM: " + PSDUtil.intToStr(blendModeSig)); } blendMode = pInput.readInt(); opacity = pInput.readUnsignedByte(); clipping = pInput.readUnsignedByte(); flags = pInput.readByte(); pInput.readByte(); // Pad }
int imageIdLength = imageInput.readUnsignedByte(); header.colorMapType = imageInput.readUnsignedByte(); // 1: palette, 0: no palette, other: Unspecified... (< 127 reserved, 128-256: free for devs) header.imageType = imageInput.readUnsignedByte(); // 0: no image data, 1: Colormap, 2: Truecolor, 3: Monochrome, 9: Colormap + RLE, 10: Truecolor + RLE, 11: Monochrome + RLE, other: Unspecified. header.colorMapDepth = imageInput.readUnsignedByte(); // 15, 16, 24 or 32! header.height = imageInput.readUnsignedShort(); header.pixelDepth = imageInput.readUnsignedByte(); int imageDescriptor = imageInput.readUnsignedByte(); header.attributeBits = imageDescriptor & 0xf; // Bit 0-3: number of "attribute bits" per pixel header.origin = (imageDescriptor & 0x30) >> 4; // Bit 4-6: origin 0: lower left, 2: upper left
if (marker == 0xFF && (0xFF00 | stream.readUnsignedByte()) == JPEG.EOI) { if (marker == 0xFF && (0xFF00 | stream.readUnsignedByte()) == JPEG.SOI) { long nextSOIOffset = stream.getStreamPosition() - 2; imageInput.seek(nextSOIOffset);
static JPEGSegment readSegment(final ImageInputStream stream, final Map<Integer, List<String>> segmentIdentifiers) throws IOException { int marker = stream.readUnsignedByte(); marker = stream.readUnsignedByte(); marker = 0xff00 | stream.readUnsignedByte(); marker = 0xff00 | stream.readUnsignedByte();
PSDGlobalLayerMask(final ImageInputStream pInput, final long globalLayerMaskLength) throws IOException { colorSpace = pInput.readUnsignedShort(); // Undocumented pInput.readFully(colors, 0, colors.length); opacity = pInput.readUnsignedShort(); // 0-100 // Kind: 0: Selected (ie inverted), 1: Color protected, 128: Use value stored per layer (actually, the value is 80, not 0x80) kind = pInput.readUnsignedByte(); // Skip "Variable: Filler zeros" pInput.skipBytes(globalLayerMaskLength - 17); }
@Override protected void readData(final ImageInputStream pInput) throws IOException { version = pInput.readUnsignedShort(); cropMasks = pInput.readBoolean(); field = pInput.readUnsignedByte(); // TODO: Is this really pad? bleedWidth = pInput.readUnsignedInt(); bleedScale = pInput.readUnsignedShort(); pInput.skipBytes(size - 10); }
@Override public int getThumbnailWidth(final int imageIndex, final int thumbnailIndex) throws IOException { checkBounds(imageIndex); Validate.isTrue(thumbnailIndex >= 0 && thumbnailIndex < getNumThumbnails(imageIndex), "thumbnailIndex >= numThumbnails"); imageInput.seek(extensions.getThumbnailOffset()); return imageInput.readUnsignedByte(); }
header.version = imageInput.readUnsignedByte(); header.compression = imageInput.readUnsignedByte(); header.bitsPerPixel = imageInput.readUnsignedByte(); imageInput.readUnsignedByte(); // Reserved, should be 0 header.channels = imageInput.readUnsignedByte(); // Channels or Bit planes
int b = imageInput.readUnsignedByte(); int g = imageInput.readUnsignedByte(); int r = imageInput.readUnsignedByte(); colors[i] = r << 16 | g << 8 | b | 0xff000000;
defaultColor = pInput.readUnsignedByte(); flags = pInput.readUnsignedByte(); maskParams = pInput.readUnsignedByte(); dataLeft--; if (dataLeft >= 2) { flags = pInput.readUnsignedByte(); defaultColor = pInput.readUnsignedByte(); dataLeft -= 2;
header.compression = imageInput.readUnsignedByte(); header.bytesPerPixel = imageInput.readUnsignedByte();
extensions.attributeType = stream.readUnsignedByte();