Is there a method or macro to get the band-format-size (in bytes)? #4133
Replies: 2 comments 21 replies
-
I have found another piece of documentation: vips_format_sizeof, which seems to do what I need. |
Beta Was this translation helpful? Give feedback.
-
Is there a similar macro to retrieve which band format belongs to a VipsInterpretation? I.e. how many bytes belong to the interpretations listed at VipsInterpretatation.org/API/current/VipsImage.html#VipsInterpretation). The reason is that I'm busy with test code that can easily switch from LAB (8-bit), LABS (16-bit) and HSV (8-bit) to e.g. check the impact of colorspaces on performance (brighten, gamma correction, tonelut (applies to in-max/out-max parameters) and saturation). For now tonelut is the one that needs to know in-max/out-max based on the provided interpretation. Of course, adjusting luminance is in LAB(S) on the L-channel (band[0]) and HSV is on the V-channel (band[2]). I really like if you can give a helpful hint. I even do not know whether tonelut can be applied to HSV images, as the documentation for tonelut .org/API/current/libvips-create.html#vips-tonelut) meanly speaks about LAB. |
Beta Was this translation helpful? Give feedback.
-
Just to calculate the amout of memory, I need something like 'how many bytes to a pixel occupy'. In pseudo code:
The band format size depends on the VipsBandFormat enum, see https://www.libvips.org/API/current/file-format.html, but I don't know whether there is a macro that returns the information I need. I'm not sure whether e.g. VIPS_IMAGE_SIZEOF_PEL can be used. Actually, when I know 'bytes-per-pixel', then I'm fine. Does libvips provide such macro (or method)?
Beta Was this translation helpful? Give feedback.
All reactions