Exemplo n.º 1
0
 private void tearDownPipeline() {
   ImageFilter.resetStatics();
   FiltersManager.getPreviewManager().freeRSFilterScripts();
   FiltersManager.getManager().freeRSFilterScripts();
   FiltersManager.getHighresManager().freeRSFilterScripts();
   FiltersManager.reset();
   CachingPipeline.destroyRenderScriptContext();
 }
Exemplo n.º 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);
 }
Exemplo n.º 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();
  }