|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.squareup.pollexor.Pollexor
public final class Pollexor
Fluent interface to create a URL appropriate for passing to Thumbor.
image(java.lang.String)| Nested Class Summary | |
|---|---|
static class |
Pollexor.HorizontalAlign
Horizontal alignment for crop positioning. |
static class |
Pollexor.UnableToBuildException
Exception denoting that a fatal error occurred while assembling the URL for the current configuration. |
static class |
Pollexor.VerticalAlign
Vertical alignment for crop positioning. |
| Method Summary | |
|---|---|
Pollexor |
align(Pollexor.HorizontalAlign align)
Set the horizontal alignment for the image when cropping. |
Pollexor |
align(Pollexor.VerticalAlign align)
Set the vertical alignment for the image when cropping. |
Pollexor |
align(Pollexor.VerticalAlign valign,
Pollexor.HorizontalAlign halign)
Set the horizontal and vertical alignment for the image when cropping. |
static String |
brightness(int amount)
This filter increases or decreases the image brightness. |
static String |
contrast(int amount)
The filter increases or decreases the image contrast. |
Pollexor |
crop(int top,
int left,
int bottom,
int right)
Crop the image between two points. |
static String |
fill(int color)
This filter permit to return an image sized exactly as requested wherever is its ratio by filling with chosen color the missing parts. |
Pollexor |
filter(String... filters)
Add one or more filters to the image. |
Pollexor |
fitIn()
Contrain the image size inside the resized box, scaling as needed. |
Pollexor |
flipHorizontally()
Flip the image horizontally. |
Pollexor |
flipVertically()
Flip the image vertically. |
static String |
frame(String imageUrl)
This filter uses a 9-patch to overlay the image. |
Pollexor |
host(String host)
Set a host to prepend to URL for a full URL output. |
static Pollexor |
image(String target)
Start building an image URL for Thumbor. |
Pollexor |
key(String key)
Set a key for secure URL generation. |
Pollexor |
legacy()
Use legacy encryption when constructing a safe URL. |
static String |
noise(int amount)
This filter adds noise to the image. |
static String |
quality(int amount)
This filter changes the overall quality of the JPEG image (does nothing for PNGs or GIFs). |
Pollexor |
resize(int width,
int height)
Resize picture to desired size. |
static String |
rgb(int r,
int g,
int b)
This filter changes the amount of color in each of the three channels. |
static String |
roundCorner(int radius)
This filter adds rounded corners to the image using the white as the background. |
static String |
roundCorner(int radius,
int color)
This filter adds rounded corners to the image using the specified color as the background. |
static String |
roundCorner(int radiusInner,
int radiusOuter,
int color)
This filter adds rounded corners to the image using the specified color as the background. |
static String |
sharpen(float amount,
float radius,
boolean luminanceOnly)
This filter enhances apparent sharpness of the image. |
Pollexor |
smart()
Use smart cropping for determining the important portion of an image. |
static String |
stripicc()
This filter strips the ICC profile from the image. |
String |
toMeta()
Build the metadata URL. |
String |
toMetaSafe()
Build a safe version of the metadata URL. |
String |
toMetaUnsafe()
Build an unsafe version of the metadata URL. |
String |
toString()
|
String |
toUrl()
Build the URL. |
String |
toUrlSafe()
Build a safe version of the URL. |
String |
toUrlUnsafe()
Build an unsafe version of the URL. |
static String |
watermark(Pollexor image)
This filter adds a watermark to the image at (0, 0). |
static String |
watermark(Pollexor image,
int x,
int y)
This filter adds a watermark to the image. |
static String |
watermark(Pollexor image,
int x,
int y,
int transparency)
This filter adds a watermark to the image. |
static String |
watermark(String imageUrl)
This filter adds a watermark to the image at (0, 0). |
static String |
watermark(String imageUrl,
int x,
int y)
This filter adds a watermark to the image. |
static String |
watermark(String imageUrl,
int x,
int y,
int transparency)
This filter adds a watermark to the image. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static Pollexor image(String target)
target - Target image to manipulate.
Pollexor.UnableToBuildException - if target is blank.public Pollexor key(String key)
toUrl() and toMeta() to build safe
URLs.
key - Security key for remote server.
Pollexor.UnableToBuildException - if key is blank.public Pollexor host(String host)
host - Host name.
Pollexor.UnableToBuildException - if host is blank.
public Pollexor resize(int width,
int height)
width - Desired width.height - Desired height.
Pollexor.UnableToBuildException - if width or height is less than 1.public Pollexor flipHorizontally()
Pollexor.UnableToBuildException - if image has not been marked for resize.public Pollexor flipVertically()
Pollexor.UnableToBuildException - if image has not been marked for resize.public Pollexor fitIn()
Pollexor.UnableToBuildException - if image has not been marked for resize.
public Pollexor crop(int top,
int left,
int bottom,
int right)
top - Top bound.left - Left bound.bottom - Bottom bound.right - Right bound.
Pollexor.UnableToBuildException - if top or left are less than zero or bottom or
right are less than one or less than top or left,
respectively.public Pollexor align(Pollexor.HorizontalAlign align)
align - Horizontal alignment.
Pollexor.UnableToBuildException - if image has not been marked for crop.public Pollexor align(Pollexor.VerticalAlign align)
align - Vertical alignment.
Pollexor.UnableToBuildException - if image has not been marked for crop.
public Pollexor align(Pollexor.VerticalAlign valign,
Pollexor.HorizontalAlign halign)
valign - Vertical alignment.halign - Horizontal alignment.
Pollexor.UnableToBuildException - if image has not been marked for crop.public Pollexor smart()
Pollexor.UnableToBuildException - if image has not been marked for crop.public Pollexor legacy()
public Pollexor filter(String... filters)
Add one or more filters to the image.
If you have custom filters you can supply them as a string. (e.g. "my_filter(1,2,3)").
filters - Filter strings.
Pollexor.UnableToBuildException - if no arguments supplied or an argument is null.brightness(int),
contrast(int),
fill(int),
frame(String),
noise(int),
quality(int),
rgb(int, int, int),
roundCorner(int),
roundCorner(int, int),
roundCorner(int, int, int),
sharpen(float, float, boolean),
watermark(String),
watermark(Pollexor),
watermark(String, int, int),
watermark(Pollexor, int, int),
watermark(String, int, int, int),
watermark(Pollexor, int, int, int)public String toUrl()
toUrlSafe() or toUrlUnsafe() depending on whether
key(String) was set.
Pollexor.UnableToBuildExceptionpublic String toUrlUnsafe()
public String toUrlSafe()
key(String).
Pollexor.UnableToBuildExceptionpublic String toMeta()
toMetaSafe() or toMetaUnsafe() depending on whether
key(String) was set.
Pollexor.UnableToBuildExceptionpublic String toMetaUnsafe()
public String toMetaSafe()
key(String).
Pollexor.UnableToBuildExceptionpublic String toString()
toString in class Objectpublic static String brightness(int amount)
amount - -100 to 100 - The amount (in %) to change the image brightness. Positive numbers
make the image brighter and negative numbers make the image darker.
Pollexor.UnableToBuildException - if amount outside bounds.public static String contrast(int amount)
amount - -100 to 100 - The amount (in %) to change the image contrast. Positive numbers
increase contrast and negative numbers decrease contrast.
Pollexor.UnableToBuildException - if amount outside bounds.public static String noise(int amount)
amount - 0 to 100 - The amount (in %) of noise to add to the image.
Pollexor.UnableToBuildException - if amount outside bounds.public static String quality(int amount)
amount - 0 to 100 - The quality level (in %) that the end image will feature.
Pollexor.UnableToBuildException - if amount outside bounds.
public static String rgb(int r,
int g,
int b)
r - The amount of redness in the picture. Can range from -100 to 100 in percentage.g - The amount of greenness in the picture. Can range from -100 to 100 in percentage.b - The amount of blueness in the picture. Can range from -100 to 100 in percentage.
Pollexor.UnableToBuildException - if r, g, or b are outside of bounds.public static String roundCorner(int radius)
radius - amount of pixels to use as radius.
public static String roundCorner(int radius,
int color)
radius - amount of pixels to use as radius.color - fill color for clipped region.
public static String roundCorner(int radiusInner,
int radiusOuter,
int color)
radiusInner - amount of pixels to use as radius.radiusOuter - specifies the second value for the ellipse used for the radius. Use 0 for
no value.color - fill color for clipped region.public static String watermark(String imageUrl)
imageUrl - Watermark image URL. It is very important to understand that the same image
loader that Thumbor uses will be used here.
Pollexor.UnableToBuildException - if image is blank.public static String watermark(Pollexor image)
image - Watermark image URL. It is very important to understand that the same image
loader that Thumbor uses will be used here.
Pollexor.UnableToBuildException - if image is null.
public static String watermark(String imageUrl,
int x,
int y)
imageUrl - Watermark image URL. It is very important to understand that the same image
loader that Thumbor uses will be used here.x - Horizontal position that the watermark will be in. Positive numbers indicate position
from the left and negative numbers indicate position from the right.y - Vertical position that the watermark will be in. Positive numbers indicate position
from the top and negative numbers indicate position from the bottom.
Pollexor.UnableToBuildException - if image is blank.
public static String watermark(Pollexor image,
int x,
int y)
image - Watermark image URL. It is very important to understand that the same image
loader that Thumbor uses will be used here.x - Horizontal position that the watermark will be in. Positive numbers indicate position
from the left and negative numbers indicate position from the right.y - Vertical position that the watermark will be in. Positive numbers indicate position
from the top and negative numbers indicate position from the bottom.
Pollexor.UnableToBuildException - if image is null.
public static String watermark(String imageUrl,
int x,
int y,
int transparency)
imageUrl - Watermark image URL. It is very important to understand that the same image
loader that Thumbor uses will be used here.x - Horizontal position that the watermark will be in. Positive numbers indicate position
from the left and negative numbers indicate position from the right.y - Vertical position that the watermark will be in. Positive numbers indicate position
from the top and negative numbers indicate position from the bottom.transparency - Watermark image transparency. Should be a number between 0 (fully opaque)
and 100 (fully transparent).
Pollexor.UnableToBuildException - if image is blank or transparency is outside bounds.
public static String watermark(Pollexor image,
int x,
int y,
int transparency)
image - Watermark image URL. It is very important to understand that the same image
loader that Thumbor uses will be used here.x - Horizontal position that the watermark will be in. Positive numbers indicate position
from the left and negative numbers indicate position from the right.y - Vertical position that the watermark will be in. Positive numbers indicate position
from the top and negative numbers indicate position from the bottom.transparency - Watermark image transparency. Should be a number between 0 (fully opaque)
and 100 (fully transparent).
Pollexor.UnableToBuildException - if image is null.
public static String sharpen(float amount,
float radius,
boolean luminanceOnly)
amount - Sharpen amount. Typical values are between 0.0 and 10.0.radius - Sharpen radius. Typical values are between 0.0 and 2.0.luminanceOnly - Sharpen only luminance channel.public static String fill(int color)
color - integer representation of color.public static String frame(String imageUrl)
imageUrl - Watermark image URL. It is very important to understand that the same image
loader that Thumbor uses will be used here.public static String stripicc()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||