blob: 5d2572213bfdfc5f2bbc3f46a09c1fb23de4b5b9 [file] [log] [blame]
Dichen Zhang85b37562022-10-11 11:08:28 -07001/*
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
19namespace android::recoverymap {
20
Dichen Zhang6947d532022-10-22 02:16:21 +000021status_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
34status_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
50status_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
63status_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
72status_t RecoveryMap::decodeRecoveryMap(jr_compressed_ptr compressed_recovery_map,
73 jr_uncompressed_ptr dest) {
Dichen Zhang596a7562022-10-12 14:57:05 -070074 if (compressed_recovery_map == nullptr || dest == nullptr) {
Dichen Zhang6947d532022-10-22 02:16:21 +000075 return BAD_VALUE;
Dichen Zhang596a7562022-10-12 14:57:05 -070076 }
77
78 // TBD
Dichen Zhang6947d532022-10-22 02:16:21 +000079 return NO_ERROR;
Dichen Zhang596a7562022-10-12 14:57:05 -070080}
81
Dichen Zhang6947d532022-10-22 02:16:21 +000082status_t RecoveryMap::encodeRecoveryMap(jr_uncompressed_ptr uncompressed_recovery_map,
83 jr_compressed_ptr dest) {
Dichen Zhang596a7562022-10-12 14:57:05 -070084 if (uncompressed_recovery_map == nullptr || dest == nullptr) {
Dichen Zhang6947d532022-10-22 02:16:21 +000085 return BAD_VALUE;
Dichen Zhang596a7562022-10-12 14:57:05 -070086 }
87
88 // TBD
Dichen Zhang6947d532022-10-22 02:16:21 +000089 return NO_ERROR;
Dichen Zhang596a7562022-10-12 14:57:05 -070090}
91
Dichen Zhang6947d532022-10-22 02:16:21 +000092status_t RecoveryMap::generateRecoveryMap(jr_uncompressed_ptr uncompressed_yuv_420_image,
93 jr_uncompressed_ptr uncompressed_p010_image,
94 jr_uncompressed_ptr dest) {
Dichen Zhang596a7562022-10-12 14:57:05 -070095 if (uncompressed_yuv_420_image == nullptr
96 || uncompressed_p010_image == nullptr
97 || dest == nullptr) {
Dichen Zhang6947d532022-10-22 02:16:21 +000098 return BAD_VALUE;
Dichen Zhang596a7562022-10-12 14:57:05 -070099 }
100
101 // TBD
Dichen Zhang6947d532022-10-22 02:16:21 +0000102 return NO_ERROR;
Dichen Zhang596a7562022-10-12 14:57:05 -0700103}
104
Dichen Zhang6947d532022-10-22 02:16:21 +0000105status_t RecoveryMap::applyRecoveryMap(jr_uncompressed_ptr uncompressed_yuv_420_image,
106 jr_uncompressed_ptr uncompressed_recovery_map,
107 jr_uncompressed_ptr dest) {
Dichen Zhang596a7562022-10-12 14:57:05 -0700108 if (uncompressed_yuv_420_image == nullptr
109 || uncompressed_recovery_map == nullptr
110 || dest == nullptr) {
Dichen Zhang6947d532022-10-22 02:16:21 +0000111 return BAD_VALUE;
Dichen Zhang596a7562022-10-12 14:57:05 -0700112 }
113
114 // TBD
Dichen Zhang6947d532022-10-22 02:16:21 +0000115 return NO_ERROR;
Dichen Zhang596a7562022-10-12 14:57:05 -0700116}
117
Dichen Zhang6947d532022-10-22 02:16:21 +0000118status_t RecoveryMap::extractRecoveryMap(void* compressed_jpegr_image, jr_compressed_ptr dest) {
119 if (compressed_jpegr_image == nullptr || dest == nullptr) {
120 return BAD_VALUE;
Dichen Zhang85b37562022-10-11 11:08:28 -0700121 }
122
123 // TBD
Dichen Zhang6947d532022-10-22 02:16:21 +0000124 return NO_ERROR;
Dichen Zhang85b37562022-10-11 11:08:28 -0700125}
126
Dichen Zhang6947d532022-10-22 02:16:21 +0000127status_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 Zhang85b37562022-10-11 11:08:28 -0700134 }
135
136 // TBD
Dichen Zhang6947d532022-10-22 02:16:21 +0000137 return NO_ERROR;
Dichen Zhang85b37562022-10-11 11:08:28 -0700138}
139
140} // namespace android::recoverymap