Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

22
LINES

< > BotCompany Repo | #1032171 // iiPad - pad integral image

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (5884L/33K).

static IIntegralImage iiPad(IIntegralImage etc inner, int left, int top, int right, int bottom) {
  int[] padColor = {0, 0, 0}; // black
  IIntegralImage img = inner;
  
  // add top border
  if (top > 0)
    img = IIVerticalSplit(IISingleColor(img.getWidth(), top, padColor), img);
  
  // add bottom border
  if (bottom > 0)
    img = IIVerticalSplit(img, IISingleColor(img.getWidth(), bottom, padColor));
    
  // add left border
  if (left > 0)
    img = IIHorizontalSplit(IISingleColor(left, img.getHeight(), padColor), img);
  
  // add right border
  if (right > 0)
    img = IIHorizontalSplit(img, IISingleColor(right, img.getHeight(), padColor));
    
  ret img;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1032171
Snippet name: iiPad - pad integral image
Eternal ID of this version: #1032171/7
Text MD5: 424bdc3b348972e6cf2498da7e9ec1c2
Transpilation MD5: 90aafc97dcd68e28cf1bd1a417e3ca99
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-17 14:26:55
Source code size: 695 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 214 / 315
Version history: 6 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1032176 - iiPadCenter - place integral image in the center, black border around
#1032177 - iiPadToPowerOfTwoSquare - pad integral image so both dimensions are the same power of two