Example #1
0
 private void tearDownPipeline() {
   ImageFilter.resetStatics();
   FiltersManager.getPreviewManager().freeRSFilterScripts();
   FiltersManager.getManager().freeRSFilterScripts();
   FiltersManager.getHighresManager().freeRSFilterScripts();
   FiltersManager.reset();
   CachingPipeline.destroyRenderScriptContext();
 }
Example #2
0
 private Bitmap createNotificationBitmap(Bitmap preview, Uri sourceUri, ImagePreset preset) {
   int notificationBitmapSize =
       Resources.getSystem().getDimensionPixelSize(android.R.dimen.notification_large_icon_width);
   if (preview != null) {
     return Bitmap.createScaledBitmap(
         preview, notificationBitmapSize, notificationBitmapSize, true);
   }
   Bitmap bitmap =
       ImageLoader.loadConstrainedBitmap(
           sourceUri, getContext(), notificationBitmapSize, null, true);
   CachingPipeline pipeline = new CachingPipeline(FiltersManager.getManager(), "Thumb");
   return pipeline.renderFinalImage(bitmap, preset);
 }
Example #3
0
  private void setupPipeline() {
    Resources res = getResources();
    FiltersManager.setResources(res);
    CachingPipeline.createRenderscriptContext(this);

    FiltersManager filtersManager = FiltersManager.getManager();
    filtersManager.addLooks(this);
    filtersManager.addBorders(this);
    filtersManager.addTools(this);
    filtersManager.addEffects();

    FiltersManager highresFiltersManager = FiltersManager.getHighresManager();
    highresFiltersManager.addLooks(this);
    highresFiltersManager.addBorders(this);
    highresFiltersManager.addTools(this);
    highresFiltersManager.addEffects();
  }