I'm confused about image resolution. In my project sizeof
returns 4. It means that between one and the next pixel address is a 4 bytes. In other words i have RGBA format, 1 byte for each component? is it right? When i call CGImageGetBitsPerComponent
i get 8 bits (1 byte for component). But when i call CGImageGetBitsPerPixel
i get 8 bits. Why? I thought bitsPerPixel = (count of components) * bitsPerComponent
and this is equal to 4 bytes. How do I get 8 bits instead of 4 bytes? Please tell me someone. Thanks
Asked
Active
Viewed 48 times
0

user2032083
- 313
- 2
- 4
- 14
-
`sizeof WHAT` returns 4? – Mark Setchell Sep 10 '14 at 08:46
-
I understand that the result is 4 bytes, but I asked you WHAT you measured the `sizeof`. You didn't do `print("%i", sizeof(elephant))`, did you? WHAT did you measure the size of? – Mark Setchell Sep 10 '14 at 12:37
-
I didn't ask this. I don't understand why are the bitsForComponent equal 8 bits and bitsPerPixel have the same value. There are 4 components. – user2032083 Sep 10 '14 at 14:58