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);
}
}
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();
}
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);
}
}
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;
}
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);
}
Aggregations