112c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford/*
212c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford * Copyright (C) 2012 The Android Open Source Project
312c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford *
412c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford * Licensed under the Apache License, Version 2.0 (the "License");
512c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford * you may not use this file except in compliance with the License.
612c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford * You may obtain a copy of the License at
712c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford *
812c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford *      http://www.apache.org/licenses/LICENSE-2.0
912c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford *
1012c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford * Unless required by applicable law or agreed to in writing, software
1112c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford * distributed under the License is distributed on an "AS IS" BASIS,
1212c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1312c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford * See the License for the specific language governing permissions and
1412c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford * limitations under the License.
1512c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford */
1612c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford
1712c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hofordpackage com.android.gallery3d.filtershow.editors;
1812c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford
1912c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hofordimport android.content.Context;
2012c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hofordimport android.widget.FrameLayout;
2112c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford
2212c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hofordimport com.android.gallery3d.R;
2312c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hofordimport com.android.gallery3d.filtershow.filters.FilterRedEyeRepresentation;
2412c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hofordimport com.android.gallery3d.filtershow.filters.FilterRepresentation;
2512c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hofordimport com.android.gallery3d.filtershow.imageshow.ImageRedEye;
2612c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford
2712c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford/**
2812c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford * The editor with no slider for filters without UI
2912c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford */
3012c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hofordpublic class EditorRedEye extends Editor {
3112c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford    public static int ID = R.id.editorRedEye;
3212c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford    private final String LOGTAG = "EditorRedEye";
3312c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford    ImageRedEye mImageRedEyes;
3412c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford
3512c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford    public EditorRedEye() {
3612c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford        super(ID);
3712c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford    }
3812c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford
3912c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford    protected EditorRedEye(int id) {
4012c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford        super(id);
4112c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford    }
4212c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford
4312c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford    @Override
4412c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford    public void createEditor(Context context, FrameLayout frameLayout) {
4512c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford        super.createEditor(context, frameLayout);
4612c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford        mView = mImageShow = mImageRedEyes=  new ImageRedEye(context);
4712c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford        mImageRedEyes.setEditor(this);
4812c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford    }
4912c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford
5012c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford    @Override
5112c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford    public void reflectCurrentFilter() {
5212c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford        super.reflectCurrentFilter();
5312c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford        FilterRepresentation rep = getLocalRepresentation();
5412c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford        if (rep != null && getLocalRepresentation() instanceof FilterRedEyeRepresentation) {
5512c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford            FilterRedEyeRepresentation redEyeRep = (FilterRedEyeRepresentation) rep;
564e6c07b71b269ee3fe7f6fa455bc540238df9dedJohn Hoford
5712c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford            mImageRedEyes.setRepresentation(redEyeRep);
5812c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford        }
5912c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford    }
6091be98c35f6c5f19d7629bb29e7261970b2f4c67nicolasroard
6191be98c35f6c5f19d7629bb29e7261970b2f4c67nicolasroard    @Override
6291be98c35f6c5f19d7629bb29e7261970b2f4c67nicolasroard    public boolean showsSeekBar() {
6391be98c35f6c5f19d7629bb29e7261970b2f4c67nicolasroard        return false;
6491be98c35f6c5f19d7629bb29e7261970b2f4c67nicolasroard    }
6512c7c8ed14ca9dff9de64e121282f1970cbe7ae4John Hoford}
66