Package seamcarving.seamfinding
Class GenerativeSeamFinder.PixelGraph
- java.lang.Object
-
- seamcarving.seamfinding.GenerativeSeamFinder.PixelGraph
-
- Enclosing class:
- GenerativeSeamFinder
private static class GenerativeSeamFinder.PixelGraph extends Object implements Graph<Node>
Generative adjacency list graph ofGenerativeSeamFinder.PixelGraph.Pixelvertices andEnergyFunction-weighted edges. Rather than materialize all vertices and edges upfront in the constructor, generates vertices and edges as needed whenneighbors(Node)is called by a client.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classGenerativeSeamFinder.PixelGraph.PixelA pixel in theGenerativeSeamFinder.PixelGraphrepresentation of thePicturewithEnergyFunction-weighted edges to neighbors.
-
Field Summary
Fields Modifier and Type Field Description private EnergyFunctionfTheEnergyFunctionforneighbors(Node).private PicturepictureThePictureforneighbors(Node).private NodesinkSinkNodefor the adjacency list graph.private NodesourceSourceNodefor the adjacency list graph.
-
Constructor Summary
Constructors Modifier Constructor Description privatePixelGraph(Picture picture, EnergyFunction f)Constructs a generative adjacency list graph.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Edge<Node>>neighbors(Node node)Returns a list of the outgoing edges from the given vertex.
-
-
-
Field Detail
-
picture
private final Picture picture
ThePictureforneighbors(Node).
-
f
private final EnergyFunction f
TheEnergyFunctionforneighbors(Node).
-
-
Constructor Detail
-
PixelGraph
private PixelGraph(Picture picture, EnergyFunction f)
Constructs a generative adjacency list graph. All work is deferred to implementations ofNode.neighbors(Picture, EnergyFunction).- Parameters:
picture- the input picture.f- the input energy function.
-
-