niso.setColorSpace (3); // palette color niso.setOrientation(1); // normal niso.setBitsPerSample (new int[] {8});
protected void readSOF(int dbyt, RepInfo info) throws IOException { int length = readUnsignedShort(_dstream); int precision = readUnsignedByte(_dstream, this); int nLines = readUnsignedShort(_dstream); int samPerLine = readUnsignedShort(_dstream); int numComps = readUnsignedByte(_dstream, this); skipBytes(_dstream, length - 8, this); if (!_seenSOF) { _niso.setImageLength(nLines); _niso.setImageWidth(samPerLine); int[] bps = new int[numComps]; for (int i = 0; i < numComps; i++) { bps[i] = precision; } _niso.setBitsPerSample(bps); _niso.setSamplesPerPixel(numComps); _propList.add(new Property("CompressionType", PropertyType.STRING, JpegStrings.COMPRESSION_TYPE[dbyt - 0XC0])); _seenSOF = true; } }
/** Reads the box, putting appropriate information in * the RepInfo object. setModule, setBoxHeader, * setRepInfo and setDataInputStream must be called * before <code>readBox</code> is called. * <code>readBox</code> must completely consume the * box, so that the next byte to be read by the * DataInputStream is the <code>FF</code> byte of the next Box. */ public boolean readBox() throws IOException { if (!(_parentBox instanceof JP2HeaderBox || _parentBox instanceof CodestreamHeaderBox)) { wrongBoxContext(); return false; } initBytesRead (); int len = (int) _boxHeader.getDataLength (); int[] bits = new int[len]; for (int i = 0; i < len; i++) { bits[i] = ModuleBase.readUnsignedByte (_dstrm, _module); } NisoImageMetadata niso; niso = _module.getCurrentNiso (); niso.setBitsPerSample (bits); finalizeBytesRead (); return true; }
protected void readDHP(RepInfo info) throws IOException { int length = readUnsignedShort(_dstream); int precision = readUnsignedByte(_dstream, this); int nLines = readUnsignedShort(_dstream); int samPerLine = readUnsignedShort(_dstream); int numComps = readUnsignedByte(_dstream, this); skipBytes(_dstream, length - 8, this); if (!_seenSOF) { _niso.setImageLength(nLines); _niso.setImageWidth(samPerLine); int[] bps = new int[numComps]; for (int i = 0; i < numComps; i++) { bps[i] = precision; } _niso.setBitsPerSample(bps); _niso.setSamplesPerPixel(numComps); _seenSOF = true; } }
niso.setBitsPerSample (new int[] {tnbps} ); int cs = Spiff.colorSpaceToNiso(tns); if (cs >= 0) {
bitsPerSample[i] = 1; _niso.setBitsPerSample (bitsPerSample);
niso.setBitsPerSample(new int[] { bpc.getIntValue() });
bps[i] = precision; _niso.setBitsPerSample(bps); _niso.setSamplesPerPixel(numComps); _seenSOF = true;
_nisoMetadata.setImageLength (height); int[] bits = { bitDepth }; _nisoMetadata.setBitsPerSample (bits); boolean ctErr = false; try {
/** Set the initial Niso values from a default Niso object. * This doesn't attempt to be complete, but sets * the values which we know could have been set from the * JP2 header. */ public void setDefaultNiso (NisoImageMetadata dNiso) { _niso.setByteOrder(dNiso.getByteOrder ()); _niso.setMimeType (dNiso.getMimeType ()); _niso.setBitsPerSample (dNiso.getBitsPerSample ()); _niso.setImageLength (dNiso.getImageLength ()); _niso.setImageWidth (dNiso.getImageWidth ()); _niso.setSamplesPerPixel (dNiso.getSamplesPerPixel ()); _niso.setCompressionScheme (dNiso.getCompressionScheme ()); _niso.setYSamplingFrequency (dNiso.getYSamplingFrequency ()); _niso.setXSamplingFrequency (dNiso.getXSamplingFrequency ()); _niso.setSamplingFrequencyUnit (dNiso.getSamplingFrequencyUnit ()); }
niso.setBitsPerSample(bits);
_niso.setBitsPerSample (readShortArray (type, count, value));