Examples of ArrayByteBuffer


Examples of com.lightcrafts.utils.bytebuffer.ArrayByteBuffer

                // offsets are relative to its start, so this makes it easy to
                // read it: just extract the block and treat it like a TIFF
                // file.
                //
                m_tiffBlock =
                    new ArrayByteBuffer( m_buf.getBytes( blockSize ) );
                m_tiffMetadataReader =
                    new TIFFMetadataReader( m_imageInfo, m_tiffBlock );
                m_tiffMetadataReader.readHeader();
                break;
            }
View Full Code Here

Examples of com.lightcrafts.utils.bytebuffer.ArrayByteBuffer

        //
        // To conserve resources, we reuse an ArrayByteBuffer used during the
        // reading of metadata and stored in MRWImageInfo.
        //
        final MRWImageInfo info = (MRWImageInfo)imageInfo.getAuxiliaryInfo();
        final ArrayByteBuffer buf = info.getTIFFBlock();
        //
        // Patch the JPEG preview image.
        //
        if ( buf.get( offset + 1 ) == JPEG_SOI_MARKER &&
             buf.get( offset + 2 ) == JPEG_MARKER_BYTE )
            buf.put( offset, JPEG_MARKER_BYTE );
        //
        // Finally, we can call createWritableRasterFrom(), but on the patched
        // buffer.
        //
        return JPEGImageType.getImageFromBuffer(
View Full Code Here

Examples of com.lightcrafts.utils.bytebuffer.ArrayByteBuffer

        if ( buf[1] == JPEG_SOI_MARKER && buf[2] == JPEG_MARKER_BYTE )
            buf[0] = JPEG_MARKER_BYTE;

        // TODO: verify that this is actually an sRGB image, what about Adobe RGB shooting, etc.?
        return JPEGImageType.getImageFromBuffer(
            new ArrayByteBuffer( buf ), new LongMetaValue( 0 ), 0, lengthValue,
            maxWidth, maxHeight
        );
    }
View Full Code Here

Examples of com.lightcrafts.utils.bytebuffer.ArrayByteBuffer

                return;
            }
            case TIFF_RICH_TIFF_IPTC: {
                final byte[] iptcBuf = m_buf.getBytes( valueOffset, byteCount );
                final IPTCMetadataReader reader = new IPTCMetadataReader(
                    m_imageInfo, new ArrayByteBuffer( iptcBuf ),
                    TIFFImageType.INSTANCE
                );
                reader.readAllDirectories();
                return;
            }
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.