@@ -58,29 +58,25 @@ namespace ojph {
5858 // //////////////////////////////////////////////////////////////////////////
5959 void param_siz::set_image_extent (point dims)
6060 {
61- state->Xsiz = dims.x ;
62- state->Ysiz = dims.y ;
61+ state->set_image_extent (dims);
6362 }
6463
6564 // //////////////////////////////////////////////////////////////////////////
6665 void param_siz::set_tile_size (size s)
6766 {
68- state->XTsiz = s.w ;
69- state->YTsiz = s.h ;
67+ state->set_tile_size (s);
7068 }
7169
7270 // //////////////////////////////////////////////////////////////////////////
7371 void param_siz::set_image_offset (point offset)
74- { // WARNING need to check if these are valid
75- state->XOsiz = offset.x ;
76- state->YOsiz = offset.y ;
72+ {
73+ state->set_image_offset (offset);
7774 }
7875
7976 // //////////////////////////////////////////////////////////////////////////
8077 void param_siz::set_tile_offset (point offset)
81- { // WARNING need to check if these are valid
82- state->XTOsiz = offset.x ;
83- state->YTOsiz = offset.y ;
78+ {
79+ state->set_tile_offset (offset);
8480 }
8581
8682 // //////////////////////////////////////////////////////////////////////////
@@ -703,24 +699,24 @@ namespace ojph {
703699 if (file->read (&Ysiz, 4 ) != 4 )
704700 OJPH_ERROR (0x00050046 , " error reading SIZ marker" );
705701 Ysiz = swap_byte (Ysiz);
706- if (file->read (&XOsiz, 4 ) != 4 )
702+ ui32 t_XOsiz, t_YOsiz;
703+ if (file->read (&t_XOsiz, 4 ) != 4 )
707704 OJPH_ERROR (0x00050047 , " error reading SIZ marker" );
708- XOsiz = swap_byte (XOsiz);
709- if (file->read (&YOsiz, 4 ) != 4 )
705+ if (file->read (&t_YOsiz, 4 ) != 4 )
710706 OJPH_ERROR (0x00050048 , " error reading SIZ marker" );
711- YOsiz = swap_byte (YOsiz);
712- if (file->read (&XTsiz, 4 ) != 4 )
707+ set_image_offset (point (swap_byte (t_XOsiz), swap_byte (t_YOsiz)));
708+ ui32 t_XTsiz, t_YTsiz;
709+ if (file->read (&t_XTsiz, 4 ) != 4 )
713710 OJPH_ERROR (0x00050049 , " error reading SIZ marker" );
714- XTsiz = swap_byte (XTsiz);
715- if (file->read (&YTsiz, 4 ) != 4 )
711+ if (file->read (&t_YTsiz, 4 ) != 4 )
716712 OJPH_ERROR (0x0005004A , " error reading SIZ marker" );
717- YTsiz = swap_byte (YTsiz);
718- if (file->read (&XTOsiz, 4 ) != 4 )
713+ set_tile_size (size (swap_byte (t_XTsiz), swap_byte (t_YTsiz)));
714+ ui32 t_XTOsiz, t_YTOsiz;
715+ if (file->read (&t_XTOsiz, 4 ) != 4 )
719716 OJPH_ERROR (0x0005004B , " error reading SIZ marker" );
720- XTOsiz = swap_byte (XTOsiz);
721- if (file->read (&YTOsiz, 4 ) != 4 )
717+ if (file->read (&t_YTOsiz, 4 ) != 4 )
722718 OJPH_ERROR (0x0005004C , " error reading SIZ marker" );
723- YTOsiz = swap_byte (YTOsiz );
719+ set_tile_offset ( point ( swap_byte (t_XTOsiz), swap_byte (t_YTOsiz)) );
724720 if (file->read (&Csiz, 2 ) != 2 )
725721 OJPH_ERROR (0x0005004D , " error reading SIZ marker" );
726722 Csiz = swap_byte (Csiz);
@@ -745,6 +741,8 @@ namespace ojph {
745741
746742 ws_kern_support_needed = (Rsiz & 0x20 ) != 0 ;
747743 dfs_support_needed = (Rsiz & 0x80 ) != 0 ;
744+
745+ check_validity ();
748746 }
749747
750748 // ////////////////////////////////////////////////////////////////////////
0 commit comments