Skip to content

Commit

Permalink
Rename class names to match file names
Browse files Browse the repository at this point in the history
- SaturationSubfilter renamed to SaturationSubFilter to maintain camel
  case class name
- VignetteSubfilter renamed to VignetteSubFilter for the same

Signed-off-by: Arka Prava Basu <arka.basu@zomato.com>
  • Loading branch information
archie94 authored and Arka Prava Basu committed Nov 21, 2018
1 parent ce45221 commit 713cb3f
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import com.zomato.photofilters.geometry.Point;
import com.zomato.photofilters.imageprocessors.Filter;
import com.zomato.photofilters.imageprocessors.subfilters.BrightnessSubfilter;
import com.zomato.photofilters.imageprocessors.subfilters.ContrastSubfilter;
import com.zomato.photofilters.imageprocessors.subfilters.ToneCurveSubfilter;
import com.zomato.photofilters.imageprocessors.subfilters.BrightnessSubFilter;
import com.zomato.photofilters.imageprocessors.subfilters.ContrastSubFilter;
import com.zomato.photofilters.imageprocessors.subfilters.ToneCurveSubFilter;

/**
* @author Varun on 01/07/15.
Expand All @@ -26,7 +26,7 @@ public static Filter getStarLitFilter() {
rgbKnots[6] = new Point(207, 233);
rgbKnots[7] = new Point(255, 255);
Filter filter = new Filter();
filter.addSubFilter(new ToneCurveSubfilter(rgbKnots, null, null, null));
filter.addSubFilter(new ToneCurveSubFilter(rgbKnots, null, null, null));
return filter;
}

Expand All @@ -42,9 +42,9 @@ public static Filter getBlueMessFilter() {
redKnots[6] = new Point(225, 242);
redKnots[7] = new Point(255, 255);
Filter filter = new Filter();
filter.addSubFilter(new ToneCurveSubfilter(null, redKnots, null, null));
filter.addSubFilter(new BrightnessSubfilter(30));
filter.addSubFilter(new ContrastSubfilter(1f));
filter.addSubFilter(new ToneCurveSubFilter(null, redKnots, null, null));
filter.addSubFilter(new BrightnessSubFilter(30));
filter.addSubFilter(new ContrastSubFilter(1f));
return filter;
}

Expand Down Expand Up @@ -88,7 +88,7 @@ public static Filter getAweStruckVibeFilter() {
blueKnots[6] = new Point(255, 255);

Filter filter = new Filter();
filter.addSubFilter(new ToneCurveSubfilter(rgbKnots, redKnots, greenKnots, blueKnots));
filter.addSubFilter(new ToneCurveSubFilter(rgbKnots, redKnots, greenKnots, blueKnots));
return filter;
}

Expand All @@ -100,7 +100,7 @@ public static Filter getLimeStutterFilter() {
blueKnots[2] = new Point(255, 255);
// Check whether output is null or not.
Filter filter = new Filter();
filter.addSubFilter(new ToneCurveSubfilter(null, null, null, blueKnots));
filter.addSubFilter(new ToneCurveSubFilter(null, null, null, blueKnots));
return filter;
}

Expand Down Expand Up @@ -132,7 +132,7 @@ public static Filter getNightWhisperFilter() {
blueKnots[2] = new Point(255, 255);

Filter filter = new Filter();
filter.addSubFilter(new ToneCurveSubfilter(rgbKnots, redKnots, greenKnots, blueKnots));
filter.addSubFilter(new ToneCurveSubFilter(rgbKnots, redKnots, greenKnots, blueKnots));
return filter;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@

import android.graphics.Bitmap;

import com.zomato.photofilters.imageprocessors.subfilters.BrightnessSubfilter;
import com.zomato.photofilters.imageprocessors.subfilters.ColorOverlaySubfilter;
import com.zomato.photofilters.imageprocessors.subfilters.ContrastSubfilter;
import com.zomato.photofilters.imageprocessors.subfilters.ToneCurveSubfilter;
import com.zomato.photofilters.imageprocessors.subfilters.VignetteSubfilter;
import com.zomato.photofilters.imageprocessors.subfilters.BrightnessSubFilter;
import com.zomato.photofilters.imageprocessors.subfilters.ColorOverlaySubFilter;
import com.zomato.photofilters.imageprocessors.subfilters.ContrastSubFilter;
import com.zomato.photofilters.imageprocessors.subfilters.SaturationSubFilter;
import com.zomato.photofilters.imageprocessors.subfilters.ToneCurveSubFilter;
import com.zomato.photofilters.imageprocessors.subfilters.VignetteSubFilter;

import java.util.ArrayList;
import java.util.Iterator;
Expand All @@ -31,12 +32,12 @@ public Filter() {
* Adds a Subfilter to the Main Filter
*
* @param subFilter Subfilter like contrast, brightness, tone Curve etc. subfilter
* @see BrightnessSubfilter
* @see ColorOverlaySubfilter
* @see ContrastSubfilter
* @see ToneCurveSubfilter
* @see VignetteSubfilter
* @see com.zomato.photofilters.imageprocessors.subfilters.SaturationSubfilter
* @see BrightnessSubFilter
* @see ColorOverlaySubFilter
* @see ContrastSubFilter
* @see ToneCurveSubFilter
* @see VignetteSubFilter
* @see SaturationSubFilter
*/
public void addSubFilter(SubFilter subFilter) {
subFilters.add(subFilter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @author varun
* subfilter used to tweak brightness of the Bitmap
*/
public class BrightnessSubfilter implements SubFilter {
public class BrightnessSubFilter implements SubFilter {
private static String tag = "";
// Value is in integer
private int brightness = 0;
Expand All @@ -19,7 +19,7 @@ public class BrightnessSubfilter implements SubFilter {
*
* @param brightness Integer brightness value {value 0 has no effect}
*/
public BrightnessSubfilter(int brightness) {
public BrightnessSubFilter(int brightness) {
this.brightness = brightness;
}

Expand All @@ -35,7 +35,7 @@ public String getTag() {

@Override
public void setTag(Object tag) {
BrightnessSubfilter.tag = (String) tag;
BrightnessSubFilter.tag = (String) tag;
}

public void setBrightness(int brightness) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @author varun
* Subfilter used to overlay bitmap with the color defined
*/
public class ColorOverlaySubfilter implements SubFilter {
public class ColorOverlaySubFilter implements SubFilter {
private static String tag = "";

// the color overlay depth is between 0-255
Expand All @@ -28,7 +28,7 @@ public class ColorOverlaySubfilter implements SubFilter {
* @param green Green value between 0-1
* @param blue Blue value between 0-1
*/
public ColorOverlaySubfilter(int depth, float red, float green, float blue) {
public ColorOverlaySubFilter(int depth, float red, float green, float blue) {
this.colorOverlayDepth = depth;
this.colorOverlayRed = red;
this.colorOverlayBlue = blue;
Expand All @@ -49,6 +49,6 @@ public String getTag() {

@Override
public void setTag(Object tag) {
ColorOverlaySubfilter.tag = (String) tag;
ColorOverlaySubFilter.tag = (String) tag;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @author varun
* Class to add Contrast Subfilter
*/
public class ContrastSubfilter implements SubFilter {
public class ContrastSubFilter implements SubFilter {

private static String tag = "";

Expand All @@ -21,7 +21,7 @@ public class ContrastSubfilter implements SubFilter {
*
* @param contrast The contrast value ranges in fraction, value 1 has no effect
*/
public ContrastSubfilter(float contrast) {
public ContrastSubFilter(float contrast) {
this.contrast = contrast;
}

Expand All @@ -37,7 +37,7 @@ public String getTag() {

@Override
public void setTag(Object tag) {
ContrastSubfilter.tag = (String) tag;
ContrastSubFilter.tag = (String) tag;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
/**
* @author varun on 28/07/15.
*/
public class SaturationSubfilter implements SubFilter {
public class SaturationSubFilter implements SubFilter {
private static String tag = "";

// The Level value is float, where level = 1 has no effect on the image
private float level;

public SaturationSubfilter(float level) {
public SaturationSubFilter(float level) {
this.level = level;
}

Expand All @@ -30,7 +30,7 @@ public Object getTag() {

@Override
public void setTag(Object tag) {
SaturationSubfilter.tag = (String) tag;
SaturationSubFilter.tag = (String) tag;
}

public void setLevel(float level) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @author varun
* Subfilter to tweak rgb channels of an image
*/
public class ToneCurveSubfilter implements SubFilter {
public class ToneCurveSubFilter implements SubFilter {
private static String tag = "";

// These are knots which contains the plot points
Expand All @@ -33,7 +33,7 @@ public class ToneCurveSubfilter implements SubFilter {
* @param greenKnots Knots in green Channel
* @param blueKnots Knots in Blue channel
*/
public ToneCurveSubfilter(Point[] rgbKnots, Point[] redKnots, Point[] greenKnots, Point[] blueKnots) {
public ToneCurveSubFilter(Point[] rgbKnots, Point[] redKnots, Point[] greenKnots, Point[] blueKnots) {
Point[] straightKnots = new Point[2];
straightKnots[0] = new Point(0, 0);
straightKnots[1] = new Point(255, 255);
Expand Down Expand Up @@ -108,6 +108,6 @@ public String getTag() {

@Override
public void setTag(Object tag) {
ToneCurveSubfilter.tag = (String) tag;
ToneCurveSubFilter.tag = (String) tag;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @author varun
* Subfilter to add Vignette effect on an image
*/
public class VignetteSubfilter implements SubFilter {
public class VignetteSubFilter implements SubFilter {

private static String tag = "";
private Context context;
Expand All @@ -26,7 +26,7 @@ public class VignetteSubfilter implements SubFilter {
*
* @param alpha value of alpha ranges from 0-255 (Intensity of Vignette effect)
*/
public VignetteSubfilter(Context context, int alpha) {
public VignetteSubFilter(Context context, int alpha) {
this.context = context;
this.alpha = alpha;
}
Expand All @@ -53,7 +53,7 @@ public Object getTag() {

@Override
public void setTag(Object tag) {
VignetteSubfilter.tag = (String) tag;
VignetteSubFilter.tag = (String) tag;
}

/**
Expand Down

0 comments on commit 713cb3f

Please sign in to comment.