byte alignment

M

Marco

Hi
I have to read a binary image.
Info tell me that it is a binary image without encoding but with RLE.
Also i know it is 4 bytes align.

What it means ?? How can i read it ??
I red it is for portability whit different microprocessor. is it right ??

How can i perform my 4 bytes in rle decode function when i have to check
first byte (length byte) to understand what i have to do with other bytes
???

tks
Marco
 
S

Sashi

Marco, your msg is a little cryptic. Could you clarify a little? If
possible, zip and mail me your image file: (e-mail address removed) and tell
me EXACTLY what it is you want to do with this file.
Sashi
 
A

Attila Feher

Marco said:
Hi
I have to read a binary image.
Info tell me that it is a binary image without encoding but with RLE.
Also i know it is 4 bytes align.

What it means ?? How can i read it ??
I red it is for portability whit different microprocessor. is it
right ??

How can i perform my 4 bytes in rle decode function when i have to
check first byte (length byte) to understand what i have to do with
other bytes ???

Hi,

Could you please reword? I have a hard time finding your C++ language
related question.
 
M

Marco

ok i tried to be more clear ( sorry english is not my language...;) )

I have a text file with image inside.
I have to read image.
I can read image data in a unsigned char buffer.

I know data image is not encoded, but it is compressed with Run-length
encode.
an information in file tell me that data image it is 4 byte alignment.
but i don't know what it means.

With oter image with same rle algorithm but with 1 byte alignment i have not
problem.
With this kind of data i do this...

value=*str++; // header byte
if (value<128)
{
n=value +1;
for (i=0;i<n;i++)
*dest++=*src++;
}
else
{
if (value>128)
{
n=257-value;
for (i=0;i<n;i++)
*dest=value;
*src++
}
else
// end of data
return;
}

cycle it does until i find 128 in header byte

Can anyone help me ????

Thank at all.
Marco
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top