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).

1  
static IIntegralImage iiPad(IIntegralImage etc inner, int left, int top, int right, int bottom) {
2  
  int[] padColor = {0, 0, 0}; // black
3  
  IIntegralImage img = inner;
4  
  
5  
  // add top border
6  
  if (top > 0)
7  
    img = IIVerticalSplit(IISingleColor(img.getWidth(), top, padColor), img);
8  
  
9  
  // add bottom border
10  
  if (bottom > 0)
11  
    img = IIVerticalSplit(img, IISingleColor(img.getWidth(), bottom, padColor));
12  
    
13  
  // add left border
14  
  if (left > 0)
15  
    img = IIHorizontalSplit(IISingleColor(left, img.getHeight(), padColor), img);
16  
  
17  
  // add right border
18  
  if (right > 0)
19  
    img = IIHorizontalSplit(img, IISingleColor(right, img.getHeight(), padColor));
20  
    
21  
  ret img;
22  
}

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: 213 / 315
Version history: 6 change(s)
Referenced in: [show references]