All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.cloudinary.transformation.ParamsHelpers.kt Maven / Gradle / Ivy

//package com.cloudinary.transformation
//
//private fun widthParam(w: Any) = Param("width", "w", ParamValue(w, normalize = true))
//private fun heightParam(h: Any) = Param("height", "h", ParamValue(h, normalize = true))
//private fun aspectRatioParam(ar: Any) = Param("aspect_ratio", "ar", ParamValue(ar, normalize = true))
//private fun dprParam(dpr: Any) = Param("dpr", "dpr", ParamValue(dpr, normalize = true))
//private fun densityParam(density: Any) = Param("density", "dn", ParamValue(density))
//private fun xParam(x: Any) = Param("x", "x", ParamValue(x, normalize = true))
//private fun yParam(y: Any) = Param("y", "y", ParamValue(y, normalize = true))
//private fun zoomParam(zoom: Any) = Param("zoom", "z", ParamValue(zoom, normalize = true))
//private fun qualityParam(quality: Any) = Param("quality", "q", ParamValue(quality, normalize = true))
//private fun cropModeParam(cropMode: Any) = Param("crop", "c", ParamValue(cropMode))
//private fun gravityParam(cropMode: Any) = Param("gravity", "g", ParamValue(cropMode))
//private fun backgroundParam(value: Any) = Param("background", "b", ParamValue(value))
//private fun streamingProfileParam(profile: Any) = Param("streaming_profile", "sp", ParamValue(profile))
//private fun videoCodecParam(codec: Any) = Param("video_codec", "vc", ParamValue(codec))
//private fun effectParam(effect: Any) = Param("effect", "e", ParamValue(effect, normalize = true))
//private fun fpsParam(fps: Any) = Param("fps", "fps", ParamValue(fps))
//private fun audioCodecParam(codec: Any) = Param("audio_codec", "ac", ParamValue(codec))
//private fun audioFrequencyParam(frequency: Any) = Param("audio_frequency", "af", ParamValue(frequency))
//private fun bitRateParam(bitRate: Any) = Param("bit_rate", "br", ParamValue(bitRate))
//private fun defaultImageParam(publicId: Any) = Param("default_image", "d", ParamValue(publicId))
//private fun colorSpaceParam(colorSpace: Any) = Param("color_space", "cs", ParamValue(colorSpace))
//private fun keyframeIntervalParam(seconds: Any) = Param("keyframe_interval", "ki", ParamValue(seconds))
//private fun startOffsetParam(seconds: Any) = Param("start_offset", "so", ParamValue(seconds))
//private fun endOffsetParam(seconds: Any) = Param("end_offset", "eo", ParamValue(seconds))
//private fun durationParam(seconds: Any) = Param("duration", "du", ParamValue(seconds))
//private fun colorParam(color: Any) = Param("color", "co", color)
//private fun flagParam(flag: Any) = FlagsParam(flag)
//private fun videoSamplingParam(videoSampling: Any) = Param("video_sampling", "vs", videoSampling)
//private fun delayParam(delay: Any) = Param("delay", "dl", delay)
//private fun formatParam(format: Any) = Param("fetch_format", "f", format)
//private fun prefixParam(prefix: Any) = Param("prefix", "p", prefix)
//private fun fallbackImageParam(prefix: Any) = Param("default", "d", prefix)
//private fun namedTransformationParam(name: Any) = Param("named_transformation", "t", name)
//private fun angleParam(angles: Any) = Param("angle", "a", angles)
//private fun radiusParam(radii: Any) = Param("radius", "r", ParamValue(radii, normalize = true))
//private fun borderParam(border: Any) = Param("border", "bo", border)
//private fun opacityParam(opacity: Any) = Param("opacity", "o", ParamValue(opacity, normalize = true))
//
//internal fun Any.cldAsWidth() = widthParam(this)
//internal fun Any.cldAsHeight() = heightParam(this)
//internal fun Any.cldAsAspectRatio() = aspectRatioParam(this)
//internal fun Any.cldAsDpr() = dprParam(this)
//internal fun Any.cldAsDensity() = densityParam(this)
//internal fun Any.cldAsX() = xParam(this)
//internal fun Any.cldAsY() = yParam(this)
//internal fun Any.cldAsZoom() = zoomParam(this)
//internal fun Any.cldAsQuality() = qualityParam(this)
//internal fun Any.cldAsCropMode() = cropModeParam(this)
//internal fun Any.cldAsPage() = pageParam(this)
//internal fun Any.cldAsGravity() = gravityParam(this)
//internal fun Any.cldAsEffect() = effectParam(this)
//internal fun Any.cldAsVideoCodec() = videoCodecParam(this)
//internal fun Any.cldAsBackground() = backgroundParam(this)
//internal fun Any.cldAsStreamingProfile() = streamingProfileParam(this)
//internal fun Any.cldAsFps() = fpsParam(this)
//internal fun Any.cldAsAudioCodec() = audioCodecParam(this)
//internal fun Any.cldAsAudioFrequency() = audioFrequencyParam(this)
//internal fun Any.cldAsBitRate() = bitRateParam(this)
//internal fun Any.cldAsDefaultImage() = defaultImageParam(this)
//internal fun Any.cldAsColorSpace() = colorSpaceParam(this)
//internal fun Any.cldAsKeyframeInterval() = keyframeIntervalParam(this)
//internal fun Any.cldAsStartOffset() = startOffsetParam(this)
//internal fun Any.cldAsEndOffset() = endOffsetParam(this)
//internal fun Any.cldAsDuration() = durationParam(this)
//internal fun Any.cldAsColor() = colorParam(this)
//internal fun Any.cldAsFlag() = flagParam(this)
//internal fun Any.cldAsVideoSampling() = videoSamplingParam(this)
//internal fun Any.cldAsDelay() = delayParam(this)
//internal fun Any.cldAsFormat() = formatParam(this)
//internal fun Any.cldAsPrefix() = prefixParam(this)
//internal fun Any.cldAsFallbackImage() = fallbackImageParam(this)
//internal fun Any.cldAsNamedTransformation() = namedTransformationParam(this)
//internal fun Any.cldAsAngle() = angleParam(this)
//internal fun Any.cldAsRadius() = radiusParam(this)
//internal fun Any.cldAsBorder() = borderParam(this)
//internal fun Any.cldAsOpacity() = opacityParam(this)
//internal fun Any.asNamedValue(
//    name: String,
//    separator: String = DEFAULT_VALUES_SEPARATOR
//) =
//    NamedValue(name, this, separator)
//
//internal fun List.asAction() = ParamsAction(this)
//internal fun pageParam(page: Any) = Param("page", "pg", ParamValue(page))




© 2015 - 2024 Weber Informatics LLC | Privacy Policy