-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert imagepipeline-base/src/main/java/com/facebook/imageutils
Reviewed By: oprisnik Differential Revision: D59222625 fbshipit-source-id: 025e0c4e5a6d0a63864ed8431096e22ed81aa6d4
- Loading branch information
1 parent
14b630b
commit 572f320
Showing
7 changed files
with
63 additions
and
73 deletions.
There are no files selected for viewing
29 changes: 0 additions & 29 deletions
29
...line-base/src/main/java/com/facebook/imagepipeline/transcoder/ImageTranscoderFactory.java
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
...peline-base/src/main/java/com/facebook/imagepipeline/transcoder/ImageTranscoderFactory.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
package com.facebook.imagepipeline.transcoder | ||
|
||
import com.facebook.imageformat.ImageFormat | ||
|
||
interface ImageTranscoderFactory { | ||
|
||
/** | ||
* Creates an [ImageTranscoder] that enables or disables resizing depending on | ||
* `isResizingEnabled`. It can return null if the [ImageFormat] is not supported by this | ||
* [ImageTranscoder]. | ||
* | ||
* Note that if JPEG images are not supported, we will fallback to our native [ImageTranscoder] | ||
* implementation. | ||
* | ||
* @param imageFormat the [ImageFormat] of the input images. | ||
* @param isResizingEnabled true if resizing is allowed. | ||
* @return The [ImageTranscoder] or null if the image format is not supported. | ||
*/ | ||
fun createImageTranscoder(imageFormat: ImageFormat, isResizingEnabled: Boolean): ImageTranscoder? | ||
} |
41 changes: 0 additions & 41 deletions
41
imagepipeline-base/src/main/java/com/facebook/imagepipeline/transcoder/TranscodeStatus.java
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
imagepipeline-base/src/main/java/com/facebook/imagepipeline/transcoder/TranscodeStatus.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
package com.facebook.imagepipeline.transcoder | ||
|
||
import androidx.annotation.IntDef | ||
|
||
/** Status used by [ImageTranscodeResult] to supply additional information. */ | ||
@Retention(AnnotationRetention.SOURCE) | ||
@IntDef( | ||
TranscodeStatus.TRANSCODING_SUCCESS, | ||
TranscodeStatus.TRANSCODING_NO_RESIZING, | ||
TranscodeStatus.TRANSCODING_ERROR, | ||
) | ||
annotation class TranscodeStatus { | ||
companion object { | ||
/** Status flag to show that the image was transcoded successfully. */ | ||
/** Status flag to show that the image was transcoded successfully. */ | ||
const val TRANSCODING_SUCCESS: Int = 0 | ||
|
||
/** Status flag to show that the input image transcoded successfully without resizing. */ | ||
/** Status flag to show that the input image transcoded successfully without resizing. */ | ||
const val TRANSCODING_NO_RESIZING: Int = 1 | ||
|
||
/** Status flag to show that an error occurred while transcoding the image. */ | ||
/** Status flag to show that an error occurred while transcoding the image. */ | ||
const val TRANSCODING_ERROR: Int = 2 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters