Products | Support | Send comments on this topic. | Email a link to this topic. | Back to Getting Started | Help Version 18.0.10.29
LEADTOOLS Color Conversion C++ Class Library Help

Alignment parameters

Show in webframe

Conversion functions, LColor::Convert, and LColor::ConvertDirect, take two alignment parameters, one for the input buffer, and the other one for the output buffer. Non-zero values for these parameters indicate that the input and output buffer's scanlines (rows of pixels) are padded with extra non-image bytes so that the total number of bytes in each scanline is a multiple of nInAlign (input buffer) or nOutAlign (output buffer).

For example, consider having a 3 column x 1 row CMY image buffer (9 bytes total) to be converted to RGB:

If the input buffer is not aligned and you need the output buffer to be aligned by 4 bytes (a memory need), call LColor::Convert, and LColor::ConvertDirect with:

nInAlign = 0
nOutAlign = 4

 

If the above 3 column x 1 row CMY input buffer is 4-bytes aligned (12 bytes total), and the output buffer is not to be aligned call LColor::Convert, and LColor::ConvertDirect with:

nInAlign = 4
nOutAlign = 0

 

If the above 3 column x 1 row CMY input buffer is 4-bytes aligned (12 bytes total), and the output buffer needs to be 4-bytes aligned, call LColor::Convert, and LColor::ConvertDirect with:

nInAlign = 4
nOutAlign = 4

 

Any other combination may be used for any supported color conversions. In any case the user should allocate enough memory for the actual pixels and the additional alignment bytes if any.

See Also:

Introduction

Programming with Color Conversion

Raster Image Functions: Color Conversion

Color Conversion Tutorials

Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.