From 8fc51668d0912ea73e43b60a5df444cda718b7ec Mon Sep 17 00:00:00 2001 From: Eunchurn Park Date: Mon, 5 Jan 2026 00:48:26 +0900 Subject: [PATCH] chore(clang-format-fix): fixing format --- lib/Epub/Epub.cpp | 4 +-- lib/GfxRenderer/GfxRenderer.cpp | 2 +- lib/JpegToBmpConverter/JpegToBmpConverter.cpp | 8 +++-- lib/Xtc/Xtc.cpp | 4 +-- src/activities/home/HomeActivity.cpp | 36 +++++++++---------- 5 files changed, 28 insertions(+), 26 deletions(-) diff --git a/lib/Epub/Epub.cpp b/lib/Epub/Epub.cpp index 60097773..aa6bb490 100644 --- a/lib/Epub/Epub.cpp +++ b/lib/Epub/Epub.cpp @@ -372,8 +372,8 @@ bool Epub::generateThumbBmp() const { // Generate 1-bit BMP for fast home screen rendering (no gray passes needed) constexpr int THUMB_TARGET_WIDTH = 240; constexpr int THUMB_TARGET_HEIGHT = 400; - const bool success = - JpegToBmpConverter::jpegFileTo1BitBmpStreamWithSize(coverJpg, thumbBmp, THUMB_TARGET_WIDTH, THUMB_TARGET_HEIGHT); + const bool success = JpegToBmpConverter::jpegFileTo1BitBmpStreamWithSize(coverJpg, thumbBmp, THUMB_TARGET_WIDTH, + THUMB_TARGET_HEIGHT); coverJpg.close(); thumbBmp.close(); SdMan.remove(coverJpgTempPath.c_str()); diff --git a/lib/GfxRenderer/GfxRenderer.cpp b/lib/GfxRenderer/GfxRenderer.cpp index 27ca9e94..d2581b77 100644 --- a/lib/GfxRenderer/GfxRenderer.cpp +++ b/lib/GfxRenderer/GfxRenderer.cpp @@ -229,7 +229,7 @@ void GfxRenderer::drawBitmap(const Bitmap& bitmap, const int x, const int y, con } void GfxRenderer::drawBitmap1Bit(const Bitmap& bitmap, const int x, const int y, const int maxWidth, - const int maxHeight) const { + const int maxHeight) const { float scale = 1.0f; bool isScaled = false; if (maxWidth > 0 && bitmap.getWidth() > maxWidth) { diff --git a/lib/JpegToBmpConverter/JpegToBmpConverter.cpp b/lib/JpegToBmpConverter/JpegToBmpConverter.cpp index 637e275d..ebe69d0e 100644 --- a/lib/JpegToBmpConverter/JpegToBmpConverter.cpp +++ b/lib/JpegToBmpConverter/JpegToBmpConverter.cpp @@ -762,7 +762,8 @@ bool JpegToBmpConverter::jpegFileToBmpStreamInternal(FsFile& jpegFile, Print& bm // 1-bit output with Atkinson dithering for better quality for (int x = 0; x < outWidth; x++) { const uint8_t gray = mcuRowBuffer[bufferY * imageInfo.m_width + x]; - const uint8_t bit = atkinson1BitDitherer ? atkinson1BitDitherer->processPixel(gray, x) : quantize1bit(gray, x, y); + const uint8_t bit = + atkinson1BitDitherer ? atkinson1BitDitherer->processPixel(gray, x) : quantize1bit(gray, x, y); // Pack 1-bit value: MSB first, 8 pixels per byte const int byteIndex = x / 8; const int bitOffset = 7 - (x % 8); @@ -837,7 +838,8 @@ bool JpegToBmpConverter::jpegFileToBmpStreamInternal(FsFile& jpegFile, Print& bm // 1-bit output with Atkinson dithering for better quality for (int x = 0; x < outWidth; x++) { const uint8_t gray = (rowCount[x] > 0) ? (rowAccum[x] / rowCount[x]) : 0; - const uint8_t bit = atkinson1BitDitherer ? atkinson1BitDitherer->processPixel(gray, x) : quantize1bit(gray, x, currentOutY); + const uint8_t bit = atkinson1BitDitherer ? atkinson1BitDitherer->processPixel(gray, x) + : quantize1bit(gray, x, currentOutY); // Pack 1-bit value: MSB first, 8 pixels per byte const int byteIndex = x / 8; const int bitOffset = 7 - (x % 8); @@ -916,6 +918,6 @@ bool JpegToBmpConverter::jpegFileToBmpStreamWithSize(FsFile& jpegFile, Print& bm // Convert to 1-bit BMP (black and white only, no grays) for fast home screen rendering bool JpegToBmpConverter::jpegFileTo1BitBmpStreamWithSize(FsFile& jpegFile, Print& bmpOut, int targetMaxWidth, - int targetMaxHeight) { + int targetMaxHeight) { return jpegFileToBmpStreamInternal(jpegFile, bmpOut, targetMaxWidth, targetMaxHeight, true); } diff --git a/lib/Xtc/Xtc.cpp b/lib/Xtc/Xtc.cpp index b0c5102d..7205ffb9 100644 --- a/lib/Xtc/Xtc.cpp +++ b/lib/Xtc/Xtc.cpp @@ -522,7 +522,7 @@ bool Xtc::generateThumbBmp() const { // Hash-based noise dithering for 1-bit output uint32_t hash = static_cast(dstX) * 374761393u + static_cast(dstY) * 668265263u; hash = (hash ^ (hash >> 13)) * 1274126177u; - const int threshold = static_cast(hash >> 24); // 0-255 + const int threshold = static_cast(hash >> 24); // 0-255 const int adjustedThreshold = 128 + ((threshold - 128) / 2); // Range: 64-192 // Quantize to 1-bit: 0=black, 1=white @@ -534,7 +534,7 @@ bool Xtc::generateThumbBmp() const { // Bounds check for row buffer access if (byteIndex < rowSize) { if (oneBit) { - rowBuffer[byteIndex] |= (1 << bitOffset); // Set bit for white + rowBuffer[byteIndex] |= (1 << bitOffset); // Set bit for white } else { rowBuffer[byteIndex] &= ~(1 << bitOffset); // Clear bit for black } diff --git a/src/activities/home/HomeActivity.cpp b/src/activities/home/HomeActivity.cpp index e5d618e6..98d87f1d 100644 --- a/src/activities/home/HomeActivity.cpp +++ b/src/activities/home/HomeActivity.cpp @@ -257,18 +257,18 @@ void HomeActivity::render() { const int centerX = bookmarkX + bookmarkWidth / 2; const int xPoints[5] = { - bookmarkX, // top-left - bookmarkX + bookmarkWidth, // top-right - bookmarkX + bookmarkWidth, // bottom-right - centerX, // center notch point - bookmarkX // bottom-left + bookmarkX, // top-left + bookmarkX + bookmarkWidth, // top-right + bookmarkX + bookmarkWidth, // bottom-right + centerX, // center notch point + bookmarkX // bottom-left }; const int yPoints[5] = { - bookmarkY, // top-left - bookmarkY, // top-right - bookmarkY + bookmarkHeight, // bottom-right + bookmarkY, // top-left + bookmarkY, // top-right + bookmarkY + bookmarkHeight, // bottom-right bookmarkY + bookmarkHeight - notchDepth, // center notch point - bookmarkY + bookmarkHeight // bottom-left + bookmarkY + bookmarkHeight // bottom-left }; // Draw bookmark ribbon (white normally, will be inverted if selected) @@ -308,18 +308,18 @@ void HomeActivity::render() { const int centerX = bookmarkX + bookmarkWidth / 2; const int xPoints[5] = { - bookmarkX, // top-left - bookmarkX + bookmarkWidth, // top-right - bookmarkX + bookmarkWidth, // bottom-right - centerX, // center notch point - bookmarkX // bottom-left + bookmarkX, // top-left + bookmarkX + bookmarkWidth, // top-right + bookmarkX + bookmarkWidth, // bottom-right + centerX, // center notch point + bookmarkX // bottom-left }; const int yPoints[5] = { - bookmarkY, // top-left - bookmarkY, // top-right - bookmarkY + bookmarkHeight, // bottom-right + bookmarkY, // top-left + bookmarkY, // top-right + bookmarkY + bookmarkHeight, // bottom-right bookmarkY + bookmarkHeight - notchDepth, // center notch point - bookmarkY + bookmarkHeight // bottom-left + bookmarkY + bookmarkHeight // bottom-left }; // Draw black filled bookmark ribbon (inverted)