You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The specification for the BytesPerPlaneIn/Out parameters of the cmsDoTransformLineStride is not clear for some cases and probably can be improved. As I understand cmsDoTransformXXX API:
"Case 1": If the image does not have any gaps between the pixels and lines -> pixel's stride is equal to the pixel's size and line's stride is equal to the "pixel's size" * "the number of pixels" -> the simple call to the cmsDoTransform() can be used.
"Case 2": If the lines in the image have some extra padding bytes then as suggested in the tutorial the cmsDoTransform() can be called in the loop per scanline or the cmsDoTransformLineStride can be used as suggested by the "Fast floating point plugin" doc.
"Case 3": If the pixels in the image have some extra padding bytes then cmsDoTransform() can be called in the loop per pixel, or the cmsDoTransformLineStride can be used.
For all cases above I tried to use the cmsDoTransformLineStride function, all its parameters are obvious except the BytesPerPlaneIn/Out. According to the documentation "BytesPerPlaneIn{In,Out}: The distance in bytes from one plane to the next one inside a line. Only applies in planar formats.":
Here are a few questions I think the documentation can clarify:
Can these parameters be ignored if "planar formats" are not used? if not then:
In the "Case 1" above, inside the cmsDoTransform these values are calculated as the "number of pixels" * "pixel's size" which is just all pixels in the image w/o gaps. But is it possible to calculate this value using the "public" CMSAPI? The PixelSize function used in the cmsDoTransform is not public.
What these values should contain for the "Case 2" above, when the line has only one "plane": should it be zero, should it be the "number of pixels in the line" * "pixel's size", or it should be equal to the BytesPerLine{In,Out}?
What these values should contain for the "Case 3" above, for example, if the pixels of TYPE_ARGB_8 format have 1-byte gap in between, should the 5 be used, which is "size of the pixel" + "size of the gap"?
Thank you for any clarification, probably I misread some docs.
The text was updated successfully, but these errors were encountered:
mrserb
changed the title
The specification for the cmsDoTransformLineStride/BytesPerPlaneIn/Out could be improved
The specification for the cmsDoTransformLineStride/BytesPerPlane{In,Out} could be improved
Apr 9, 2022
One more question about the "return" of this function. According to the tutorial in Little CMS2, there are no longer error handlers. When a function fails, it just returns the failure status. And there are many functions that actually return their status, but cmsDoTransformLineStride returns nothing, does it mean that it always passes? (assuming that the pointers/offsets are correct - and the app will just crash if pointers/offsets are incorrect)
The specification for the BytesPerPlaneIn/Out parameters of the cmsDoTransformLineStride is not clear for some cases and probably can be improved. As I understand cmsDoTransformXXX API:
cmsDoTransform()
can be used.cmsDoTransform()
can be called in the loop per scanline or thecmsDoTransformLineStride
can be used as suggested by the "Fast floating point plugin" doc.cmsDoTransform()
can be called in the loop per pixel, or thecmsDoTransformLineStride
can be used.For all cases above I tried to use the
cmsDoTransformLineStride
function, all its parameters are obvious except the BytesPerPlaneIn/Out. According to the documentation "BytesPerPlaneIn{In,Out}: The distance in bytes from one plane to the next one inside a line. Only applies in planar formats.":Here are a few questions I think the documentation can clarify:
cmsDoTransform
these values are calculated as the "number of pixels" * "pixel's size" which is just all pixels in the image w/o gaps. But is it possible to calculate this value using the "public" CMSAPI? ThePixelSize
function used in thecmsDoTransform
is not public.Thank you for any clarification, probably I misread some docs.
The text was updated successfully, but these errors were encountered: