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.Pixel
vertices 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 class
GenerativeSeamFinder.PixelGraph.Pixel
A pixel in theGenerativeSeamFinder.PixelGraph
representation of thePicture
withEnergyFunction
-weighted edges to neighbors.
-
Field Summary
Fields Modifier and Type Field Description private EnergyFunction
f
TheEnergyFunction
forneighbors(Node)
.private Picture
picture
ThePicture
forneighbors(Node)
.private Node
sink
SinkNode
for the adjacency list graph.private Node
source
SourceNode
for the adjacency list graph.
-
Constructor Summary
Constructors Modifier Constructor Description private
PixelGraph(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
ThePicture
forneighbors(Node)
.
-
f
private final EnergyFunction f
TheEnergyFunction
forneighbors(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.
-
-