Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions fleximg/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

### Added

- **Grayscale bit-packed フォーマット** (Grayscale1/2/4 MSB/LSB)
- 1/2/4ビットのグレースケールフォーマットを6種追加
- MSBFirst(上位ビット優先)とLSBFirst(下位ビット優先)の両方に対応
- `isIndexed = false`, `maxPaletteSize = 0`(Index系とは独立したフォーマット)
- DDA転写・バイリニア補間をフルサポート(copyRowDDA_Bit / copyQuadDDA_Bit 共有)
- `grayscale8.h` → `grayscale.h` にリネームし、Grayscale8 + GrayscaleN を統合
- `bit_packed_detail` ヘルパー関数群を `grayscale.h` に移動(Index/Grayscale共用)
- IndexN の `toStraight` を `grayscaleN_toStraight` に直接設定(コード共有)
- IndexN の `fromStraight` を `grayscaleN_fromStraight` への委譲ラッパーに変更

### Changed

- **コーディングスタイル違反の包括的修正**
Expand All @@ -28,6 +40,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

- **bit-packed unpackロジック集約 + Index8処理共通化**
- パレットLUT処理を `applyPaletteLUT` 共通関数として切り出し、Index8/IndexN で共有

- **Index8のパレットなしフォールバックをGrayscale8に統合**
- `index8_toStraight` を削除し、Index8 Descriptorの `toStraight` に `grayscale8_toStraight` を直接設定
- `index8_fromStraight` は `grayscale8_fromStraight` への委譲ラッパーに変更(将来のパレットマッピング拡張に備える)
- `grayscale8_fromStraight` を4ピクセルループ展開版に最適化
- `indexN_toStraight` の委譲先を `grayscale8_toStraight` に変更
- バイナリ上の重複コード解消、関数ポインタの共有による効率化
- `indexN_expandIndex` を末尾詰め方式に変更(チャンクバッファ不要、in-place展開)
- `indexN_toStraight` を末尾詰め + `index8_toStraight` 委譲に変更
- `copyRowDDA_Bit` に ConstY 高速パス追加(バルクunpack + DDAサンプリング)
Expand Down
2 changes: 2 additions & 0 deletions fleximg/src/fleximg/core/format_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ namespace FormatIdx {
constexpr uint_fast8_t BGR888 = 5;
constexpr uint_fast8_t Alpha8 = 6;
constexpr uint_fast8_t Grayscale8 = 7;
constexpr uint_fast8_t GrayscaleN = 7; // bit-packed Grayscale → Grayscale8 と共有
constexpr uint_fast8_t Index8 = 8;
constexpr uint_fast8_t IndexN = 8; // bit-packed Index → Index8 と共有
constexpr uint_fast8_t Count = 9;
}

Expand Down
8 changes: 7 additions & 1 deletion fleximg/src/fleximg/image/pixel_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ template void lut8toN<uint32_t>(uint32_t*, const uint8_t*, size_t, const uint32_
#include "pixel_format/rgb565.h"
#include "pixel_format/rgb332.h"
#include "pixel_format/rgb888.h"
#include "pixel_format/grayscale8.h"
#include "pixel_format/grayscale.h"
#include "pixel_format/index.h"

// DDA関数(bit_packed_detail が定義された後にインクルード)
Expand Down Expand Up @@ -375,6 +375,12 @@ inline const PixelFormatID builtinFormats[] = {
PixelFormatIDs::Index2_LSB,
PixelFormatIDs::Index4_MSB,
PixelFormatIDs::Index4_LSB,
PixelFormatIDs::Grayscale1_MSB,
PixelFormatIDs::Grayscale1_LSB,
PixelFormatIDs::Grayscale2_MSB,
PixelFormatIDs::Grayscale2_LSB,
PixelFormatIDs::Grayscale4_MSB,
PixelFormatIDs::Grayscale4_LSB,
};

inline constexpr size_t builtinFormatsCount = sizeof(builtinFormats) / sizeof(builtinFormats[0]);
Expand Down
Loading
Loading