Hi Yanli,
In the OpenDCX Nuke nodes there's DeepTransform.cpp which can be modified into a DeepReformat since it's primarily calculating a matrix and letting the Dcx::DeepTransform class do the work.
The main functional difference between DeepTransform and DeepReformat would be calculating a new output DD::Image::Format in validate() rather than copying the one from the input Op, which is relatively straightforward.
However I should say up front that we don't actively use DeepTransform in production at DreamWorks and at this point I consider it more of a proof-of-concept. While it works I'm not convinced additive partial-coverage subpixel masks are a scaleable and practical solution since they add yet another layer of complexity to sample interpretation and flattening while is already quite complex.
I was going to try reworking the DcxDeepTransform class to avoid needing partial-coverage samples but have not started that work yet.