Package seamcarving.seamfinding
Class AdjacencyListSeamFinder
- java.lang.Object
-
- seamcarving.seamfinding.AdjacencyListSeamFinder
-
- All Implemented Interfaces:
SeamFinder
public class AdjacencyListSeamFinder extends Object implements SeamFinder
Adjacency list graph single-sourceShortestPathSolverimplementation of theSeamFinderinterface.- See Also:
Graph,ShortestPathSolver,SeamFinder,SeamCarver
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classAdjacencyListSeamFinder.PixelGraphAdjacency list graph ofAdjacencyListSeamFinder.PixelGraph.Pixelvertices andEnergyFunction-weighted edges.
-
Field Summary
Fields Modifier and Type Field Description private ShortestPathSolver.Constructor<Node>spsThe constructor for theShortestPathSolverimplementation.
-
Constructor Summary
Constructors Constructor Description AdjacencyListSeamFinder(ShortestPathSolver.Constructor<Node> sps)Constructs an instance with the givenShortestPathSolverimplementation.
-
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 aListof 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 theShortestPathSolverimplementation.
-
-
Constructor Detail
-
AdjacencyListSeamFinder
public AdjacencyListSeamFinder(ShortestPathSolver.Constructor<Node> sps)
Constructs an instance with the givenShortestPathSolverimplementation.- Parameters:
sps- theShortestPathSolverimplementation.
-
-
Method Detail
-
findHorizontal
public List<Integer> findHorizontal(Picture picture, EnergyFunction f)
Description copied from interface:SeamFinderReturns a minimum-energy horizontal seam in the current image as aListof integers representing the vertical pixel index to remove from each column in the width of the horizontal seam.- Specified by:
findHorizontalin interfaceSeamFinder- Parameters:
picture- thePicture.f- theEnergyFunction.- Returns:
- a
Listof integers representing the vertical pixels to remove.
-
-