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

19
LINES

< > BotCompany Repo | #1035736 // CachedPosterizer

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

Libraryless. Click here for Pure Java version (58L/1K).

sclass CachedPosterizer is IPosterizer {
  IPosterizer posterizer;
  int[] cache;

  *(IPosterizer *posterizer) {
    makeCache();
  }
  
  // 0..255 to 0..255
  public int get(int brightness) {
    ret cache[brightness];
  }
  
  void makeCache {
    cache = new int[256];
    for brightness to 256:
      cache[brightness] = posterizer.get(brightness);
  }
}

Author comment

Began life as a copy of #1034808

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): elmgxqgtpvxh, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035736
Snippet name: CachedPosterizer
Eternal ID of this version: #1035736/4
Text MD5: aad366c946c8c96d04f1e2d8a9410f06
Transpilation MD5: 2bcb3b49f9db3adb8943dee31c7d0cac
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-07-17 21:17:08
Source code size: 378 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 129 / 194
Version history: 3 change(s)
Referenced in: [show references]