pedrocr / rawloader

rust library to extract the raw data and some metadata from digital camera images
GNU Lesser General Public License v2.1
304 stars 53 forks source link

Add automatic rotation of images that contain orientation data #2

Closed runfalk closed 7 years ago

runfalk commented 7 years ago

I have added automatic rotation when decoding a RawImage. Right now it is implemented as a separate image operation rather than being part of the demosaic step. I have experimented with in-situ rotation vs creating a new OpBuffer and found creating a new one to be more performant due to that it is easy to use rayon's parallell iterators.

Criticism is welcome.

runfalk commented 7 years ago

All right. I have changed things around and put orientation onto the Camera object as well. Since we are now cloning them, I reworked the explicit lifetime 'a for them. The ok_image, RawImage and their likes now consumes a Camera instance instead of holding onto a reference.

I think this is a better solution since explicit lifetimes can be avoided, though I don't know what the original intention behind passing a reference around was.

pedrocr commented 7 years ago

From the conversion we just had on IRC this is probably ready to merge once the whitespace changes are fixed. Do you have anything else you want to fix before I merge?

runfalk commented 7 years ago

I've squashed all changes to a single commit that doesn't modify whitespace. I'm all for merging this and make other improvements in other pull requests.