Fix rotation issues

pull/559/head
Mattia Iavarone 6 years ago
parent 7bfaffb85b
commit 3f210baab8
  1. 8
      cameraview/src/main/java/com/otaliastudios/cameraview/filter/MultiFilter.java
  2. 2
      demo/src/main/java/com/otaliastudios/cameraview/demo/CameraActivity.java

@ -252,7 +252,13 @@ public class MultiFilter implements Filter, OneParameterFilter, TwoParameterFilt
} }
// Perform the actual drawing. // Perform the actual drawing.
filter.draw(transformMatrix); // The first filter should apply all the transformations. Then,
// since they are applied, we should use a no-op matrix.
if (isFirst) {
filter.draw(transformMatrix);
} else {
filter.draw(GlUtils.IDENTITY_MATRIX);
}
// Set the input for the next cycle: // Set the input for the next cycle:
// It is the framebuffer texture from this cycle. If this is the last // It is the framebuffer texture from this cycle. If this is the last

@ -342,7 +342,7 @@ public class CameraActivity extends AppCompatActivity implements View.OnClickLis
// DuotoneFilter duotone = new DuotoneFilter(); // DuotoneFilter duotone = new DuotoneFilter();
// duotone.setFirstColor(Color.RED); // duotone.setFirstColor(Color.RED);
// duotone.setSecondColor(Color.GREEN); // duotone.setSecondColor(Color.GREEN);
// camera.setFilter(new MultiFilter(filter.newInstance(), duotone)); // camera.setFilter(new MultiFilter(duotone, filter.newInstance()));
} }
@Override @Override

Loading…
Cancel
Save