Philmoz, thumbnailing reversed raw is an excellent idea ! And I agree with you concerning the "beauty" of delegating task to reverse/dereverse bytes.
Reyalp, concerning increasing prioriry of writing task, I would keep writing task concurrently with reversing/dereversing tasks, writing having a higher priority than spytask and reversing/dereversing tasks.
Humm, my best suggestion to date :
In Spy Task :
- Patch Pixels b (correct raw data)
- Launch Memory Process Task
- Launch File Creation Task
- Wait tasks ending
In File Creation Task (higher priority than other) :
== Fill IFDs buffer, w/o thumbnail data
== Write Preambule (small but manage opening process)
== Launch progressive Reversed Raw writing task (write each reversed chunk [Reversed to Inverted])
== Launch progressive Thumbnail writing task (write each thumbnailed chunk [Thumbnailed to Thumbnail])
== Launch IFDs writing task (concurrent to De-reverse, if present)
In Memory Process Task (per memory chunk loop) :
== Reverse each chunk (chunk state change: Raw to Reversed)
== Fill Reversed Raw thumbnail buffer (chunk state change: Inverted to Thumbnailed)
== (if necessary) De-Reverse each chunk (chunk state change: Thumbnail to Raw)
File structure:
- Préambule
- Raw
- Thumb
- IFDs
I like that thread
P.S.: Memory process could be integrated to spytask !)