| 290 | } |
| 291 | |
| 292 | @ApiStatus.Internal |
| 293 | public static void _validateResult(int result) { |
| 294 | switch (result) { |
| 295 | case 1: // kIncompleteInput |
| 296 | throw new IllegalArgumentException("Incomplete input: A partial image was generated."); |
| 297 | |
| 298 | case 2: // kErrorInInput |
| 299 | throw new IllegalArgumentException("Error in input"); |
| 300 | |
| 301 | case 3: // kInvalidConversion |
| 302 | throw new IllegalArgumentException("Invalid conversion: The generator cannot convert to match the request, ignoring dimensions"); |
| 303 | |
| 304 | case 4: // kInvalidScale |
| 305 | throw new IllegalArgumentException("Invalid scale: The generator cannot scale to requested size"); |
| 306 | |
| 307 | case 5: // kInvalidParameters |
| 308 | throw new IllegalArgumentException("Invalid parameter: Parameters (besides info) are invalid. e.g. NULL pixels, rowBytes too small, etc"); |
| 309 | |
| 310 | case 6: // kInvalidInput |
| 311 | throw new IllegalArgumentException("Invalid input: The input did not contain a valid image"); |
| 312 | |
| 313 | case 7: // kCouldNotRewind |
| 314 | throw new UnsupportedOperationException("Could not rewind: Fulfilling this request requires rewinding the input, which is not supported for this input"); |
| 315 | |
| 316 | case 8: // kInternalError |
| 317 | throw new RuntimeException("Internal error"); |
| 318 | |
| 319 | case 9: // kUnimplemented |
| 320 | throw new UnsupportedOperationException("Unimplemented: This method is not implemented by this codec"); |
| 321 | } |
| 322 | } |
| 323 | |
| 324 | @ApiStatus.Internal |
| 325 | public static class _FinalizerHolder { |