29 namespace OpenRaw {
namespace Internals {
31 using namespace Debug;
33 Unpack::Unpack(uint32_t w, uint32_t t)
39 size_t Unpack::block_size()
42 if(m_type == IFD::COMPRESS_NIKON_PACK) {
43 bs = (m_w / 2 * 3) + (m_w / 10);
56 size_t Unpack::unpack_be12to16(uint8_t *dest,
const uint8_t *src,
59 uint16_t *dest16 =
reinterpret_cast<uint16_t *
>(dest);
60 size_t pad = (m_type == IFD::COMPRESS_NIKON_PACK) ? 1 : 0;
61 size_t n = size / (15 + pad);
62 size_t rest = size % (15 + pad);
63 size_t ret = n * 20 + rest / 3 * 4;
68 assert (size % 16 == 0);
70 assert (rest % 3 == 0);
72 for (
size_t i = 0; i < n + 1; i++) {
73 size_t m = i == n ? rest / 3 : 5;
74 for(
size_t j = 0; j < m; j++) {
83 *dest16 = (t & (0xfff << 12)) >> 12;
CIFF is the container for CRW files. It is an attempt from Canon to make this a standard. I guess it failed.