|
PointSet | AddRing (string name, PointF[] points) |
|
bool | ContainsRing (string name) |
|
PointSet | AddRing (string name, BoxPadding padding) |
| Inflates the last ring using the specified padding options. Returns the resulting ring object More...
|
|
PointSet | AddInvisiblePolygon (string name, PointF[] points) |
| Add points this way to see where they will occur on the destination image More...
|
|
PointSet | AddIgnoredPoints (string name, PointF[] points) |
|
RectangleF | GetBoundingBox () |
| Gets a bounding box that encloses all rings that don't have ExcludeFromBoundingBox set. More...
|
|
void | Rotate (double degrees, PointF origin) |
| Rotates all existing rings (Except those flagged ignore) More...
|
|
void | Normalize (PointF origin) |
| Normalizes all rings and invisible polygons so that the outermost ring's bounding box starts at the specified orign. More...
|
|
void | Round () |
|
void | Scale (double factor, PointF origin) |
| Scales all rings and invisible polygons by the specified factor, around the specified point. More...
|
|
void | Shift (RectangleF from, RectangleF to) |
| Translates and scales all rings and invisible polygons as specified. More...
|
|
|
Dictionary< string, PointSet > | ring = new Dictionary<string, PointSet>(10, StringComparer.OrdinalIgnoreCase) |
| An ordered, named collection of polygons. pointsToTranslate, imageOuterEdge, imageAreaOuterEdge. More...
|
|
List< PointSet > | ringList = new List<PointSet>(10) |
|
Definition at line 9 of file LayoutBuilder.cs.
Enumerator |
---|
Ring |
This polygon participates in the layout phase, and reserves space when added. Affected by all batch operations. Will be returned by LastRing until a new ring is added.
|
Invisible |
Doesn't participate in layout, takes no space, but is affected by batch operations. Will never be returned by LastRing and ignored when calculating bounding boxes.
|
Ignored |
Completely ignored by all operations, left intact.
|
Definition at line 11 of file LayoutBuilder.cs.
This polygon participates in the layout phase, and reserves space when added. Affected by all batch o...
Doesn't participate in layout, takes no space, but is affected by batch operations. Will never be returned by LastRing and ignored when calculating bounding boxes.
Completely ignored by all operations, left intact.
PointSet ImageResizer.Resizing.LayoutBuilder.AddInvisiblePolygon |
( |
string |
name, |
|
|
PointF[] |
points |
|
) |
| |
|
inline |
Add points this way to see where they will occur on the destination image
- Parameters
-
- Returns
Definition at line 114 of file LayoutBuilder.cs.
115 PointSet ps =
new PointSet(points);
116 ps.flags = PointFlags.Invisible;
Inflates the last ring using the specified padding options. Returns the resulting ring object
- Parameters
-
- Returns
Definition at line 105 of file LayoutBuilder.cs.
PointSet LastRing
Returns the last ring that was added. Only returns PointSets where flags = Ring
static PointF[] InflatePoly(PointF[] poly, float offset)
Expands all sides on the specified polygon by the specified offset. Assumes the polygon is concave...
Defines a collection of utility functions for manipulating polygons. These functions may be (re)moved...
RectangleF ImageResizer.Resizing.LayoutBuilder.GetBoundingBox |
( |
| ) |
|
|
inline |
Gets a bounding box that encloses all rings that don't have ExcludeFromBoundingBox set.
- Returns
Definition at line 133 of file LayoutBuilder.cs.
Referenced by ImageResizer.ImageBuilder.EndLayout().
134 List<PointF> points =
new List<PointF>(ring.Count * 5);
136 foreach (PointSet val
in ringList) {
137 if (val.flags ==
PointFlags.Ring) points.AddRange(val.points);
139 return PolygonMath.GetBoundingBox(points.ToArray());
void ImageResizer.Resizing.LayoutBuilder.Normalize |
( |
PointF |
origin | ) |
|
|
inline |
Normalizes all rings and invisible polygons so that the outermost ring's bounding box starts at the specified orign.
- Parameters
-
- Returns
Definition at line 158 of file LayoutBuilder.cs.
Referenced by ImageResizer.ImageBuilder.LayoutNormalize().
163 foreach (PointSet ps
in ringList)
164 if (ps.flags !=
PointFlags.Ignored) ps.points = PolygonMath.MovePoly(ps.points, offset);
RectangleF GetBoundingBox()
Gets a bounding box that encloses all rings that don't have ExcludeFromBoundingBox set...
void ImageResizer.Resizing.LayoutBuilder.Rotate |
( |
double |
degrees, |
|
|
PointF |
origin |
|
) |
| |
|
inline |
void ImageResizer.Resizing.LayoutBuilder.Scale |
( |
double |
factor, |
|
|
PointF |
origin |
|
) |
| |
|
inline |
Scales all rings and invisible polygons by the specified factor, around the specified point.
- Parameters
-
Definition at line 178 of file LayoutBuilder.cs.
179 foreach (PointSet ps
in ringList)
180 if (ps.flags !=
PointFlags.Ignored) ps.points = PolygonMath.ScalePoints(ps.points, factor,factor, origin);
void ImageResizer.Resizing.LayoutBuilder.Shift |
( |
RectangleF |
from, |
|
|
RectangleF |
to |
|
) |
| |
|
inline |
Translates and scales all rings and invisible polygons as specified.
- Parameters
-
Definition at line 188 of file LayoutBuilder.cs.
190 PointF fromOrigin =
new PointF(from.X + (from.Width /2), from.Y + (from.Height /2));
191 PointF toOrigin =
new PointF(to.X + (to.Width /2), to.Y + (to.Height /2));
193 PointF offset =
new PointF(toOrigin.X - fromOrigin.X,toOrigin.Y - fromOrigin.Y);
194 double xd = to.Width / from.Width;
195 double yd = to.Height / from.Height;
198 foreach (PointSet ps
in ringList)
199 if (ps.flags !=
PointFlags.Ignored) ps.points = PolygonMath.MovePoly(ps.points,offset );
201 foreach (PointSet ps
in ringList)
202 if (ps.flags !=
PointFlags.Ignored) ps.points = PolygonMath.ScalePoints(ps.points, xd,yd, toOrigin );
Dictionary<string, PointSet> ImageResizer.Resizing.LayoutBuilder.ring = new Dictionary<string, PointSet>(10, StringComparer.OrdinalIgnoreCase) |
|
protected |
An ordered, named collection of polygons. pointsToTranslate, imageOuterEdge, imageAreaOuterEdge.
Definition at line 59 of file LayoutBuilder.cs.
PointSet ImageResizer.Resizing.LayoutBuilder.LastRing |
|
get |
PointF [] ImageResizer.Resizing.LayoutBuilder.this[string key] |
|
getset |
Access and set the Point[] arrays of rings by key. Case-insensitive.
- Parameters
-
- Returns
Definition at line 66 of file LayoutBuilder.cs.
The documentation for this class was generated from the following file: