|
| 1 | +--- |
| 2 | +title: Constants |
| 3 | +description: 'Available constants for transformations and Cloudinary APIs' |
| 4 | +position: 14 |
| 5 | +category: "@cld-apis/utils" |
| 6 | +version: 1 |
| 7 | +--- |
| 8 | + |
| 9 | +To make it easier to use Cloudinary transformations, `@cld-apis/utils` provides a set of constants of common-use variables, and pre-defined values for specific transformations. |
| 10 | + |
| 11 | +## `RESOURCE_TYPES` |
| 12 | + |
| 13 | +Available types of resource for uploading in Cloudinary. |
| 14 | + |
| 15 | +## `STORAGE_TYPES` |
| 16 | + |
| 17 | +Storage/Delivery type of the asset stored in Cloudinary. |
| 18 | + |
| 19 | +## `RESIZE_TYPES` |
| 20 | + |
| 21 | +All the accepted cropping types when resizing an image/video. |
| 22 | + |
| 23 | +## `ROTATION_MODES` |
| 24 | + |
| 25 | +Available pre-defined modes for rotating an image/video. |
| 26 | + |
| 27 | +## Effects |
| 28 | + |
| 29 | +Pre-defined effects for transformations. |
| 30 | + |
| 31 | +### `ArtisticFilters` |
| 32 | + |
| 33 | +A set of accepted artistic filters when `effect.name` is `art`. |
| 34 | + |
| 35 | +```js |
| 36 | +import { ArtisticFilters } from '@cld-apis/utils' |
| 37 | +import { buildImageUrl } from 'cloudinary-build-url' |
| 38 | + |
| 39 | +const src = buildImageUrl('example', { |
| 40 | + transformations: { |
| 41 | + effect: { |
| 42 | + name: 'art', |
| 43 | + value: ArtisticFilters.Aurora |
| 44 | + } |
| 45 | + } |
| 46 | +}) |
| 47 | +``` |
| 48 | + |
| 49 | +### `BlurEffects` |
| 50 | + |
| 51 | +Available blur effects for `effect.name`. |
| 52 | + |
| 53 | +### `PixelateEffects` |
| 54 | + |
| 55 | +Available pixelate effects for `effect.name`. |
| 56 | + |
| 57 | +### `Colorblind` |
| 58 | + |
| 59 | +Available colorblind effects for `effect.name` to support a11y (accessibility). |
| 60 | + |
| 61 | +### `Brightness` |
| 62 | + |
| 63 | +Available brightness effects for `effect.name`. |
| 64 | + |
| 65 | +### `Contrast` |
| 66 | + |
| 67 | +Available contrast effects for `effect.name`. |
| 68 | + |
| 69 | +### `ColorChannel` |
| 70 | + |
| 71 | +Available color modification for effect. |
| 72 | + |
| 73 | +### `ColorFilter` |
| 74 | + |
| 75 | +Available color filtering effects. |
| 76 | + |
| 77 | +### `ColorAdjustment` |
| 78 | + |
| 79 | +Available color adjustment effects. |
| 80 | + |
| 81 | +## Flags |
| 82 | + |
| 83 | +Available flags to use with `flags`. |
| 84 | + |
| 85 | +## Gravity |
| 86 | + |
| 87 | +Available pre-defined gravity position for cropping, focusing using smart AI. |
| 88 | + |
| 89 | +## Compass |
| 90 | + |
| 91 | +Available pre-defined focusing direction for resizing images. |
| 92 | + |
| 93 | +## NamedColors |
| 94 | + |
| 95 | +Named colors that can be accepted for Cloudinary color transformations. |
0 commit comments