Ticket 789: Erroneous usage of gain/offset when processing data != UCHAR/CHAR