optimisation (crash fix)
This commit is contained in:
@@ -25,10 +25,10 @@ enum Color : u32 {
|
|||||||
A4, // tested
|
A4, // tested
|
||||||
};
|
};
|
||||||
CTRFF_API void EncodeImage(std::vector<ctrff::u8>& ret,
|
CTRFF_API void EncodeImage(std::vector<ctrff::u8>& ret,
|
||||||
std::vector<ctrff::u8> rgba, int w, int h,
|
const std::vector<ctrff::u8>& rgba, int w, int h,
|
||||||
Color dst);
|
Color dst);
|
||||||
CTRFF_API void DecodeImage(std::vector<ctrff::u8>& ret,
|
CTRFF_API void DecodeImage(std::vector<ctrff::u8>& ret,
|
||||||
std::vector<ctrff::u8> pixels, int w, int h,
|
const std::vector<ctrff::u8>& pixels, int w, int h,
|
||||||
Color src);
|
Color src);
|
||||||
} // namespace Pica
|
} // namespace Pica
|
||||||
} // namespace ctrff
|
} // namespace ctrff
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
namespace ctrff {
|
namespace ctrff {
|
||||||
namespace Pica {
|
namespace Pica {
|
||||||
CTRFF_API void EncodeImage(std::vector<ctrff::u8>& ret,
|
CTRFF_API void EncodeImage(std::vector<ctrff::u8>& ret,
|
||||||
std::vector<ctrff::u8> rgba, int w, int h,
|
const std::vector<ctrff::u8>& rgba, int w, int h,
|
||||||
Color dst_color) {
|
Color dst_color) {
|
||||||
// Only used in rgb/rgba
|
// Only used in rgb/rgba
|
||||||
int bpp = dst_color == RGBA8888 ? 4 : 3;
|
int bpp = dst_color == RGBA8888 ? 4 : 3;
|
||||||
@@ -152,7 +152,7 @@ CTRFF_API void EncodeImage(std::vector<ctrff::u8>& ret,
|
|||||||
}
|
}
|
||||||
|
|
||||||
CTRFF_API void DecodeImage(std::vector<ctrff::u8>& ret,
|
CTRFF_API void DecodeImage(std::vector<ctrff::u8>& ret,
|
||||||
std::vector<ctrff::u8> pixels, int w, int h,
|
const std::vector<ctrff::u8>& pixels, int w, int h,
|
||||||
Color src_color) {
|
Color src_color) {
|
||||||
switch (src_color) {
|
switch (src_color) {
|
||||||
case RGB565:
|
case RGB565:
|
||||||
|
|||||||
Reference in New Issue
Block a user