/** * Report the pixels buffer for the whole key area * * @param source pixel source (staff free) * @param range start/stop values for key area * @return the buffer of area pixels */ public ByteProcessor getAreaPixels (ByteProcessor source, StaffHeader.Range range) { Rectangle keyRect = new Rectangle(range.getStart(), y, range.getWidth(), height); ByteProcessor keyBuffer = new ByteProcessor(keyRect.width, height); keyBuffer.copyBits(source, -keyRect.x, -y, Blitter.COPY); return keyBuffer; }
buffer.copyBits(scaledBuffer, xOffset, yOffset, Blitter.COPY);
/** * Retrieve all glyph instances that could be part of clef. * * @param isFirstPass true for first pass * @return clef possible parts */ private List<Glyph> getParts (boolean isFirstPass) { final Rectangle rect = isFirstPass ? outerRect : innerRect; // Grab pixels out of staff-free source ByteProcessor source = sheet.getPicture().getSource(Picture.SourceKey.NO_STAFF); ByteProcessor buf = new ByteProcessor(rect.width, rect.height); buf.copyBits(source, -rect.x, -rect.y, Blitter.COPY); // Extract parts RunTable runTable = new RunTableFactory(VERTICAL).createTable(buf); List<Glyph> parts = GlyphFactory.buildGlyphs(runTable, rect.getLocation()); // Keep only interesting parts purgeParts(parts, isFirstPass); system.registerGlyphs(parts, null); logger.debug("{} parts: {}", this, parts.size()); return parts; }
/** * Retrieve all glyph instances that could be part of time sig. * * @return time sig possible parts */ private List<Glyph> getParts (Rectangle rect) { final Sheet sheet = system.getSheet(); // Grab pixels out of staff-free source ByteProcessor source = sheet.getPicture().getSource(Picture.SourceKey.NO_STAFF); ByteProcessor buf = new ByteProcessor(rect.width, rect.height); buf.copyBits(source, -rect.x, -rect.y, Blitter.COPY); // Extract parts RunTable runTable = new RunTableFactory(VERTICAL).createTable(buf); List<Glyph> parts = GlyphFactory.buildGlyphs(runTable, rect.getLocation()); // Keep only interesting parts purgeParts(parts, rect); final GlyphIndex glyphIndex = sheet.getGlyphIndex(); for (ListIterator<Glyph> li = parts.listIterator(); li.hasNext();) { final Glyph part = li.next(); Glyph glyph = glyphIndex.registerOriginal(part); system.addFreeGlyph(glyph); li.set(glyph); } return parts; }
BufferedImage.TYPE_BYTE_GRAY); ByteProcessor sBuffer = new ByteProcessor(sImage); sBuffer.copyBits(source, -sRect.x, -sRect.y, Blitter.COPY);
extendedMask.copyBits( mask, boxXMin, boxYMin, Blitter.COPY ); maskPixels = ( byte[] )extendedMask.getPixels();
extendedMask.copyBits( mask, boxXMin, boxYMin, Blitter.COPY ); maskPixels = ( byte[] )extendedMask.getPixels();
ByteProcessor bp = new ByteProcessor(w, h); if(rois[i] != null) { bp.copyBits(rois[i].getMask(), rois[i].getBounds().x, rois[i].getBounds().y,
ByteProcessor bp = new ByteProcessor(w, h); if(rois[i] != null) { bp.copyBits(rois[i].getMask(), rois[i].getBounds().x, rois[i].getBounds().y,
ByteProcessor bp = new ByteProcessor(w, h); if(rois[i] != null) { bp.copyBits(rois[i].getMask(), rois[i].getBounds().x, rois[i].getBounds().y,