Search in sources :

Example 11 with FilterRepresentation

use of com.android.gallery3d.filtershow.filters.FilterRepresentation in project android_packages_apps_Gallery2 by LineageOS.

the class EditorGrad method reflectCurrentFilter.

@Override
public void reflectCurrentFilter() {
    super.reflectCurrentFilter();
    FilterRepresentation tmpRep = getLocalRepresentation();
    if (tmpRep instanceof FilterGradRepresentation) {
        FilterGradRepresentation rep = (FilterGradRepresentation) tmpRep;
        boolean f = rep.showParameterValue();
        mImageGrad.setRepresentation(rep);
    }
}
Also used : FilterGradRepresentation(com.android.gallery3d.filtershow.filters.FilterGradRepresentation) FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation)

Example 12 with FilterRepresentation

use of com.android.gallery3d.filtershow.filters.FilterRepresentation in project android_packages_apps_Gallery2 by LineageOS.

the class EditorCrop method reflectCurrentFilter.

@Override
public void reflectCurrentFilter() {
    MasterImage master = MasterImage.getImage();
    master.setCurrentFilterRepresentation(master.getPreset().getFilterWithSerializationName(FilterCropRepresentation.SERIALIZATION_NAME));
    super.reflectCurrentFilter();
    FilterRepresentation rep = getLocalRepresentation();
    if (rep == null || rep instanceof FilterCropRepresentation) {
        mImageCrop.setFilterCropRepresentation((FilterCropRepresentation) rep);
    } else {
        Log.w(TAG, "Could not reflect current filter, not of type: " + FilterCropRepresentation.class.getSimpleName());
    }
    mImageCrop.invalidate();
}
Also used : MasterImage(com.android.gallery3d.filtershow.imageshow.MasterImage) FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation) FilterCropRepresentation(com.android.gallery3d.filtershow.filters.FilterCropRepresentation)

Example 13 with FilterRepresentation

use of com.android.gallery3d.filtershow.filters.FilterRepresentation in project android_packages_apps_Gallery2 by LineageOS.

the class EditorTinyPlanet method reflectCurrentFilter.

@Override
public void reflectCurrentFilter() {
    super.reflectCurrentFilter();
    FilterRepresentation rep = getLocalRepresentation();
    if (rep != null && rep instanceof FilterTinyPlanetRepresentation) {
        FilterTinyPlanetRepresentation drawRep = (FilterTinyPlanetRepresentation) rep;
        mImageTinyPlanet.setRepresentation(drawRep);
    }
}
Also used : FilterTinyPlanetRepresentation(com.android.gallery3d.filtershow.filters.FilterTinyPlanetRepresentation) FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation)

Example 14 with FilterRepresentation

use of com.android.gallery3d.filtershow.filters.FilterRepresentation in project android_packages_apps_Gallery2 by LineageOS.

the class EditorChanSat method calculateUserMessage.

@Override
public String calculateUserMessage(Context context, String effectName, Object parameterValue) {
    FilterRepresentation rep = getLocalRepresentation();
    if (rep == null || !(rep instanceof FilterChanSatRepresentation)) {
        return "";
    }
    FilterChanSatRepresentation csrep = (FilterChanSatRepresentation) rep;
    int mode = csrep.getParameterMode();
    String paramString;
    paramString = mContext.getString(mMenuStrings[mode]);
    int val = csrep.getCurrentParameter();
    return paramString + ((val > 0) ? " +" : " ") + val;
}
Also used : FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation) FilterChanSatRepresentation(com.android.gallery3d.filtershow.filters.FilterChanSatRepresentation)

Example 15 with FilterRepresentation

use of com.android.gallery3d.filtershow.filters.FilterRepresentation in project android_packages_apps_Gallery2 by LineageOS.

the class EditorTruePortraitFusion method openUtilityPanel.

@Override
public void openUtilityPanel(final LinearLayout accessoryViewList) {
    accessoryViewList.removeAllViews();
    LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    inflater.inflate(R.layout.filtershow_actionbar_trueportrait_fusion, accessoryViewList);
    View pickUnderlayBtn = accessoryViewList.findViewById(R.id.pick_underlay);
    pickUnderlayBtn.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View view) {
            MasterImage.getImage().getActivity().pickImage(FilterShowActivity.SELECT_FUSION_UNDERLAY);
        }
    });
    View editMaskBtn = accessoryViewList.findViewById(R.id.editMask);
    editMaskBtn.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View view) {
            FilterRepresentation representation = new FilterRepresentation("");
            representation.setEditorId(EditorTruePortraitMask.ID);
            ((FilterShowActivity) mContext).loadEditorPanel(representation);
        }
    });
    // Look for previous underlay
    String fusionUnderlay = GalleryUtils.getStringPref(mContext, mContext.getString(R.string.pref_trueportrait_fusion_underlay_key), null);
    Uri fusionUri = Uri.EMPTY;
    if (fusionUnderlay != null) {
        fusionUri = Uri.parse(fusionUnderlay);
        if (!uriExists(mContext, fusionUri))
            fusionUri = Uri.EMPTY;
    }
    pickDialogHasShown = false;
    setUnderlayImageUri(fusionUri);
}
Also used : LayoutInflater(android.view.LayoutInflater) OnClickListener(android.view.View.OnClickListener) FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation) View(android.view.View) Uri(android.net.Uri)

Aggregations

FilterRepresentation (com.android.gallery3d.filtershow.filters.FilterRepresentation)78 Action (com.android.gallery3d.filtershow.category.Action)12 FiltersManager (com.android.gallery3d.filtershow.filters.FiltersManager)12 CategoryAdapter (com.android.gallery3d.filtershow.category.CategoryAdapter)11 Point (android.graphics.Point)8 ImagePreset (com.android.gallery3d.filtershow.pipeline.ImagePreset)8 Bitmap (android.graphics.Bitmap)7 FilterUserPresetRepresentation (com.android.gallery3d.filtershow.filters.FilterUserPresetRepresentation)6 FilterShowActivity (com.android.gallery3d.filtershow.FilterShowActivity)5 FilterDualCamFusionRepresentation (com.android.gallery3d.filtershow.filters.FilterDualCamFusionRepresentation)5 FilterMirrorRepresentation (com.android.gallery3d.filtershow.filters.FilterMirrorRepresentation)5 MasterImage (com.android.gallery3d.filtershow.imageshow.MasterImage)5 FilterGradRepresentation (com.android.gallery3d.filtershow.filters.FilterGradRepresentation)4 FilterRotateRepresentation (com.android.gallery3d.filtershow.filters.FilterRotateRepresentation)4 ArrayList (java.util.ArrayList)4 Uri (android.net.Uri)3 LayoutInflater (android.view.LayoutInflater)3 View (android.view.View)3 OnClickListener (android.view.View.OnClickListener)3 FilterCropRepresentation (com.android.gallery3d.filtershow.filters.FilterCropRepresentation)3