Created
November 19, 2013 06:06
-
-
Save ihnorton/7541011 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stddef.h> | |
| //#include "jpeglib.h" | |
| #define MAX_COMPS_IN_SCAN 4 | |
| typedef struct { | |
| int comps_in_scan; /* number of components encoded in this scan */ | |
| int component_index[MAX_COMPS_IN_SCAN]; /* their SOF/comp_info[] indexes */ | |
| int Ss, Se; /* progressive JPEG spectral selection parms */ | |
| int Ah, Al; /* progressive JPEG successive approx. parms */ | |
| } jpeg_scan_info; | |
| int main(int argc, char** argv) | |
| { | |
| printf("jpeg_scan_info sizeof: %d\n", (int)sizeof(jpeg_scan_info)); | |
| printf(" : %d\n", offsetof(jpeg_scan_info, comps_in_scan)); | |
| printf(" : %d\n", offsetof(jpeg_scan_info, component_index)); | |
| printf(" : %d\n", offsetof(jpeg_scan_info, Ss)); | |
| printf(" : %d\n", offsetof(jpeg_scan_info, Se)); | |
| printf(" : %d\n", offsetof(jpeg_scan_info, Ah)); | |
| printf(" : %d\n", offsetof(jpeg_scan_info, Al)); | |
| //int component_index[MAX_COMPS_IN_SCAN]; | |
| //printf("sizeof(int component_index[MAX_COMPS_IN_SCAN]: %d\n", (int)sizeof(component_index)); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment