update clang-format to match original clang

only adjusts some comment spaces in ImageReader.cpp
This commit is contained in:
Liz 2025-08-01 10:33:05 -04:00
parent 9f470611e6
commit a3086d3c22
4 changed files with 44 additions and 35 deletions

View file

@ -2,12 +2,21 @@ Language: Cpp
BasedOnStyle: Google
IndentWidth: 2
ColumnLimit: 80
AllowShortFunctionsOnASingleLine: Empty
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
BinPackArguments: true
BinPackParameters: true
BreakBeforeBraces: Attach
DerivePointerAlignment: false
PointerAlignment: Left
PointerAlignment: Right
SpacesBeforeTrailingComments: 1
IndentCaseLabels: true
SortIncludes: false
AlignTrailingComments: true
MaxEmptyLinesToKeep: 2
SpaceAfterCStyleCast: false
AllowShortBlocksOnASingleLine: false
KeepEmptyLinesAtTheStartOfBlocks: true
AccessModifierOffset: -2
IndentAccessModifiers: false

View file

@ -98,10 +98,10 @@ uint8_t Adafruit_ImageReader_EPD::mapColorForDisplay(uint8_t r, uint8_t g,
Vertical offset in pixels; top edge = 0, positive = down.
@return None (void).
*/
void Adafruit_Image_EPD::draw(Adafruit_EPD& epd, int16_t x, int16_t y) {
void Adafruit_Image_EPD::draw(Adafruit_EPD &epd, int16_t x, int16_t y) {
int16_t col = x, row = y;
if (format == IMAGE_1) {
uint8_t* buffer = canvas.canvas1->getBuffer();
uint8_t *buffer = canvas.canvas1->getBuffer();
uint8_t i, c;
while (row < y + canvas.canvas1->height()) {
for (i = 0; i < 8; i++) {
@ -122,7 +122,7 @@ void Adafruit_Image_EPD::draw(Adafruit_EPD& epd, int16_t x, int16_t y) {
};
} else if (format == IMAGE_8) {
} else if (format == IMAGE_16) {
uint16_t* buffer = canvas.canvas16->getBuffer();
uint16_t *buffer = canvas.canvas16->getBuffer();
thinkinkmode_t displayMode = epd.getMode();
while (row < y + canvas.canvas16->height()) {
@ -160,7 +160,7 @@ void Adafruit_Image_EPD::draw(Adafruit_EPD& epd, int16_t x, int16_t y) {
often be in pre-setup() declaration, but DOES need initializing
before any of the image loading or size functions are called!
*/
Adafruit_ImageReader_EPD::Adafruit_ImageReader_EPD(FatVolume& fs)
Adafruit_ImageReader_EPD::Adafruit_ImageReader_EPD(FatVolume &fs)
: Adafruit_ImageReader(fs) {}
/*!
@ -182,8 +182,8 @@ Adafruit_ImageReader_EPD::Adafruit_ImageReader_EPD(FatVolume& fs)
@return One of the ImageReturnCode values (IMAGE_SUCCESS on successful
completion, other values on failure).
*/
ImageReturnCode Adafruit_ImageReader_EPD::drawBMP(char* filename,
Adafruit_EPD& epd, int16_t x,
ImageReturnCode Adafruit_ImageReader_EPD::drawBMP(char *filename,
Adafruit_EPD &epd, int16_t x,
int16_t y, boolean transact) {
uint16_t epdbuf[BUFPIXELS]; // Temp space for buffering EPD data
// Call core BMP-reading function, passing address to EPD object,
@ -222,12 +222,12 @@ ImageReturnCode Adafruit_ImageReader_EPD::drawBMP(char* filename,
completion, other values on failure).
*/
ImageReturnCode Adafruit_ImageReader_EPD::coreBMP(
char* filename, // SD file to load
Adafruit_EPD* epd, // Pointer to TFT object, or NULL if to image
uint16_t* dest, // EPD working buffer, or NULL if to canvas
char *filename, // SD file to load
Adafruit_EPD *epd, // Pointer to TFT object, or NULL if to image
uint16_t *dest, // EPD working buffer, or NULL if to canvas
int16_t x, // Position if loading to EPD (else ignored)
int16_t y,
Adafruit_Image_EPD* img, // NULL if load-to-screen
Adafruit_Image_EPD *img, // NULL if load-to-screen
boolean transact) { // SD & EPD sharing bus, use transactions
thinkinkmode_t displayMode = epd ? epd->getMode() : THINKINK_TRICOLOR;
ImageReturnCode status = IMAGE_ERR_FORMAT; // IMAGE_SUCCESS on valid file
@ -238,7 +238,7 @@ ImageReturnCode Adafruit_ImageReader_EPD::coreBMP(
uint8_t depth; // BMP bit depth
uint32_t compression = 0; // BMP compression mode
uint32_t colors = 0; // Number of colors in palette
uint16_t* quantized = NULL; // EPD Color palette
uint16_t *quantized = NULL; // EPD Color palette
uint32_t rowSize; // >bmpWidth if scanline padding
uint8_t sdbuf[3 * BUFPIXELS]; // BMP read buf (R+G+B/pixel)
int16_t epd_col = 0, epd_row = 0;
@ -248,7 +248,7 @@ ImageReturnCode Adafruit_ImageReader_EPD::coreBMP(
uint16_t srcidx = sizeof sdbuf;
#endif
uint32_t destidx = 0;
uint8_t* dest1 = NULL; // Dest ptr for 1-bit BMPs to img
uint8_t *dest1 = NULL; // Dest ptr for 1-bit BMPs to img
boolean flip = true; // BMP is stored bottom-to-top
uint32_t bmpPos = 0; // Next pixel position in file
int loadWidth, loadHeight, // Region being loaded (clipped)
@ -366,7 +366,7 @@ ImageReturnCode Adafruit_ImageReader_EPD::coreBMP(
}
if ((depth >= 16) ||
(quantized = (uint16_t*)malloc(colors * sizeof(uint16_t)))) {
(quantized = (uint16_t *)malloc(colors * sizeof(uint16_t)))) {
if (depth < 16) {
// Load and quantize color table
thinkinkmode_t displayMode =

View file

@ -23,10 +23,10 @@
ImageReader.loadBMP() and Image.draw(), not ImageReader.drawBMP().
*/
class Adafruit_Image_EPD : public Adafruit_Image {
public:
void draw(Adafruit_EPD& epd, int16_t x, int16_t y);
public:
void draw(Adafruit_EPD &epd, int16_t x, int16_t y);
protected:
protected:
friend class Adafruit_ImageReader_EPD; ///< Loading occurs here
};
@ -43,17 +43,17 @@ class Adafruit_Image_EPD : public Adafruit_Image {
for use.
*/
class Adafruit_ImageReader_EPD : public Adafruit_ImageReader {
public:
Adafruit_ImageReader_EPD(FatVolume& fs);
ImageReturnCode drawBMP(char* filename, Adafruit_EPD& epd, int16_t x,
public:
Adafruit_ImageReader_EPD(FatVolume &fs);
ImageReturnCode drawBMP(char *filename, Adafruit_EPD &epd, int16_t x,
int16_t y, boolean transact = true);
static uint8_t mapColorForDisplay(uint8_t r, uint8_t g, uint8_t b,
thinkinkmode_t mode);
private:
ImageReturnCode coreBMP(char* filename, Adafruit_EPD* epd, uint16_t* dest,
int16_t x, int16_t y, Adafruit_Image_EPD* img,
private:
ImageReturnCode coreBMP(char *filename, Adafruit_EPD *epd, uint16_t *dest,
int16_t x, int16_t y, Adafruit_Image_EPD *img,
boolean transact);
};