Example #1
0
// UnParse the box out to the stream.
CNCSError CNCSJP2Box::UnParse(class CNCSJP2File &JP2File, CNCSJPCIOStream &Stream)
{
	CNCSError Error;

	// If length is > 2^32, need to write out the 64bit XLBox field.
	if(m_nXLBox > 0xffffffff) {
		// Will be writing XLBox, so write out 1 for the LBox field.
		Stream.WriteUINT32(1);
	} else {
		Stream.WriteUINT32((UINT32)m_nXLBox);
	}
	if(Stream.GetError() == NCS_SUCCESS) {
		// Write out the box type;
		if(Stream.WriteUINT32(m_nTBox) && m_nXLBox > 0xffffffff) {
			// Write out the XLBox field.
			Stream.WriteUINT64(m_nXLBox);
		}
		Error = Stream.GetError();
	}
	return(Error);
}
CNCSError JP2UUID3DNBox::UnParse(CNCSJP2File &JP2File, CNCSJPCIOStream &Stream)
{
    CNCSError Error;

    Error = CNCSJP2Box::UnParse(JP2File, Stream);
    NCSJP2_CHECKIO_BEGIN(Error, Stream);
    Stream.WriteIEEE8(_OrigMaxVal);
    Stream.WriteIEEE8(_OrigMinVal);
    Stream.WriteUINT32(_NormalizedMaxVal);
    Stream.WriteUINT32(_NormalizedMinVal);
    NCSJP2_CHECKIO_END();
    return(Error);
} // JP2UUID3DNBox::UnParse