congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
BMPReader
Code IndexAdd Tabnine to your IDE (free)

How to use
BMPReader
in
loci.formats.in

Best Java code snippets using loci.formats.in.BMPReader (Showing top 10 results out of 315)

origin: ome/formats-bsd

addGlobalMeta("Magic identifier", in.readString(2));
addGlobalMeta("File size (in bytes)", in.readInt());
in.skipBytes(4);
global = in.readInt();
if (getSizeX() < 1) {
 LOGGER.trace("Invalid width: {}; using the absolute value", getSizeX());
 m.sizeX = Math.abs(getSizeX());
if (getSizeY() < 1) {
 LOGGER.trace("Invalid height: {}; using the absolute value", getSizeY());
 m.sizeY = Math.abs(getSizeY());
 invertY = true;
addGlobalMeta("Color planes", in.readShort());
bpp = in.readShort();
if (bpp > 8) bpp /= getSizeC();
m.rgb = getSizeC() > 1;
m.littleEndian = true;
m.interleaved = true;
m.metadataComplete = true;
m.indexed = palette != null;
if (isIndexed()) {
 m.sizeC = 1;
 m.rgb = false;
origin: openmicroscopy/bioformats

@Override
public void close(boolean fileOnly) throws IOException {
 super.close(fileOnly);
 if (thumbReader != null) thumbReader.close(fileOnly);
origin: openmicroscopy/bioformats

int rowsToSkip = invertY ? y : getSizeY() - (h + y);
int rowLength = (getSizeX() * (isIndexed() ? 1 : getSizeC()) * bpp) / 8;
else pad *= getSizeC();
int planeSize = getSizeX() * getSizeC() * h;
if (bpp >= 8) planeSize *= (bpp / 8);
else planeSize /= (8 / bpp);
 if (planeSize + getSizeY() + in.getFilePointer() <= in.length()) {
  pad = 1;
  planeSize += h;
int effectiveC = palette != null && palette[0].length > 0 ? 1 : getSizeC();
   int nBits = (getSizeX() - w - x) * bpp * effectiveC + pad * 8;
 boolean endOfFile = false;
 int index = 0;
 byte[] plane = new byte[getSizeX() * getSizeY() * getRGBChannelCount()];
 while(!endOfFile) {
  byte firstByte = (byte) (in.readBits(bpp) & 0xff);
  readPlane(s, x, y, w, h, buf);
if (getRGBChannelCount() > 1) {
 ImageTools.bgrToRgb(buf, isInterleaved(), 1, getRGBChannelCount());
origin: openmicroscopy/bioformats

tiffs = new ArrayList<String>(getImageCount());
thumbReader = new BMPReader();
if (thumbId != null) {
 thumbId = replaceExtension(thumbId, "pty", "bmp");
 thumb.close();
 Location.mapFile("thumbnail.bmp", new ByteArrayHandle(b));
 thumbReader.setId("thumbnail.bmp");
 for (int i=0; i<getSeriesCount(); i++) {
  core.get(i).thumbSizeX = thumbReader.getSizeX();
  core.get(i).thumbSizeY = thumbReader.getSizeY();
 thumbReader.close();
 Location.mapFile("thumbnail.bmp", null);
origin: openmicroscopy/bioformats

if (reader == null) {
 file = "tile.bmp";
 reader = new BMPReader();
origin: ome/formats-gpl

tiffs = new ArrayList<String>(getImageCount());
thumbReader = new BMPReader();
if (thumbId != null) {
 thumbId = replaceExtension(thumbId, "pty", "bmp");
 thumb.close();
 Location.mapFile("thumbnail.bmp", new ByteArrayHandle(b));
 thumbReader.setId("thumbnail.bmp");
 for (int i=0; i<getSeriesCount(); i++) {
  core.get(i).thumbSizeX = thumbReader.getSizeX();
  core.get(i).thumbSizeY = thumbReader.getSizeY();
 thumbReader.close();
 Location.mapFile("thumbnail.bmp", null);
origin: ome/formats-gpl

if (reader == null) {
 file = "tile.bmp";
 reader = new BMPReader();
origin: openmicroscopy/bioformats

addGlobalMeta("Magic identifier", in.readString(2));
addGlobalMeta("File size (in bytes)", in.readInt());
in.skipBytes(4);
global = in.readInt();
if (getSizeX() < 1) {
 LOGGER.trace("Invalid width: {}; using the absolute value", getSizeX());
 m.sizeX = Math.abs(getSizeX());
if (getSizeY() < 1) {
 LOGGER.trace("Invalid height: {}; using the absolute value", getSizeY());
 m.sizeY = Math.abs(getSizeY());
 invertY = true;
addGlobalMeta("Color planes", in.readShort());
bpp = in.readShort();
if (bpp > 8) bpp /= getSizeC();
m.rgb = getSizeC() > 1;
m.littleEndian = true;
m.interleaved = true;
m.metadataComplete = true;
m.indexed = palette != null;
if (isIndexed()) {
 m.sizeC = 1;
 m.rgb = false;
origin: ome/formats-bsd

int rowsToSkip = invertY ? y : getSizeY() - (h + y);
int rowLength = (getSizeX() * (isIndexed() ? 1 : getSizeC()) * bpp) / 8;
else pad *= getSizeC();
int planeSize = getSizeX() * getSizeC() * h;
if (bpp >= 8) planeSize *= (bpp / 8);
else planeSize /= (8 / bpp);
 if (planeSize + getSizeY() + in.getFilePointer() <= in.length()) {
  pad = 1;
  planeSize += h;
int effectiveC = palette != null && palette[0].length > 0 ? 1 : getSizeC();
   int nBits = (getSizeX() - w - x) * bpp * effectiveC + pad * 8;
 boolean endOfFile = false;
 int index = 0;
 byte[] plane = new byte[getSizeX() * getSizeY() * getRGBChannelCount()];
 while(!endOfFile) {
  byte firstByte = (byte) (in.readBits(bpp) & 0xff);
  readPlane(s, x, y, w, h, buf);
if (getRGBChannelCount() > 1) {
 ImageTools.bgrToRgb(buf, isInterleaved(), 1, getRGBChannelCount());
origin: ome/formats-gpl

@Override
public void close(boolean fileOnly) throws IOException {
 super.close(fileOnly);
 if (thumbReader != null) thumbReader.close(fileOnly);
loci.formats.inBMPReader

Javadoc

BMPReader is the file format reader for Microsoft Bitmap (BMP) files. See http://astronomy.swin.edu.au/~pbourke/dataformats/bmp/ for a nice description of the BMP file format.

Most used methods

  • getSizeX
  • getSizeY
  • <init>
    Constructs a new BMP reader.
  • addGlobalMeta
  • close
  • getMetadataOptions
  • getRGBChannelCount
  • getSizeC
  • isIndexed
  • isInterleaved
  • makeFilterMetadata
  • readPlane
  • makeFilterMetadata,
  • readPlane,
  • setId

Popular in Java

  • Reading from database using SQL prepared statement
  • setScale (BigDecimal)
  • onCreateOptionsMenu (Activity)
  • compareTo (BigDecimal)
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now