Package com.cloudinary
Class Transformation<T extends Transformation>
java.lang.Object
com.cloudinary.Transformation<T>
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
EagerTransformation
public class Transformation<T extends Transformation>
extends java.lang.Object
implements java.io.Serializable
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.ObjectdefaultDPRprotected static booleandefaultIsResponsiveprotected booleanhiDPIprotected java.lang.StringhtmlHeightprotected java.lang.StringhtmlWidthprotected booleanisResponsiveprotected static java.util.MapresponsiveWidthTransformationprotected java.util.Maptransformationprotected java.util.List<java.util.Map>transformationsstatic java.lang.StringVAR_NAME_RE -
Constructor Summary
Constructors Constructor Description Transformation()Transformation(Transformation transformation)Transformation(java.util.List<java.util.Map> transformations) -
Method Summary
Modifier and Type Method Description Tangle(int value)Tangle(java.lang.String... value)TaspectRatio(double value)TaspectRatio(int nom, int denom)TaspectRatio(java.lang.String value)TaudioCodec(java.lang.String value)TaudioFrequency(int value)TaudioFrequency(java.lang.String value)Tbackground(java.lang.String value)TbitRate(int value)TbitRate(java.lang.String value)Tborder(int width, java.lang.String color)Tborder(java.lang.String value)Tchain()TchainWith(Transformation transformation)Tcolor(java.lang.String value)TcolorSpace(java.lang.String value)Tcrop(java.lang.String value)TcustomFunction(CustomFunction action)Set a custom action, such as a call to a lambda function or a web-assembly function.TcustomPreFunction(CustomFunction action)Set a custom pre-function, such as a call to a lambda function or a web-assembly function.TdefaultImage(java.lang.String value)Tdelay(java.lang.Object value)Tdensity(java.lang.Object value)Tdpr(float value)Tdpr(int value)Tdpr(java.lang.String value)Tduration(double value)Tduration(float value)Tduration(java.lang.String value)TdurationPercent(double value)TdurationPercent(float value)Teffect(java.lang.String value)Teffect(java.lang.String effect, java.lang.Object param)TendIf()TendOffset(double value)TendOffset(float value)TendOffset(java.lang.String value)TendOffsetPercent(double value)TendOffsetPercent(float value)TfetchFormat(java.lang.String value)Tflags(java.lang.String... value)Tfps(double value)fps (frames per second) parameter for videoTfps(int value)fps (frames per second) parameter for videoTfps(java.lang.Object rangeStart, java.lang.Object rangeEnd)fps (frames per second) parameter for videoTfps(java.lang.String value)fps (frames per second) parameter for videojava.lang.Stringgenerate()Serialize this transformation object as a stringjava.lang.Stringgenerate(java.lang.Iterable<java.util.Map> optionsList)java.lang.Stringgenerate(java.util.Map options)java.lang.StringgetHtmlHeight()java.lang.StringgetHtmlWidth()Tgravity(java.lang.String value)Theight(java.lang.Object value)ConditionifCondition()Start defining a condition, which will be completed with a callCondition.then()TifCondition(Condition condition)Define a conditional transformationTifCondition(Expression expression)Define a conditional transformationTifCondition(java.lang.String condition)Define a conditional transformation defined by the condition stringTifElse()booleanisHiDPI()booleanisResponsive()TkeyframeInterval(float value)Set the keyframe interval parameterTkeyframeInterval(java.lang.String value)Set the keyframe interval parameterTnamed(java.lang.String... value)Toffset(double[] value)Toffset(float[] value)Toffset(java.lang.Number[] value)Toffset(java.lang.String value)Toffset(java.lang.String[] value)Topacity(java.lang.Object value)Toverlay(AbstractLayer<?> value)Toverlay(java.lang.String value)Tpage(java.lang.Object value)Tparam(java.lang.String key, java.lang.Object value)Tparams(java.util.Map transformation)Tprefix(java.lang.String value)Tquality(java.lang.Object value)Tradius(java.lang.Object value)Add rounding transformation.Tradius(java.lang.Object[] cornerRadiuses)Add rounding transformation.Tradius(java.lang.Object topLeftBottomRight, java.lang.Object topRightBottomLeft)Add rounding transformation.Tradius(java.lang.Object topLeft, java.lang.Object topRightBottomLeft, java.lang.Object bottomRight)Add rounding transformation.Tradius(java.lang.Object topLeft, java.lang.Object topRight, java.lang.Object bottomRight, java.lang.Object bottomLeft)Add rounding transformation.TrawTransformation(java.lang.String value)TresponsiveWidth(boolean value)static voidsetDefaultDPR(java.lang.Object dpr)static voidsetDefaultIsResponsive(boolean isResponsive)static voidsetResponsiveWidthTransformation(java.util.Map transformation)TstartOffset(double value)TstartOffset(float value)TstartOffset(java.lang.String value)TstartOffsetPercent(double value)TstartOffsetPercent(float value)TstreamingProfile(java.lang.String value)java.lang.StringtoString()Tunderlay(AbstractLayer<?> value)Tunderlay(java.lang.String value)Tvariable(java.lang.String name, java.lang.Object value)Add a variable assignment.Tvariables(Expression... variables)Add a sequence of variable assignments.TvideoCodec(java.lang.String value)TvideoCodec(java.util.Map<java.lang.String,java.lang.String> value)TvideoSampling(java.lang.String value)TvideoSamplingFrames(int value)TvideoSamplingSeconds(double value)TvideoSamplingSeconds(float value)TvideoSamplingSeconds(int value)TvideoSamplingSeconds(java.lang.Number value)Twidth(java.lang.Object value)Tx(java.lang.Object value)Ty(java.lang.Object value)Tzoom(double value)Tzoom(float value)Tzoom(java.lang.String value)
-
Field Details
-
VAR_NAME_RE
public static final java.lang.String VAR_NAME_RE- See Also:
- Constant Field Values
-
transformation
protected java.util.Map transformation -
transformations
protected java.util.List<java.util.Map> transformations -
htmlWidth
protected java.lang.String htmlWidth -
htmlHeight
protected java.lang.String htmlHeight -
hiDPI
protected boolean hiDPI -
isResponsive
protected boolean isResponsive -
defaultIsResponsive
protected static boolean defaultIsResponsive -
defaultDPR
protected static java.lang.Object defaultDPR -
responsiveWidthTransformation
protected static java.util.Map responsiveWidthTransformation
-
-
Constructor Details
-
Transformation
-
Transformation
public Transformation(java.util.List<java.util.Map> transformations) -
Transformation
public Transformation()
-
-
Method Details
-
width
-
height
-
named
-
crop
-
background
-
color
-
effect
-
effect
-
angle
-
angle
-
border
-
border
-
x
-
y
-
radius
Add rounding transformation.Radius can be specified either as value in pixels or expression. Specify 0 to keep corner untouched.
- Parameters:
value- rounding radius for all four corners- Returns:
- updated transformation instance for chaining
-
radius
Add rounding transformation.Radius can be specified either as value in pixels or expression. Specify 0 to keep corner untouched.
- Parameters:
topLeftBottomRight- rounding radius for top-left and bottom-right cornerstopRightBottomLeft- rounding radius for top-right and bottom-left corners- Returns:
- updated transformation instance for chaining
-
radius
public T radius(java.lang.Object topLeft, java.lang.Object topRightBottomLeft, java.lang.Object bottomRight)Add rounding transformation.Radius can be specified either as value in pixels or expression. Specify 0 to keep corner untouched.
- Parameters:
topLeft- rounding radius for top-left cornertopRightBottomLeft- rounding radius for top-right and bottom-left cornersbottomRight- rounding radius for bottom-right corner- Returns:
- updated transformation instance for chaining
-
radius
public T radius(java.lang.Object topLeft, java.lang.Object topRight, java.lang.Object bottomRight, java.lang.Object bottomLeft)Add rounding transformation.Radius can be specified either as value in pixels or expression. Specify 0 to keep corner untouched.
- Parameters:
topLeft- rounding radius for top-left cornertopRight- rounding radius for top-right cornerbottomRight- rounding radius for bottom-right cornerbottomLeft- rounding radius for bottom-left corner- Returns:
- updated transformation instance for chaining
-
radius
Add rounding transformation.Radius can be specified either as value in pixels or expression. Specify 0 to keep corner untouched.
- Parameters:
cornerRadiuses- rounding radiuses for corners as array- Returns:
- updated transformation instance for chaining
-
quality
-
defaultImage
-
gravity
-
keyframeInterval
Set the keyframe interval parameter- Parameters:
value- Interval in seconds- Returns:
- The transformation for chaining
-
keyframeInterval
Set the keyframe interval parameter- Parameters:
value- Interval in seconds.- Returns:
- The transformation for chaining
-
colorSpace
-
prefix
-
overlay
-
overlay
-
underlay
-
underlay
-
fetchFormat
-
density
-
page
-
delay
-
opacity
-
rawTransformation
-
flags
-
dpr
-
dpr
-
dpr
-
duration
-
duration
-
duration
-
durationPercent
-
durationPercent
-
startOffset
-
startOffset
-
startOffset
-
startOffsetPercent
-
startOffsetPercent
-
endOffset
-
endOffset
-
endOffset
-
endOffsetPercent
-
endOffsetPercent
-
offset
-
offset
-
offset
-
offset
-
offset
-
videoCodec
-
videoCodec
-
audioCodec
-
audioFrequency
-
audioFrequency
-
bitRate
-
bitRate
-
videoSampling
-
videoSamplingFrames
-
videoSamplingSeconds
-
videoSamplingSeconds
-
videoSamplingSeconds
-
videoSamplingSeconds
-
zoom
-
zoom
-
zoom
-
aspectRatio
-
aspectRatio
-
aspectRatio
-
responsiveWidth
-
ifCondition
Start defining a condition, which will be completed with a callCondition.then()- Returns:
- condition
-
ifCondition
Define a conditional transformation defined by the condition string- Parameters:
condition- a condition string- Returns:
- the transformation for chaining
-
ifCondition
Define a conditional transformation- Parameters:
expression- a condition- Returns:
- the transformation for chaining
-
ifCondition
Define a conditional transformation- Parameters:
condition- a condition- Returns:
- the transformation for chaining
-
ifElse
-
endIf
-
fps
fps (frames per second) parameter for video- Parameters:
value- Either a single value int or float or a range in the format<start>[-<end>].
For example,23-29.7- Returns:
- the transformation for chaining
-
fps
fps (frames per second) parameter for video- Parameters:
value- the desired fps- Returns:
- the transformation for chaining
-
fps
fps (frames per second) parameter for video- Parameters:
value- the desired fps- Returns:
- the transformation for chaining
-
fps
fps (frames per second) parameter for video- Parameters:
rangeStart- String or Number, can be null for open range.rangeEnd- String or Number, can be null for open range.- Returns:
- the transformation for chaining.
-
streamingProfile
-
isResponsive
public boolean isResponsive() -
isHiDPI
public boolean isHiDPI() -
params
-
chain
-
chainWith
-
param
-
generate
public java.lang.String generate()Serialize this transformation object as a stringTransformation().width(100).height(101).generate(); // produces "h_101,w_100"- Returns:
- a String representation of the transformation
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
generate
public java.lang.String generate(java.lang.Iterable<java.util.Map> optionsList) -
generate
public java.lang.String generate(java.util.Map options) -
getHtmlWidth
public java.lang.String getHtmlWidth() -
getHtmlHeight
public java.lang.String getHtmlHeight() -
setResponsiveWidthTransformation
public static void setResponsiveWidthTransformation(java.util.Map transformation) -
setDefaultIsResponsive
public static void setDefaultIsResponsive(boolean isResponsive) -
setDefaultDPR
public static void setDefaultDPR(java.lang.Object dpr) -
variable
Add a variable assignment. Each call to this method will add a new variable assignments, but the order of the assignments may change. To enforce a particular order, usevariables(Expression...)- Parameters:
name- the name of the variablevalue- the value to assign to the variable- Returns:
- this for chaining
-
variables
Add a sequence of variable assignments. The order of the assignments will be honored.- Parameters:
variables- variable expressions- Returns:
- this for chaining
-
customFunction
Set a custom action, such as a call to a lambda function or a web-assembly function.- Parameters:
action- The custom action to perform, seeCustomFunction.- Returns:
- The transformation for chaining
-
customPreFunction
Set a custom pre-function, such as a call to a lambda function or a web-assembly function.- Parameters:
action- The custom action to perform, seeCustomFunction.- Returns:
- The transformation for chaining
-