本文整理汇总了Java中com.android.gallery3d.filtershow.filters.FilterMirrorRepresentation类的典型用法代码示例。如果您正苦于以下问题:Java FilterMirrorRepresentation类的具体用法?Java FilterMirrorRepresentation怎么用?Java FilterMirrorRepresentation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FilterMirrorRepresentation类属于com.android.gallery3d.filtershow.filters包,在下文中一共展示了FilterMirrorRepresentation类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: unpackGeometry
import com.android.gallery3d.filtershow.filters.FilterMirrorRepresentation; //导入依赖的package包/类
public static void unpackGeometry(GeometryHolder out,
Collection<FilterRepresentation> geometry) {
out.wipe();
// Get geometry data from filters
for (FilterRepresentation r : geometry) {
if (r.isNil()) {
continue;
}
if (r.getSerializationName() == FilterRotateRepresentation.SERIALIZATION_NAME) {
out.rotation = ((FilterRotateRepresentation) r).getRotation();
} else if (r.getSerializationName() ==
FilterStraightenRepresentation.SERIALIZATION_NAME) {
out.straighten = ((FilterStraightenRepresentation) r).getStraighten();
} else if (r.getSerializationName() == FilterCropRepresentation.SERIALIZATION_NAME) {
((FilterCropRepresentation) r).getCrop(out.crop);
} else if (r.getSerializationName() == FilterMirrorRepresentation.SERIALIZATION_NAME) {
out.mirror = ((FilterMirrorRepresentation) r).getMirror();
}
}
}
示例2: useFilterRepresentation
import com.android.gallery3d.filtershow.filters.FilterMirrorRepresentation; //导入依赖的package包/类
public void useFilterRepresentation(FilterRepresentation filterRepresentation) {
if (filterRepresentation == null) {
return;
}
if (!(filterRepresentation instanceof FilterRotateRepresentation)
&& !(filterRepresentation instanceof FilterMirrorRepresentation)
&& MasterImage.getImage().getCurrentFilterRepresentation() == filterRepresentation) {
return;
}
if (filterRepresentation instanceof FilterUserPresetRepresentation
|| filterRepresentation instanceof FilterRotateRepresentation
|| filterRepresentation instanceof FilterMirrorRepresentation) {
MasterImage.getImage().onNewLook(filterRepresentation);
}
ImagePreset oldPreset = MasterImage.getImage().getPreset();
ImagePreset copy = new ImagePreset(oldPreset);
FilterRepresentation representation = copy.getRepresentation(filterRepresentation);
if (representation == null) {
filterRepresentation = filterRepresentation.copy();
copy.addFilter(filterRepresentation);
} else {
if (filterRepresentation.allowsSingleInstanceOnly()) {
// Don't just update the filter representation. Centralize the
// logic in the addFilter(), such that we can keep "None" as
// null.
if (!representation.equals(filterRepresentation)) {
// Only do this if the filter isn't the same
// (state panel clicks can lead us here)
copy.removeFilter(representation);
copy.addFilter(filterRepresentation);
}
}
}
MasterImage.getImage().setPreset(copy, filterRepresentation, true);
MasterImage.getImage().setCurrentFilterRepresentation(filterRepresentation);
}
示例3: creatFilterFromName
import com.android.gallery3d.filtershow.filters.FilterMirrorRepresentation; //导入依赖的package包/类
FilterRepresentation creatFilterFromName(String name) {
if (FilterRotateRepresentation.SERIALIZATION_NAME.equals(name)) {
return new FilterRotateRepresentation();
} else if (FilterMirrorRepresentation.SERIALIZATION_NAME.equals(name)) {
return new FilterMirrorRepresentation();
} else if (FilterStraightenRepresentation.SERIALIZATION_NAME.equals(name)) {
return new FilterStraightenRepresentation();
} else if (FilterCropRepresentation.SERIALIZATION_NAME.equals(name)) {
return new FilterCropRepresentation();
}
FiltersManager filtersManager = FiltersManager.getManager();
return filtersManager.createFilterFromName(name);
}
示例4: reflectCurrentFilter
import com.android.gallery3d.filtershow.filters.FilterMirrorRepresentation; //导入依赖的package包/类
@Override
public void reflectCurrentFilter() {
MasterImage master = MasterImage.getImage();
master.setCurrentFilterRepresentation(master.getPreset()
.getFilterWithSerializationName(FilterMirrorRepresentation.SERIALIZATION_NAME));
super.reflectCurrentFilter();
FilterRepresentation rep = getLocalRepresentation();
if (rep == null || rep instanceof FilterMirrorRepresentation) {
mImageMirror.setFilterMirrorRepresentation((FilterMirrorRepresentation) rep);
} else {
Log.w(TAG, "Could not reflect current filter, not of type: "
+ FilterMirrorRepresentation.class.getSimpleName());
}
mImageMirror.invalidate();
}
示例5: equals
import com.android.gallery3d.filtershow.filters.FilterMirrorRepresentation; //导入依赖的package包/类
public boolean equals(ImagePreset preset) {
if (preset == null) {
return false;
}
if (preset.mFilters.size() != mFilters.size()) {
return false;
}
if (mDoApplyGeometry != preset.mDoApplyGeometry) {
return false;
}
if (mDoApplyFilters != preset.mDoApplyFilters) {
if (mFilters.size() > 0 || preset.mFilters.size() > 0) {
return false;
}
}
for (int i = 0; i < preset.mFilters.size(); i++) {
FilterRepresentation a = preset.mFilters.elementAt(i);
FilterRepresentation b = mFilters.elementAt(i);
boolean isGeometry = false;
if (a instanceof FilterRotateRepresentation
|| a instanceof FilterMirrorRepresentation
|| a instanceof FilterCropRepresentation
|| a instanceof FilterStraightenRepresentation) {
isGeometry = true;
}
boolean evaluate = true;
if (!isGeometry && mDoApplyGeometry && !mDoApplyFilters) {
evaluate = false;
} else if (isGeometry && !mDoApplyGeometry && mDoApplyFilters) {
evaluate = false;
}
if (evaluate && !a.equals(b)) {
return false;
}
}
return true;
}
示例6: setFilterMirrorRepresentation
import com.android.gallery3d.filtershow.filters.FilterMirrorRepresentation; //导入依赖的package包/类
public void setFilterMirrorRepresentation(FilterMirrorRepresentation rep) {
mLocalRep = (rep == null) ? new FilterMirrorRepresentation() : rep;
}
示例7: getFinalRepresentation
import com.android.gallery3d.filtershow.filters.FilterMirrorRepresentation; //导入依赖的package包/类
public FilterMirrorRepresentation getFinalRepresentation() {
return mLocalRep;
}
示例8: wipe
import com.android.gallery3d.filtershow.filters.FilterMirrorRepresentation; //导入依赖的package包/类
public void wipe() {
rotation = FilterRotateRepresentation.getNil();
straighten = FilterStraightenRepresentation.getNil();
crop = FilterCropRepresentation.getNil();
mirror = FilterMirrorRepresentation.getNil();
}
示例9: isNil
import com.android.gallery3d.filtershow.filters.FilterMirrorRepresentation; //导入依赖的package包/类
public boolean isNil() {
return rotation == FilterRotateRepresentation.getNil() &&
straighten == FilterStraightenRepresentation.getNil() &&
crop.equals(FilterCropRepresentation.getNil()) &&
mirror == FilterMirrorRepresentation.getNil();
}