Package seamcarving.seamfinding
Class GenerativeSeamFinder
- java.lang.Object
-
- seamcarving.seamfinding.GenerativeSeamFinder
-
- All Implemented Interfaces:
SeamFinder
public class GenerativeSeamFinder extends Object implements SeamFinder
Generative adjacency list graph single-sourceShortestPathSolver
implementation of theSeamFinder
interface.- See Also:
Graph
,ShortestPathSolver
,SeamFinder
,SeamCarver
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
GenerativeSeamFinder.PixelGraph
Generative adjacency list graph ofGenerativeSeamFinder.PixelGraph.Pixel
vertices andEnergyFunction
-weighted edges.
-
Field Summary
Fields Modifier and Type Field Description private ShortestPathSolver.Constructor<Node>
sps
The constructor for theShortestPathSolver
implementation.
-
Constructor Summary
Constructors Constructor Description GenerativeSeamFinder(ShortestPathSolver.Constructor<Node> sps)
Constructs an instance with the givenShortestPathSolver
implementation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Integer>
findHorizontal(Picture picture, EnergyFunction f)
Returns a minimum-energy horizontal seam in the current image as aList
of integers representing the vertical pixel index to remove from each column in the width of the horizontal seam.
-
-
-
Field Detail
-
sps
private final ShortestPathSolver.Constructor<Node> sps
The constructor for theShortestPathSolver
implementation.
-
-
Constructor Detail
-
GenerativeSeamFinder
public GenerativeSeamFinder(ShortestPathSolver.Constructor<Node> sps)
Constructs an instance with the givenShortestPathSolver
implementation.- Parameters:
sps
- theShortestPathSolver
implementation.
-
-
Method Detail
-
findHorizontal
public List<Integer> findHorizontal(Picture picture, EnergyFunction f)
Description copied from interface:SeamFinder
Returns a minimum-energy horizontal seam in the current image as aList
of integers representing the vertical pixel index to remove from each column in the width of the horizontal seam.- Specified by:
findHorizontal
in interfaceSeamFinder
- Parameters:
picture
- thePicture
.f
- theEnergyFunction
.- Returns:
- a
List
of integers representing the vertical pixels to remove.
-
-