* Coordinates (x-axis & y-axis) of crop selection zone. */ public function getAxisCoordinates(array $axis, array $crop_selection); /** * Get the size and position of the crop. * * @param array $field_values * The original values of image. * @param array $properties * The original height of image. * * @return null|array * The data dimensions (width & height) into this ImageStyle. */ public function getCropOriginalDimension(array $field_values, array $properties); /** * Get one effect instead of ImageStyle. * * @param \Drupal\image\Entity\ImageStyle $image_style * The ImageStyle to get data. * @param string $data_type * The type of data needed in current ImageStyle. * * @return mixed|null * The effect data in current ImageStyle. */ public function getEffectData(ImageStyle $image_style, $data_type); /** * Get the imageStyle using this crop_type. * * @param string $crop_type_name * The id of the current crop_type entity. * * @return array * All imageStyle used by this crop_type. */ public function getImageStylesByCrop($crop_type_name); /** * Apply different operation on ImageStyles. * * @param array $image_styles * All ImageStyles used by this cropType. * @param string $file_uri * Uri of image uploaded by user. * @param bool $create_derivative * Boolean to create an derivative of the image uploaded. */ public function imageStylesOperations(array $image_styles, $file_uri, $create_derivative = FALSE); /** * Update existent crop entity properties. * * @param \Drupal\crop\Entity\Crop $crop * The crop object loaded. * @param array $crop_properties * The machine name of ImageStyle. */ public function updateCropProperties(Crop $crop, array $crop_properties); /** * Load all crop using the ImageStyles. * * @param array $image_styles * All ImageStyle for this current CROP. * @param CropType $crop_type * The entity CropType. * @param string $file_uri * Uri of uploded file. * * @return array * All crop used this ImageStyle. */ public function loadImageStyleByCrop(array $image_styles, CropType $crop_type, $file_uri); /** * Compare crop zone properties when user saved one crop. * * @param array $crop_properties * The crop properties after saved the form. * @param array $old_crop * The crop properties save in this crop entity, * Only if this crop already exist. * * @return bool * Return true if properties is not identical. */ public function cropHasChanged(array $crop_properties, array $old_crop); /** * Verify if ImageStyle is correctly configured. * * @param array $styles * The list of available ImageStyle. * * @return array * The list of styles filtred. */ public function getAvailableCropImageStyle(array $styles); /** * Verify if the crop is used by a ImageStyle. * * @param array $crop_list * The list of existent Crop Type. * * @return array * The list of Crop Type filtred. */ public function getAvailableCropType(array $crop_list); /** * Get All sizes properties of the crops for an file. * * @param \Drupal\crop\Entity\Crop $crop * All crops attached to this file based on URI. * * @return array * Get all crop zone properties (x, y, height, width), */ public static function getCropProperties(Crop $crop); /** * Fetch all fields FileField and use "image_crop" element on an entity. * * @param \Drupal\Core\Entity\EntityInterface $entity * The entity object. */ public function buildCropToEntity(EntityInterface $entity); /** * Fetch all form elements using image_crop element. * * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ public function buildCropToForm(FormStateInterface $form_state); }