Page MenuHome

Image: Flip image operator
ClosedPublic

Authored by Pablo Dobarro (pablodp606) on Feb 4 2021, 5:35 PM.
Tags
None
Tokens
"Love" token, awarded by Blend_LOVER."Love" token, awarded by lopoIsaac."Love" token, awarded by Schamph.

Details

Summary

This implements an operator to flip the contents of an image buffer. It
supports flipping the image horizontally and vertically.

Diff Detail

Repository
rB Blender

Event Timeline

Pablo Dobarro (pablodp606) requested review of this revision.Feb 4 2021, 5:35 PM
Pablo Dobarro (pablodp606) created this revision.
Jacques Lucke (JacquesLucke) requested changes to this revision.Feb 4 2021, 5:44 PM

Haven't tried yet, but overall the code seems to make sense. I wonder, has there been a decision made somewhere to add this operator?

source/blender/editors/space_image/image_ops.c
2675

Comments should end with a ., same below.

2683

I think you might have to be careful with returning early because of BKE_image_release_ibuf.

2696

What does fp and cp stand for? I wouldn't mind a slighly more descriptive name.

2701

Haven't tried it, but it seems like this should be size_x - x - 1.

This revision now requires changes to proceed.Feb 4 2021, 5:44 PM
Pablo Dobarro (pablodp606) marked 3 inline comments as done.
  • Review update

I wonder, has there been a decision made somewhere to add this operator?

No as far as I know. This is just something I was trying to do yesterday and the functionality was not there. If the editor supports resize and invert, I don't see a reason for not supporting flipping.

source/blender/editors/space_image/image_ops.c
2696

This naming is used in other places in this file, I guess it refers to char_pixels and float_pixels. I can use those names for this operator if you think that is better.

Alright, seems to make sense.

I'll test the patch tomorrow.

source/blender/editors/space_image/image_ops.c
2696

Hm yes, I think char_pixels and float_pixels is better here.

Pablo Dobarro (pablodp606) marked an inline comment as done.
  • rename cp and fp to char_pixels and float_pixels

There was some discussion of a similar feature (display only) here: T48117

This revision is now accepted and ready to land.Feb 5 2021, 4:01 PM
This revision was automatically updated to reflect the committed changes.