Formatting.
This commit is contained in:
parent
13fc5f7bbb
commit
5c22342dcc
@ -9,8 +9,7 @@
|
||||
#include "config.h"
|
||||
#include "images/CrossLarge.h"
|
||||
|
||||
void convertBmpToBWdisplayData(uint8_t* bmpData,
|
||||
int width, int height, uint8_t* displayImage){
|
||||
void convertBmpToBWdisplayData(uint8_t* bmpData, int width, int height, uint8_t* displayImage) {
|
||||
// Convert BMP data to 1bpp format for e-ink display
|
||||
// Implementation details depend on the specific BMP format and display requirements
|
||||
|
||||
@ -134,7 +133,8 @@ uint8_t* loadBMP(const char* filename, int& width, int& height) {
|
||||
width = header.width;
|
||||
height = header.height;
|
||||
|
||||
Serial.printf("[%lu] [SleepScreen] BMP dimensions: %dx%d, %d bits/pixel\n", millis(), width, height, header.bitsPerPixel);
|
||||
Serial.printf("[%lu] [SleepScreen] BMP dimensions: %dx%d, %d bits/pixel\n", millis(), width, height,
|
||||
header.bitsPerPixel);
|
||||
|
||||
// Calculate destination dimensions based on rotation type
|
||||
int destWidth, destHeight;
|
||||
@ -158,7 +158,6 @@ uint8_t* loadBMP(const char* filename, int& width, int& height) {
|
||||
// Initialize to all white (0xFF = all bits set to 1)
|
||||
memset(displayImage, 0xFF, bufferSize);
|
||||
|
||||
|
||||
// With 4-byte divisibility assertion, no padding calculations are needed
|
||||
|
||||
// Add assertion that dimensions are divisible by 4
|
||||
@ -180,8 +179,7 @@ uint8_t* loadBMP(const char* filename, int& width, int& height) {
|
||||
// Allocate a buffer for the entire bitmap
|
||||
uint8_t* bmpData = (uint8_t*)malloc(totalBitmapSize);
|
||||
if (!bmpData) {
|
||||
Serial.printf("[%lu] [SleepScreen] Failed to allocate bitmap buffer (%d bytes)\n",
|
||||
millis(), totalBitmapSize);
|
||||
Serial.printf("[%lu] [SleepScreen] Failed to allocate bitmap buffer (%d bytes)\n", millis(), totalBitmapSize);
|
||||
free(displayImage);
|
||||
bmpFile.close();
|
||||
return nullptr;
|
||||
@ -198,8 +196,8 @@ uint8_t* loadBMP(const char* filename, int& width, int& height) {
|
||||
bmpFile.close();
|
||||
|
||||
const unsigned long elapsedTime = millis() - startTime;
|
||||
Serial.printf("[%lu] [SleepScreen] Successfully loaded BMP: %dx%d in %lu ms\n",
|
||||
millis(), destWidth, destHeight, elapsedTime);
|
||||
Serial.printf("[%lu] [SleepScreen] Successfully loaded BMP: %dx%d in %lu ms\n", millis(), destWidth, destHeight,
|
||||
elapsedTime);
|
||||
return displayImage;
|
||||
}
|
||||
|
||||
@ -240,8 +238,8 @@ void SleepActivity::onEnter() {
|
||||
// Note: We've applied 90-degree clockwise rotation to compensate for
|
||||
// the renderer's behavior and ensure the image appears correctly
|
||||
// on the e-ink display.
|
||||
Serial.printf("[%lu] [SleepScreen] Drawing at position: %d,%d (dimensions: %dx%d)\n", millis(),
|
||||
xPos, yPos, imageWidth, imageHeight);
|
||||
Serial.printf("[%lu] [SleepScreen] Drawing at position: %d,%d (dimensions: %dx%d)\n", millis(), xPos, yPos,
|
||||
imageWidth, imageHeight);
|
||||
renderer.drawImage(imageData, xPos, yPos, imageWidth, imageHeight);
|
||||
|
||||
// Free the image data
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user