Skip to content

Instantly share code, notes, and snippets.

@ihnorton
Created November 19, 2013 06:06
Show Gist options
  • Select an option

  • Save ihnorton/7541011 to your computer and use it in GitHub Desktop.

Select an option

Save ihnorton/7541011 to your computer and use it in GitHub Desktop.
#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