Search in sources :

Example 66 with FilterRepresentation

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

the class EditorGrad method onProgressChanged.

@Override
public void onProgressChanged(SeekBar sbar, int progress, boolean arg2) {
    FilterRepresentation tmpRep = getLocalRepresentation();
    if (tmpRep instanceof FilterGradRepresentation) {
        FilterGradRepresentation rep = (FilterGradRepresentation) tmpRep;
        int min = rep.getParameterMin(mSliderMode);
        int value = progress + min;
        rep.setParameter(mSliderMode, value);
        mView.invalidate();
        commitLocalRepresentation();
    }
}
Also used : FilterGradRepresentation(com.android.gallery3d.filtershow.filters.FilterGradRepresentation) FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation)

Example 67 with FilterRepresentation

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

the class EditorGrad method clearAddMode.

public void clearAddMode() {
    mAddModeButton.setChecked(false);
    FilterRepresentation tmpRep = getLocalRepresentation();
    if (tmpRep instanceof FilterGradRepresentation) {
        updateMenuItems((FilterGradRepresentation) tmpRep);
    }
}
Also used : FilterGradRepresentation(com.android.gallery3d.filtershow.filters.FilterGradRepresentation) FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation)

Example 68 with FilterRepresentation

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

the class EditorRotate method reflectCurrentFilter.

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

Example 69 with FilterRepresentation

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

the class EditorColorBorder method reflectCurrentFilter.

@Override
public void reflectCurrentFilter() {
    super.reflectCurrentFilter();
    FilterRepresentation rep = getLocalRepresentation();
    if (rep != null && getLocalRepresentation() instanceof FilterColorBorderRepresentation) {
        FilterColorBorderRepresentation cbRep = (FilterColorBorderRepresentation) getLocalRepresentation();
        if (!ParametricEditor.useCompact(mContext)) {
            if (mTabletUI != null) {
                mTabletUI.setColorBorderRepresentation(cbRep);
            }
        }
        cbRep.setPramMode(FilterColorBorderRepresentation.PARAM_SIZE);
        mParameterString = mContext.getString(R.string.color_border_size);
        if (mEditControl != null) {
            control(cbRep.getCurrentParam(), mEditControl);
        }
    }
}
Also used : FilterColorBorderRepresentation(com.android.gallery3d.filtershow.filters.FilterColorBorderRepresentation) FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation)

Example 70 with FilterRepresentation

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

the class EditorDraw method reflectCurrentFilter.

@Override
public void reflectCurrentFilter() {
    super.reflectCurrentFilter();
    FilterRepresentation rep = getLocalRepresentation();
    if (rep != null && getLocalRepresentation() instanceof FilterDrawRepresentation) {
        FilterDrawRepresentation drawRep = (FilterDrawRepresentation) getLocalRepresentation();
        mImageDraw.setFilterDrawRepresentation(drawRep);
        if (!ParametricEditor.useCompact(mContext)) {
            if (mTabletUI != null) {
                mTabletUI.setDrawRepresentation(drawRep);
            }
            return;
        }
        drawRep.getParam(FilterDrawRepresentation.PARAM_STYLE).setFilterView(this);
        drawRep.setPramMode(FilterDrawRepresentation.PARAM_COLOR);
        mParameterString = mContext.getString(R.string.draw_color);
        control(drawRep.getCurrentParam(), mEditControl);
    }
}
Also used : FilterRepresentation(com.android.gallery3d.filtershow.filters.FilterRepresentation) FilterDrawRepresentation(com.android.gallery3d.filtershow.filters.FilterDrawRepresentation)

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