-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added series of functions for processing 1-bit, 2-bit, 4-bit and 8-bit grayscale bitmaps which can be useful for quick text rendering using glyph images. * Removed Makefile.d. Dependencies are now automatically generated at the build stage. * Updated build scripts. * Updated module versions in dependencies.
- Loading branch information
Showing
35 changed files
with
5,892 additions
and
35,372 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/> | ||
* (C) 2023 Vladimir Sadovnikov <sadko4u@gmail.com> | ||
* | ||
* This file is part of lsp-dsp-lib | ||
* Created on: 8 апр. 2023 г. | ||
* | ||
* lsp-dsp-lib is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* any later version. | ||
* | ||
* lsp-dsp-lib is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with lsp-dsp-lib. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef LSP_PLUG_IN_DSP_COMMON_BITMAP_H_ | ||
#define LSP_PLUG_IN_DSP_COMMON_BITMAP_H_ | ||
|
||
#include <lsp-plug.in/dsp/common/types.h> | ||
|
||
#ifdef __cplusplus | ||
namespace lsp | ||
{ | ||
namespace dsp | ||
{ | ||
#endif /* __cplusplus */ | ||
|
||
typedef struct LSP_DSP_LIB_TYPE(bitmap_t) | ||
{ | ||
int32_t width; | ||
int32_t height; | ||
int32_t stride; | ||
uint8_t *data; | ||
} LSP_DSP_LIB_TYPE(bitmap_t); | ||
|
||
|
||
typedef void (* LSP_DSP_LIB_TYPE(bitmap_render_func_t))( | ||
LSP_DSP_LIB_TYPE(bitmap_t) *dst, | ||
const LSP_DSP_LIB_TYPE(bitmap_t) *src, | ||
ssize_t x, | ||
ssize_t y); | ||
#ifdef __cplusplus | ||
} /* namespace dsp */ | ||
} /* namespace lsp */ | ||
#endif /* __cplusplus */ | ||
|
||
#include <lsp-plug.in/dsp/common/bitmap/b1b8.h> | ||
#include <lsp-plug.in/dsp/common/bitmap/b2b8.h> | ||
#include <lsp-plug.in/dsp/common/bitmap/b4b8.h> | ||
#include <lsp-plug.in/dsp/common/bitmap/b8b8.h> | ||
|
||
#endif /* LSP_PLUG_IN_DSP_COMMON_BITMAP_H_ */ |
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,57 @@ | ||
/* | ||
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/> | ||
* (C) 2023 Vladimir Sadovnikov <sadko4u@gmail.com> | ||
* | ||
* This file is part of lsp-dsp-lib | ||
* Created on: 8 апр. 2023 г. | ||
* | ||
* lsp-dsp-lib is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* any later version. | ||
* | ||
* lsp-dsp-lib is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with lsp-dsp-lib. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef LSP_PLUG_IN_DSP_COMMON_BITMAP_B1B8_H_ | ||
#define LSP_PLUG_IN_DSP_COMMON_BITMAP_B1B8_H_ | ||
|
||
#include <lsp-plug.in/dsp/common/bitmap.h> | ||
|
||
/** | ||
* Put the source 1-bit bitmap to destination 8-bit bitmap, | ||
* the result pixel value will be computed as: result[i] = src[i] | ||
*/ | ||
LSP_DSP_LIB_SYMBOL(void, bitmap_put_b1b8, LSP_DSP_LIB_TYPE(LSP_DSP_LIB_TYPE(bitmap_t)) *dst, const LSP_DSP_LIB_TYPE(bitmap_t) *src, ssize_t x, ssize_t y); | ||
|
||
/** | ||
* Put the source 1-bit bitmap to destination 8-bit bitmap, | ||
* the result pixel value will be computed as: result[i] = saturate(dst[i] + src[i]) | ||
*/ | ||
LSP_DSP_LIB_SYMBOL(void, bitmap_add_b1b8, LSP_DSP_LIB_TYPE(bitmap_t) *dst, const LSP_DSP_LIB_TYPE(bitmap_t) *src, ssize_t x, ssize_t y); | ||
|
||
/** | ||
* Put the source 1-bit bitmap to destination 8-bit bitmap, | ||
* the result pixel value will be computed as: result[i] = saturate(dst[i] - src[i]) | ||
*/ | ||
LSP_DSP_LIB_SYMBOL(void, bitmap_sub_b1b8, LSP_DSP_LIB_TYPE(bitmap_t) *dst, const LSP_DSP_LIB_TYPE(bitmap_t) *src, ssize_t x, ssize_t y); | ||
|
||
/** | ||
* Put the source 1-bit bitmap to destination 8-bit bitmap, | ||
* the result pixel value will be computed as: result[i] = max(dst[i], src[i]) | ||
*/ | ||
LSP_DSP_LIB_SYMBOL(void, bitmap_max_b1b8, LSP_DSP_LIB_TYPE(bitmap_t) *dst, const LSP_DSP_LIB_TYPE(bitmap_t) *src, ssize_t x, ssize_t y); | ||
|
||
/** | ||
* Put the source 1-bit bitmap to destination 8-bit bitmap, | ||
* the result pixel value will be computed as: result[i] = min(dst[i], src[i]) | ||
*/ | ||
LSP_DSP_LIB_SYMBOL(void, bitmap_min_b1b8, LSP_DSP_LIB_TYPE(bitmap_t) *dst, const LSP_DSP_LIB_TYPE(bitmap_t) *src, ssize_t x, ssize_t y); | ||
|
||
#endif /* LSP_PLUG_IN_DSP_COMMON_BITMAP_B1B8_H_ */ |
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,58 @@ | ||
/* | ||
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/> | ||
* (C) 2023 Vladimir Sadovnikov <sadko4u@gmail.com> | ||
* | ||
* This file is part of lsp-dsp-lib | ||
* Created on: 8 апр. 2023 г. | ||
* | ||
* lsp-dsp-lib is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* any later version. | ||
* | ||
* lsp-dsp-lib is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with lsp-dsp-lib. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef LSP_PLUG_IN_DSP_COMMON_BITMAP_B2B8_H_ | ||
#define LSP_PLUG_IN_DSP_COMMON_BITMAP_B2B8_H_ | ||
|
||
#include <lsp-plug.in/dsp/common/bitmap.h> | ||
|
||
/** | ||
* Put the source 2-bit bitmap to destination 8-bit bitmap, | ||
* the result pixel value will be computed as: result[i] = src[i] | ||
*/ | ||
LSP_DSP_LIB_SYMBOL(void, bitmap_put_b2b8, LSP_DSP_LIB_TYPE(bitmap_t) *dst, const LSP_DSP_LIB_TYPE(bitmap_t) *src, ssize_t x, ssize_t y); | ||
|
||
/** | ||
* Put the source 2-bit bitmap to destination 8-bit bitmap, | ||
* the result pixel value will be computed as: result[i] = saturate(dst[i] + src[i]) | ||
*/ | ||
LSP_DSP_LIB_SYMBOL(void, bitmap_add_b2b8, LSP_DSP_LIB_TYPE(bitmap_t) *dst, const LSP_DSP_LIB_TYPE(bitmap_t) *src, ssize_t x, ssize_t y); | ||
|
||
/** | ||
* Put the source 2-bit bitmap to destination 8-bit bitmap, | ||
* the result pixel value will be computed as: result[i] = saturate(dst[i] - src[i]) | ||
*/ | ||
LSP_DSP_LIB_SYMBOL(void, bitmap_sub_b2b8, LSP_DSP_LIB_TYPE(bitmap_t) *dst, const LSP_DSP_LIB_TYPE(bitmap_t) *src, ssize_t x, ssize_t y); | ||
|
||
/** | ||
* Put the source 2-bit bitmap to destination 8-bit bitmap, | ||
* the result pixel value will be computed as: result[i] = max(dst[i], src[i]) | ||
*/ | ||
LSP_DSP_LIB_SYMBOL(void, bitmap_max_b2b8, LSP_DSP_LIB_TYPE(bitmap_t) *dst, const LSP_DSP_LIB_TYPE(bitmap_t) *src, ssize_t x, ssize_t y); | ||
|
||
/** | ||
* Put the source 2-bit bitmap to destination 8-bit bitmap, | ||
* the result pixel value will be computed as: result[i] = min(dst[i], src[i]) | ||
*/ | ||
LSP_DSP_LIB_SYMBOL(void, bitmap_min_b2b8, LSP_DSP_LIB_TYPE(bitmap_t) *dst, const LSP_DSP_LIB_TYPE(bitmap_t) *src, ssize_t x, ssize_t y); | ||
|
||
|
||
#endif /* LSP_PLUG_IN_DSP_COMMON_BITMAP_B2B8_H_ */ |
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,59 @@ | ||
/* | ||
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/> | ||
* (C) 2023 Vladimir Sadovnikov <sadko4u@gmail.com> | ||
* | ||
* This file is part of lsp-dsp-lib | ||
* Created on: 8 апр. 2023 г. | ||
* | ||
* lsp-dsp-lib is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* any later version. | ||
* | ||
* lsp-dsp-lib is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with lsp-dsp-lib. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef LSP_PLUG_IN_DSP_COMMON_BITMAP_B4B8_H_ | ||
#define LSP_PLUG_IN_DSP_COMMON_BITMAP_B4B8_H_ | ||
|
||
#include <lsp-plug.in/dsp/common/bitmap.h> | ||
|
||
/** | ||
* Put the source 4-bit bitmap to destination 8-bit bitmap, | ||
* the result pixel value will be computed as: result[i] = src[i] | ||
*/ | ||
LSP_DSP_LIB_SYMBOL(void, bitmap_put_b4b8, LSP_DSP_LIB_TYPE(bitmap_t) *dst, const LSP_DSP_LIB_TYPE(bitmap_t) *src, ssize_t x, ssize_t y); | ||
|
||
/** | ||
* Put the source 4-bit bitmap to destination 8-bit bitmap, | ||
* the result pixel value will be computed as: result[i] = saturate(dst[i] + src[i]) | ||
*/ | ||
LSP_DSP_LIB_SYMBOL(void, bitmap_add_b4b8, LSP_DSP_LIB_TYPE(bitmap_t) *dst, const LSP_DSP_LIB_TYPE(bitmap_t) *src, ssize_t x, ssize_t y); | ||
|
||
/** | ||
* Put the source 4-bit bitmap to destination 8-bit bitmap, | ||
* the result pixel value will be computed as: result[i] = saturate(dst[i] - src[i]) | ||
*/ | ||
LSP_DSP_LIB_SYMBOL(void, bitmap_sub_b4b8, LSP_DSP_LIB_TYPE(bitmap_t) *dst, const LSP_DSP_LIB_TYPE(bitmap_t) *src, ssize_t x, ssize_t y); | ||
|
||
/** | ||
* Put the source 4-bit bitmap to destination 8-bit bitmap, | ||
* the result pixel value will be computed as: result[i] = max(dst[i], src[i]) | ||
*/ | ||
LSP_DSP_LIB_SYMBOL(void, bitmap_max_b4b8, LSP_DSP_LIB_TYPE(bitmap_t) *dst, const LSP_DSP_LIB_TYPE(bitmap_t) *src, ssize_t x, ssize_t y); | ||
|
||
/** | ||
* Put the source 4-bit bitmap to destination 8-bit bitmap, | ||
* the result pixel value will be computed as: result[i] = min(dst[i], src[i]) | ||
*/ | ||
LSP_DSP_LIB_SYMBOL(void, bitmap_min_b4b8, LSP_DSP_LIB_TYPE(bitmap_t) *dst, const LSP_DSP_LIB_TYPE(bitmap_t) *src, ssize_t x, ssize_t y); | ||
|
||
|
||
|
||
#endif /* LSP_PLUG_IN_DSP_COMMON_BITMAP_B4B8_H_ */ |
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,57 @@ | ||
/* | ||
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/> | ||
* (C) 2023 Vladimir Sadovnikov <sadko4u@gmail.com> | ||
* | ||
* This file is part of lsp-dsp-lib | ||
* Created on: 8 апр. 2023 г. | ||
* | ||
* lsp-dsp-lib is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* any later version. | ||
* | ||
* lsp-dsp-lib is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with lsp-dsp-lib. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef LSP_PLUG_IN_DSP_COMMON_BITMAP_B8B8_H_ | ||
#define LSP_PLUG_IN_DSP_COMMON_BITMAP_B8B8_H_ | ||
|
||
#include <lsp-plug.in/dsp/common/bitmap.h> | ||
|
||
/** | ||
* Put the source 8-bit bitmap to destination 8-bit bitmap, | ||
* the result pixel value will be computed as: result[i] = src[i] | ||
*/ | ||
LSP_DSP_LIB_SYMBOL(void, bitmap_put_b8b8, LSP_DSP_LIB_TYPE(bitmap_t) *dst, const LSP_DSP_LIB_TYPE(bitmap_t) *src, ssize_t x, ssize_t y); | ||
|
||
/** | ||
* Put the source 8-bit bitmap to destination 8-bit bitmap, | ||
* the result pixel value will be computed as: result[i] = saturate(dst[i] + src[i]) | ||
*/ | ||
LSP_DSP_LIB_SYMBOL(void, bitmap_add_b8b8, LSP_DSP_LIB_TYPE(bitmap_t) *dst, const LSP_DSP_LIB_TYPE(bitmap_t) *src, ssize_t x, ssize_t y); | ||
|
||
/** | ||
* Put the source 8-bit bitmap to destination 8-bit bitmap, | ||
* the result pixel value will be computed as: result[i] = saturate(dst[i] - src[i]) | ||
*/ | ||
LSP_DSP_LIB_SYMBOL(void, bitmap_sub_b8b8, LSP_DSP_LIB_TYPE(bitmap_t) *dst, const LSP_DSP_LIB_TYPE(bitmap_t) *src, ssize_t x, ssize_t y); | ||
|
||
/** | ||
* Put the source 8-bit bitmap to destination 8-bit bitmap, | ||
* the result pixel value will be computed as: result[i] = max(dst[i], src[i]) | ||
*/ | ||
LSP_DSP_LIB_SYMBOL(void, bitmap_max_b8b8, LSP_DSP_LIB_TYPE(bitmap_t) *dst, const LSP_DSP_LIB_TYPE(bitmap_t) *src, ssize_t x, ssize_t y); | ||
|
||
/** | ||
* Put the source 8-bit bitmap to destination 8-bit bitmap, | ||
* the result pixel value will be computed as: result[i] = min(dst[i], src[i]) | ||
*/ | ||
LSP_DSP_LIB_SYMBOL(void, bitmap_min_b8b8, LSP_DSP_LIB_TYPE(bitmap_t) *dst, const LSP_DSP_LIB_TYPE(bitmap_t) *src, ssize_t x, ssize_t y); | ||
|
||
#endif /* LSP_PLUG_IN_DSP_COMMON_BITMAP_B8B8_H_ */ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (C) 2023 Linux Studio Plugins Project <https://lsp-plug.in/> | ||
* (C) 2023 Vladimir Sadovnikov <sadko4u@gmail.com> | ||
* | ||
* This file is part of lsp-dsp-lib | ||
* Created on: 8 апр. 2023 г. | ||
* | ||
* lsp-dsp-lib is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Lesser General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* any later version. | ||
* | ||
* lsp-dsp-lib is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with lsp-dsp-lib. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
#ifndef PRIVATE_DSP_ARCH_GENERIC_BITMAP_H_ | ||
#define PRIVATE_DSP_ARCH_GENERIC_BITMAP_H_ | ||
|
||
#ifndef PRIVATE_DSP_ARCH_GENERIC_IMPL | ||
#error "This header should not be included directly" | ||
#endif /* PRIVATE_DSP_ARCH_GENERIC_IMPL */ | ||
|
||
#include <private/dsp/arch/generic/bitmap/helpers.h> | ||
#include <private/dsp/arch/generic/bitmap/b1b8.h> | ||
#include <private/dsp/arch/generic/bitmap/b2b8.h> | ||
#include <private/dsp/arch/generic/bitmap/b4b8.h> | ||
#include <private/dsp/arch/generic/bitmap/b8b8.h> | ||
|
||
#endif /* PRIVATE_DSP_ARCH_GENERIC_BITMAP_H_ */ |
Oops, something went wrong.