protected void validatePicture ( MediaPicture picture ) { // if the picture is NULL, throw up if ( picture == null ) throw new IllegalArgumentException ( "The picture is NULL." ) ; // if the picture is not complete, throw up if ( ! picture . isComplete ( ) ) throw new IllegalArgumentException ( "The picture is not complete." ) ; // if the picture is an invalid type throw up PixelFormat . Type type = picture . getFormat ( ) ; if ( ( type != getPictureType ( ) ) && ( willResample ( ) && type != mToImageResampler . getOutputFormat ( ) ) ) throw new IllegalArgumentException ( "Picture is of type: " + type + ", but must be " + getPictureType ( ) + ( willResample ( ) ? " or " + mToImageResampler . getOutputFormat ( ) : "" ) + "." ) ; }
Test that the passed picture is valid and conforms to the converters specifications .