NewGravityOptions builds a new [GravityOptions] instance. It fills the [GravityOptions] struct with the options values under the given prefix. If the gravity type is not set in the options, it returns a [GravityOptions] with the provided default type.
(o *options.Options, prefix string, defType GravityType)
| 66 | // If the gravity type is not set in the options, |
| 67 | // it returns a [GravityOptions] with the provided default type. |
| 68 | func NewGravityOptions(o *options.Options, prefix string, defType GravityType) GravityOptions { |
| 69 | gr := GravityOptions{ |
| 70 | Type: options.Get(o, prefix+keys.SuffixType, defType), |
| 71 | X: o.GetFloat(prefix+keys.SuffixXOffset, 0.0), |
| 72 | Y: o.GetFloat(prefix+keys.SuffixYOffset, 0.0), |
| 73 | } |
| 74 | |
| 75 | return gr |
| 76 | } |
| 77 | |
| 78 | // RotateAndFlip rotates and flips the gravity options so that they correspond |
| 79 | // to the image before rotation and flipping. |
no test coverage detected