Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Q: cmsDoTransform(): using same buffer for in and out #93

Closed
LebedevRI opened this issue Aug 8, 2016 · 2 comments
Closed

Q: cmsDoTransform(): using same buffer for in and out #93

LebedevRI opened this issue Aug 8, 2016 · 2 comments

Comments

@LebedevRI
Copy link
Contributor

Hi.

Unfortunately LittleCMS2.7 tutorial.pdf is not verbose-enough.

I would like to get a clarification about:

It is safe to use same block for input and output, but only if the input and output are coded in
same format. For example, you can safely use only one buffer for RGB to RGB but you cannot use
same buffer for RGB as input and CMYK as output.

In particular, that does mean that i can not use the same buffer to convert from TYPE_RGBA_FLT to TYPE_LabA_FLT, but i can use the same buffer to convert from TYPE_RGBA_FLT to TYPE_RGBA_FLT?

@mm2
Copy link
Owner

mm2 commented Aug 8, 2016

You can reuse the same buffer as long as the output pixel size is same as input pixel size. So RGBA_FLT to LABA_FLT is ok, but CMYK_FLT to LAB_FLT is not.

The reason is the engine keeps two pointers, one for input and other output. If the output pixel size is less then the input pixel size, input will be overwritten when applying color transform.

@mm2 mm2 closed this as completed Aug 8, 2016
@LebedevRI
Copy link
Contributor Author

You can reuse the same buffer as long as the output pixel size is same as input pixel size.

Awesome!
Thank you for clarifying this. :)

LebedevRI added a commit to LebedevRI/darktable that referenced this issue Aug 8, 2016
mm2/Little-CMS#93

Alternatively, i should have at least factored alloc
out of all the loops, like in lens.c process()
LebedevRI added a commit to LebedevRI/darktable that referenced this issue Aug 8, 2016
mm2/Little-CMS#93

Alternatively, i should have at least factored alloc
out of all the loops, like in lens.c process()
LebedevRI added a commit to LebedevRI/darktable that referenced this issue Aug 8, 2016
mm2/Little-CMS#93

Alternatively, i should have at least factored alloc
out of all the loops, like in lens.c process()
LebedevRI added a commit to LebedevRI/darktable that referenced this issue Aug 8, 2016
mm2/Little-CMS#93

Alternatively, i should have at least factored alloc
out of all the loops, like in lens.c process()
LebedevRI added a commit to LebedevRI/darktable that referenced this issue Aug 8, 2016
mm2/Little-CMS#93

Alternatively, i should have at least factored alloc
out of all the loops, like in lens.c process()
LebedevRI added a commit to LebedevRI/darktable that referenced this issue Aug 8, 2016
mm2/Little-CMS#93

Alternatively, i should have at least factored alloc
out of all the loops, like in lens.c process()
LebedevRI added a commit to LebedevRI/darktable that referenced this issue Aug 8, 2016
mm2/Little-CMS#93

Alternatively, i should have at least factored alloc
out of all the loops, like in lens.c process()
LebedevRI added a commit to LebedevRI/darktable that referenced this issue Aug 8, 2016
mm2/Little-CMS#93

Alternatively, i should have at least factored alloc
out of all the loops, like in lens.c process()
LebedevRI added a commit to LebedevRI/darktable that referenced this issue Aug 9, 2016
mm2/Little-CMS#93

Alternatively, i should have at least factored alloc
out of all the loops, like in lens.c process(): no need fo
LebedevRI added a commit to LebedevRI/darktable that referenced this issue Aug 9, 2016
mm2/Little-CMS#93

Alternatively, i should have at least factored alloc
out of all the loops, like in lens.c process(): no need fo
LebedevRI added a commit to LebedevRI/darktable that referenced this issue Aug 9, 2016
mm2/Little-CMS#93

Alternatively, i should have at least factored alloc
out of all the loops, like in lens.c process(): no need fo
LebedevRI added a commit to LebedevRI/darktable that referenced this issue Aug 9, 2016
mm2/Little-CMS#93

Alternatively, i should have at least factored alloc
out of all the loops, like in lens.c process(): no need fo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants