| 68 | }; |
| 69 | |
| 70 | class ImageRandomCrop : public ImageTransformOp { |
| 71 | public: |
| 72 | ImageRandomCrop( |
| 73 | const std::string& ikey, |
| 74 | int64_t w, |
| 75 | int64_t h, |
| 76 | const std::string& okey = ""); |
| 77 | virtual std::shared_ptr<Array> apply_image( |
| 78 | const std::shared_ptr<const Array>& image) const override; |
| 79 | virtual std::shared_ptr<Array> apply_video( |
| 80 | const std::shared_ptr<const Array>& video) const override; |
| 81 | |
| 82 | private: |
| 83 | int64_t w_; |
| 84 | int64_t h_; |
| 85 | |
| 86 | struct Parameters { |
| 87 | int64_t tx; |
| 88 | int64_t ty; |
| 89 | int64_t tw; |
| 90 | int64_t th; |
| 91 | }; |
| 92 | |
| 93 | Parameters generate_random_crop_(int64_t w, int64_t h) const; |
| 94 | }; |
| 95 | |
| 96 | class ImageRandomAreaCrop : public ImageTransformOp { |
| 97 | public: |
nothing calls this directly
no outgoing calls
no test coverage detected