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

13
LINES

< > BotCompany Repo | #1033053 // IIColumnToAudioSample - image to "audio", vertically

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

Libraryless. Click here for Pure Java version (7071L/42K).

1  
// The core integral 1D image.
2  
srecord IIColumnToAudioSample(IIntegralImage img, double x1, double x2) implements IAudioSample {
3  
4  
  public int channels() { ret 1; }
5  
  public double sampleRate() { ret 1; } // not applicable
6  
  public double h aka length() { ret img.getHeight(); }
7  
  
8  
  public DoubleRange bounds() { ret DoubleRange(0, h()); }
9  
  
10  
  public double sampleSum(int channel, double start, double end) {
11  
    ret img.rectSum(x1, start, x2, end, channel);
12  
  }
13  
}

Author comment

Began life as a copy of #1032980

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1033053
Snippet name: IIColumnToAudioSample - image to "audio", vertically
Eternal ID of this version: #1033053/5
Text MD5: a2918bbc633848df83fae20d5bc1b1ac
Transpilation MD5: a8d6293cee25619f0b0330dd168d6d5a
Author: stefan
Category: javax / audio analysis
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-11 19:25:32
Source code size: 478 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 197 / 298
Version history: 4 change(s)
Referenced in: [show references]