@@ -114,13 +114,13 @@ private static function calculateBlackPoints(
114114 $ blackPoints [$ key ] = fill_array (0 , $ subWidth , 0 );
115115 }
116116 for ($ y = 0 ; $ y < $ subHeight ; $ y ++) {
117- $ yoffset = intval32bits ($ y << self ::$ BLOCK_SIZE_POWER );
117+ $ yoffset = ($ y << self ::$ BLOCK_SIZE_POWER );
118118 $ maxYOffset = $ height - self ::$ BLOCK_SIZE ;
119119 if ($ yoffset > $ maxYOffset ) {
120120 $ yoffset = $ maxYOffset ;
121121 }
122122 for ($ x = 0 ; $ x < $ subWidth ; $ x ++) {
123- $ xoffset = intval32bits ($ x << self ::$ BLOCK_SIZE_POWER );
123+ $ xoffset = ($ x << self ::$ BLOCK_SIZE_POWER );
124124 $ maxXOffset = $ width - self ::$ BLOCK_SIZE ;
125125 if ($ xoffset > $ maxXOffset ) {
126126 $ xoffset = $ maxXOffset ;
@@ -130,7 +130,7 @@ private static function calculateBlackPoints(
130130 $ max = 0 ;
131131 for ($ yy = 0 , $ offset = $ yoffset * $ width + $ xoffset ; $ yy < self ::$ BLOCK_SIZE ; $ yy ++, $ offset += $ width ) {
132132 for ($ xx = 0 ; $ xx < self ::$ BLOCK_SIZE ; $ xx ++) {
133- $ pixel = intval32bits ((int )($ luminances [(int )($ offset + $ xx )]) & 0xFF );
133+ $ pixel = ((int )($ luminances [(int )($ offset + $ xx )]) & 0xFF );
134134 $ sum += $ pixel ;
135135 // still looking for good contrast
136136 if ($ pixel < $ min ) {
@@ -145,14 +145,14 @@ private static function calculateBlackPoints(
145145 // finish the rest of the rows quickly
146146 for ($ yy ++, $ offset += $ width ; $ yy < self ::$ BLOCK_SIZE ; $ yy ++, $ offset += $ width ) {
147147 for ($ xx = 0 ; $ xx < self ::$ BLOCK_SIZE ; $ xx ++) {
148- $ sum += intval32bits ($ luminances [$ offset + $ xx ] & 0xFF );
148+ $ sum += ($ luminances [$ offset + $ xx ] & 0xFF );
149149 }
150150 }
151151 }
152152 }
153153
154154 // The default estimate is the average of the values in the block.
155- $ average = intval32bits ($ sum >> (self ::$ BLOCK_SIZE_POWER * 2 ));
155+ $ average = ($ sum >> (self ::$ BLOCK_SIZE_POWER * 2 ));
156156 if ($ max - $ min <= self ::$ MIN_DYNAMIC_RANGE ) {
157157 // If variation within the block is low, assume this is a block with only light or only
158158 // dark pixels. In that case we do not want to use the average, as it would divide this
@@ -199,13 +199,13 @@ private static function calculateThresholdForBlock(
199199 $ matrix
200200 ) {
201201 for ($ y = 0 ; $ y < $ subHeight ; $ y ++) {
202- $ yoffset = intval32bits ($ y << self ::$ BLOCK_SIZE_POWER );
202+ $ yoffset = ($ y << self ::$ BLOCK_SIZE_POWER );
203203 $ maxYOffset = $ height - self ::$ BLOCK_SIZE ;
204204 if ($ yoffset > $ maxYOffset ) {
205205 $ yoffset = $ maxYOffset ;
206206 }
207207 for ($ x = 0 ; $ x < $ subWidth ; $ x ++) {
208- $ xoffset = intval32bits ($ x << self ::$ BLOCK_SIZE_POWER );
208+ $ xoffset = ($ x << self ::$ BLOCK_SIZE_POWER );
209209 $ maxXOffset = $ width - self ::$ BLOCK_SIZE ;
210210 if ($ xoffset > $ maxXOffset ) {
211211 $ xoffset = $ maxXOffset ;
0 commit comments