Dichen Zhang | 85b3756 | 2022-10-11 11:08:28 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2022 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include <jpegrecoverymap/recoverymap.h> |
| 18 | |
| 19 | namespace android::recoverymap { |
| 20 | |
Dichen Zhang | 6947d53 | 2022-10-22 02:16:21 +0000 | [diff] [blame^] | 21 | status_t RecoveryMap::encodeJPEGR(jr_uncompressed_ptr uncompressed_p010_image, |
| 22 | jr_uncompressed_ptr uncompressed_yuv_420_image, |
| 23 | void* dest) { |
| 24 | if (uncompressed_p010_image == nullptr |
| 25 | || uncompressed_yuv_420_image == nullptr |
| 26 | || dest == nullptr) { |
| 27 | return BAD_VALUE; |
| 28 | } |
| 29 | |
| 30 | // TBD |
| 31 | return NO_ERROR; |
| 32 | } |
| 33 | |
| 34 | status_t RecoveryMap::encodeJPEGR(jr_uncompressed_ptr uncompressed_p010_image, |
| 35 | jr_uncompressed_ptr uncompressed_yuv_420_image, |
| 36 | void* compressed_jpeg_image, |
| 37 | void* dest) { |
| 38 | |
| 39 | if (uncompressed_p010_image == nullptr |
| 40 | || uncompressed_yuv_420_image == nullptr |
| 41 | || compressed_jpeg_image == nullptr |
| 42 | || dest == nullptr) { |
| 43 | return BAD_VALUE; |
| 44 | } |
| 45 | |
| 46 | // TBD |
| 47 | return NO_ERROR; |
| 48 | } |
| 49 | |
| 50 | status_t RecoveryMap::encodeJPEGR(jr_uncompressed_ptr uncompressed_p010_image, |
| 51 | void* compressed_jpeg_image, |
| 52 | void* dest) { |
| 53 | if (uncompressed_p010_image == nullptr |
| 54 | || compressed_jpeg_image == nullptr |
| 55 | || dest == nullptr) { |
| 56 | return BAD_VALUE; |
| 57 | } |
| 58 | |
| 59 | // TBD |
| 60 | return NO_ERROR; |
| 61 | } |
| 62 | |
| 63 | status_t RecoveryMap::decodeJPEGR(void* compressed_jpegr_image, jr_uncompressed_ptr dest) { |
| 64 | if (compressed_jpegr_image == nullptr || dest == nullptr) { |
| 65 | return BAD_VALUE; |
| 66 | } |
| 67 | |
| 68 | // TBD |
| 69 | return NO_ERROR; |
| 70 | } |
| 71 | |
| 72 | status_t RecoveryMap::decodeRecoveryMap(jr_compressed_ptr compressed_recovery_map, |
| 73 | jr_uncompressed_ptr dest) { |
Dichen Zhang | 596a756 | 2022-10-12 14:57:05 -0700 | [diff] [blame] | 74 | if (compressed_recovery_map == nullptr || dest == nullptr) { |
Dichen Zhang | 6947d53 | 2022-10-22 02:16:21 +0000 | [diff] [blame^] | 75 | return BAD_VALUE; |
Dichen Zhang | 596a756 | 2022-10-12 14:57:05 -0700 | [diff] [blame] | 76 | } |
| 77 | |
| 78 | // TBD |
Dichen Zhang | 6947d53 | 2022-10-22 02:16:21 +0000 | [diff] [blame^] | 79 | return NO_ERROR; |
Dichen Zhang | 596a756 | 2022-10-12 14:57:05 -0700 | [diff] [blame] | 80 | } |
| 81 | |
Dichen Zhang | 6947d53 | 2022-10-22 02:16:21 +0000 | [diff] [blame^] | 82 | status_t RecoveryMap::encodeRecoveryMap(jr_uncompressed_ptr uncompressed_recovery_map, |
| 83 | jr_compressed_ptr dest) { |
Dichen Zhang | 596a756 | 2022-10-12 14:57:05 -0700 | [diff] [blame] | 84 | if (uncompressed_recovery_map == nullptr || dest == nullptr) { |
Dichen Zhang | 6947d53 | 2022-10-22 02:16:21 +0000 | [diff] [blame^] | 85 | return BAD_VALUE; |
Dichen Zhang | 596a756 | 2022-10-12 14:57:05 -0700 | [diff] [blame] | 86 | } |
| 87 | |
| 88 | // TBD |
Dichen Zhang | 6947d53 | 2022-10-22 02:16:21 +0000 | [diff] [blame^] | 89 | return NO_ERROR; |
Dichen Zhang | 596a756 | 2022-10-12 14:57:05 -0700 | [diff] [blame] | 90 | } |
| 91 | |
Dichen Zhang | 6947d53 | 2022-10-22 02:16:21 +0000 | [diff] [blame^] | 92 | status_t RecoveryMap::generateRecoveryMap(jr_uncompressed_ptr uncompressed_yuv_420_image, |
| 93 | jr_uncompressed_ptr uncompressed_p010_image, |
| 94 | jr_uncompressed_ptr dest) { |
Dichen Zhang | 596a756 | 2022-10-12 14:57:05 -0700 | [diff] [blame] | 95 | if (uncompressed_yuv_420_image == nullptr |
| 96 | || uncompressed_p010_image == nullptr |
| 97 | || dest == nullptr) { |
Dichen Zhang | 6947d53 | 2022-10-22 02:16:21 +0000 | [diff] [blame^] | 98 | return BAD_VALUE; |
Dichen Zhang | 596a756 | 2022-10-12 14:57:05 -0700 | [diff] [blame] | 99 | } |
| 100 | |
| 101 | // TBD |
Dichen Zhang | 6947d53 | 2022-10-22 02:16:21 +0000 | [diff] [blame^] | 102 | return NO_ERROR; |
Dichen Zhang | 596a756 | 2022-10-12 14:57:05 -0700 | [diff] [blame] | 103 | } |
| 104 | |
Dichen Zhang | 6947d53 | 2022-10-22 02:16:21 +0000 | [diff] [blame^] | 105 | status_t RecoveryMap::applyRecoveryMap(jr_uncompressed_ptr uncompressed_yuv_420_image, |
| 106 | jr_uncompressed_ptr uncompressed_recovery_map, |
| 107 | jr_uncompressed_ptr dest) { |
Dichen Zhang | 596a756 | 2022-10-12 14:57:05 -0700 | [diff] [blame] | 108 | if (uncompressed_yuv_420_image == nullptr |
| 109 | || uncompressed_recovery_map == nullptr |
| 110 | || dest == nullptr) { |
Dichen Zhang | 6947d53 | 2022-10-22 02:16:21 +0000 | [diff] [blame^] | 111 | return BAD_VALUE; |
Dichen Zhang | 596a756 | 2022-10-12 14:57:05 -0700 | [diff] [blame] | 112 | } |
| 113 | |
| 114 | // TBD |
Dichen Zhang | 6947d53 | 2022-10-22 02:16:21 +0000 | [diff] [blame^] | 115 | return NO_ERROR; |
Dichen Zhang | 596a756 | 2022-10-12 14:57:05 -0700 | [diff] [blame] | 116 | } |
| 117 | |
Dichen Zhang | 6947d53 | 2022-10-22 02:16:21 +0000 | [diff] [blame^] | 118 | status_t RecoveryMap::extractRecoveryMap(void* compressed_jpegr_image, jr_compressed_ptr dest) { |
| 119 | if (compressed_jpegr_image == nullptr || dest == nullptr) { |
| 120 | return BAD_VALUE; |
Dichen Zhang | 85b3756 | 2022-10-11 11:08:28 -0700 | [diff] [blame] | 121 | } |
| 122 | |
| 123 | // TBD |
Dichen Zhang | 6947d53 | 2022-10-22 02:16:21 +0000 | [diff] [blame^] | 124 | return NO_ERROR; |
Dichen Zhang | 85b3756 | 2022-10-11 11:08:28 -0700 | [diff] [blame] | 125 | } |
| 126 | |
Dichen Zhang | 6947d53 | 2022-10-22 02:16:21 +0000 | [diff] [blame^] | 127 | status_t RecoveryMap::appendRecoveryMap(void* compressed_jpeg_image, |
| 128 | jr_compressed_ptr compressed_recovery_map, |
| 129 | void* dest) { |
| 130 | if (compressed_jpeg_image == nullptr |
| 131 | || compressed_recovery_map == nullptr |
| 132 | || dest == nullptr) { |
| 133 | return BAD_VALUE; |
Dichen Zhang | 85b3756 | 2022-10-11 11:08:28 -0700 | [diff] [blame] | 134 | } |
| 135 | |
| 136 | // TBD |
Dichen Zhang | 6947d53 | 2022-10-22 02:16:21 +0000 | [diff] [blame^] | 137 | return NO_ERROR; |
Dichen Zhang | 85b3756 | 2022-10-11 11:08:28 -0700 | [diff] [blame] | 138 | } |
| 139 | |
| 140 | } // namespace android::recoverymap |