Returns the upper border (offset from image edge) for a forward wavelet transform.
976740
public static int borderForwardUpper( WlCoef desc , int dataLength) {
		int w = Math.max( desc.offsetScaling+desc.getScalingLength() , desc.offsetWavelet+desc.getWaveletLength());

		int a = dataLength%2;
		w -= a;

		return Math.max((w + (w%2))-2,0)+a;
	}
416369
private Shape decodeMarkBorder(int width, int height) {
        double left = width / 2.0 - 4;
        double top  = height / 2.0 - 4;

        path.reset();
        path.moveTo(left + 0, top + 0);
        path.lineTo(left + 8, top);
        path.lineTo(left + 4, top + 6);
        path.closePath();

        return path;
    }
1129975
def boundary_map(self):
        
        # compute contours
        contours = self.find_contours()

        # fill in nonzero pixels
        new_data = np.zeros(self.data.shape)
        for contour in contours:
            new_data[contour.boundary_pixels[:, 0].astype(np.uint8),
                     contour.boundary_pixels[:, 1].astype(np.uint8)] = np.iinfo(np.uint8).max
        return BinaryImage(new_data.astype(np.uint8), frame=self.frame)
1372937
def _get_corners(self, image):
        """"""
        temp = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
        ret, corners = cv2.findChessboardCorners(temp,
                                                 (self.rows, self.columns))
        if not ret:
            raise ChessboardNotFoundError("No chessboard could be found.")
        cv2.cornerSubPix(temp, corners, (11, 11), (-1, -1),
                         (cv2.TERM_CRITERIA_MAX_ITER + cv2.TERM_CRITERIA_EPS,
                          30, 0.01))
        return corners
244679
def finite_pixels(self):
        
        finite_px = np.where(np.isfinite(self.data))
        finite_px = np.c_[finite_px[0], finite_px[1]]
        return finite_px
1281590
static public void border4( GrayF32 _intensity , GrayF32 derivX , GrayF32 derivY , GrayF32 output )
	{
		int w = _intensity.width;
		int h = _intensity.height-1;

		ImageBorder_F32 intensity = FactoryImageBorderAlgs.value(_intensity, 0);

		// top border
		BoofConcurrency.loopFor(0,w,x->{
			int dx,dy;

			if( derivX.get(x,0) > 0 ) dx = 1; else dx = -1;
			if( derivY.get(x,0) > 0 ) dy = 1; else dy = -1;

			float left = intensity.get(x-dx,-dy);
			float middle = intensity.get(x,0);
			float right = intensity.get(x+dx,dy);

			if( left > middle || right > middle ) {
				output.set(x,0,0);
			} else {
				output.set(x,0,middle);
			}
		});

		// bottom border
		BoofConcurrency.loopFor(0,w,x->{
			int dx,dy;

			if( derivX.get(x,h) > 0 ) dx = 1; else dx = -1;
			if( derivY.get(x,h) > 0 ) dy = 1; else dy = -1;

			float left = intensity.get(x-dx,h-dy);
			float middle = intensity.get(x,h);
			float right = intensity.get(x+dx,h+dy);

			if( left > middle || right > middle ) {
				output.set(x,h,0);
			} else {
				output.set(x,h,middle);
			}
		});

		// left border
		BoofConcurrency.loopFor(1,h,y->{
			int dx,dy;

			if( derivX.get(0,y) > 0 ) dx = 1; else dx = -1;
			if( derivY.get(0,y) > 0 ) dy = 1; else dy = -1;

			float left = intensity.get(-dx,y-dy);
			float middle = intensity.get(0,y);
			float right = intensity.get(dx,y+dy);

			if( left > middle || right > middle ) {
				output.set(0,y,0);
			} else {
				output.set(0,y,middle);
			}
		});

		// right border
		int ww = w - 1;
		BoofConcurrency.loopFor(1,h,y->{
			int dx,dy;

			if( derivX.get(ww,y) > 0 ) dx = 1; else dx = -1;
			if( derivY.get(ww,y) > 0 ) dy = 1; else dy = -1;

			float left = intensity.get(ww-dx,y-dy);
			float middle = intensity.get(ww,y);
			float right = intensity.get(ww+dx,y+dy);

			if( left > middle || right > middle ) {
				output.set(ww,y,0);
			} else {
				output.set(ww,y,middle);
			}
		});
	}
917328
function getBackgroundPosition(image) {
	var logicValue = image.isSVG ? 1 : -1;
	var x = logicValue * (image.ratio > 1 ? image.coordinates.x / image.ratio : image.coordinates.x);
	var y = logicValue * (image.ratio > 1 ? image.coordinates.y / image.ratio : image.coordinates.y);
	var template = _.template('<%= (x ? x + "px" : x) %> <%= (y ? y + "px" : y) %>');
	return template({x: x, y: y});
}
1130884
function getBorderSpacing(el) {
  let css = getComputedStyle(el).borderSpacing; // '0px 0px'
  let [horizontal, vertical] = css.split(' ');

  return {
    horizontal: parseFloat(horizontal),
    vertical: parseFloat(vertical)
  };
}
415175
function getBackgroundPositionInPercent(image) {
	var x = 100 * (image.coordinates.x) / (image.properties.width - image.coordinates.width);
	var y = 100 * (image.coordinates.y) / (image.properties.height - image.coordinates.height);
	var template = _.template('<%= (x ? x + "%" : x) %> <%= (y ? y + "%" : y) %>');
	return template({x: x, y: y});
}
793088
def cropped(self, t0, t1):
        """"""
        return Line(self.point(t0), self.point(t1))
1132174
def patCrossLines(s0):
    ''''''
    arr = np.zeros((s0,s0), dtype=np.uint8)
    col = 255
    t = int(s0/100.)
    for pos in np.logspace(0.01,1,10):
        pos = int(round((pos-0.5)*s0/10.))
        cv2.line(arr, (0,pos), (s0,pos), color=col, 
                   thickness=t, lineType=cv2.LINE_AA )
        cv2.line(arr, (pos,0), (pos,s0), color=col, 
                   thickness=t, lineType=cv2.LINE_AA )

    return arr.astype(float)
1197363
private Shape decodeMarkBorder(int width, int height) {
        int left = (width - 3) / 2 - 5;
        int top  = (height - 2) / 2 - 5;

        path.reset();
        path.moveTo(left + 1, top + 0);
        path.lineTo(left + 3, top + 0);
        path.pointAt(left + 4, top + 1);
        path.pointAt(left + 5, top + 2);
        path.pointAt(left + 6, top + 1);
        path.moveTo(left + 7, top + 0);
        path.lineTo(left + 9, top + 0);
        path.pointAt(left + 10, top + 1);
        path.pointAt(left + 9, top + 2);
        path.pointAt(left + 8, top + 3);
        path.moveTo(left + 7, top + 4);
        path.lineTo(left + 7, top + 5);
        path.pointAt(left + 8, top + 6);
        path.pointAt(left + 9, top + 7);
        path.pointAt(left + 10, top + 8);
        path.moveTo(left + 9, top + 9);
        path.lineTo(left + 7, top + 9);
        path.pointAt(left + 6, top + 8);
        path.pointAt(left + 5, top + 7);
        path.pointAt(left + 4, top + 8);
        path.moveTo(left + 3, top + 9);
        path.lineTo(left + 1, top + 9);
        path.pointAt(left + 0, top + 8);
        path.pointAt(left + 1, top + 7);
        path.pointAt(left + 2, top + 6);
        path.moveTo(left + 3, top + 5);
        path.lineTo(left + 3, top + 4);
        path.pointAt(left + 2, top + 3);
        path.pointAt(left + 1, top + 2);
        path.pointAt(left + 0, top + 1);

        return path;
    }
183027
def get_boundaries(self):
        
        if not self.__values_computed:
            self.__compute_values()
        return set(self.upper), set(self.lower)
166842
public static <T extends ImageInterleaved<T>> ImageBorder<T> interleavedValue(T image, double value) {
		ImageBorder border = interleavedValue(image.getClass(), value);
		border.setImage(image);
		return border;
	}
1010290
function getShapeZero(x,y,options,modules){

  var EOL = '\r\n';
  var width = options.width;
  var height = options.height;
  var length = modules.length;
  var style = options.style;
  var xsize = width / (length + 2 * options.padding);
  var ysize = height / (length + 2 * options.padding);
  var px = (x * xsize + options.padding * xsize);
  var py = (y * ysize + options.padding * ysize);

  switch(options.style){
    case 'square':
      return '<rect x="' + px + '" y="' + py + '" width="' + xsize + '" height="' + ysize + '" style="fill:' + options.color + ';shape-rendering:crispEdges;"/>' + EOL;
    case 'circle':
      return '<rect rx="'+xsize+'" x="' + px + '" y="' + py + '" width="' + xsize + '" height="' + ysize + '" style="fill:' + options.color + ';shape-rendering:crispEdges;"/>' + EOL;
    case 'sharp-edge':
      return '<rect transform="rotate(45 '+(px+xsize/2)+' '+(py+ysize/2)+')" x="' + px + '" y="' + py + '" width="' + xsize + '" height="' + ysize + '" style="fill:' + options.color + ';shape-rendering:crispEdges;"/>' + EOL;
    case 'ninja':
      return '<g transform="translate('+px+','+py+') scale('+1+','+1+')"><g transform="" style="fill: rgb(255, 0, 0);"><path d="M0,14V0c0,0,9.15,4.38,14,0.55C14,0.55,14.24,14,0,14z"/></g></g>'
  }
}
1095719
def get_t(self):
        """"""

        cell_above = CellBorders(self.cell_attributes,
                                 *self.cell.get_above_key_rect())
        return cell_above.get_b()
126031
def getOverlayTexelAspect(self, ulOverlayHandle):
        """"""

        fn = self.function_table.getOverlayTexelAspect
        pfTexelAspect = c_float()
        result = fn(ulOverlayHandle, byref(pfTexelAspect))
        return result, pfTexelAspect.value