1234567891011121314151617181920212223 |
- package processing
- func rotateAndFlip(ctx *Context) error {
- if ctx.Angle%360 == 0 && ctx.PO.Rotate%360 == 0 && !ctx.Flip {
- return nil
- }
- if err := ctx.Img.CopyMemory(); err != nil {
- return err
- }
- if err := ctx.Img.Rotate(ctx.Angle); err != nil {
- return err
- }
- if ctx.Flip {
- if err := ctx.Img.Flip(); err != nil {
- return err
- }
- }
- return ctx.Img.Rotate(ctx.PO.Rotate)
- }
|