Skip to content

Commit

Permalink
changed to allow limited use on AVR targets
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurence Bank authored and Laurence Bank committed Oct 13, 2022
1 parent 834e981 commit 4411720
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=TIFF_G4
version=1.1.0
version=1.1.1
author=Larry Bank
maintainer=Larry Bank
sentence=Optimized TIFF G4 decoder for MCUs with 16K+ RAM.
Expand Down
9 changes: 8 additions & 1 deletion src/TIFF_G4.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,16 @@
//

/* Defines and variables */
#ifdef __AVR__
// Allow for small images to decode on constrained devices
#define MAX_BUFFERED_PIXELS 32
#define TIFF_FILE_BUF_SIZE 128
#define MAX_IMAGE_WIDTH 200
#else
#define MAX_BUFFERED_PIXELS 1024
#define TIFF_FILE_BUF_SIZE 2048
#define MAX_IMAGE_WIDTH 2600
#endif
#define FILE_HIGHWATER ((TIFF_FILE_BUF_SIZE * 3) >> 2)
#define TIFF_TAG_SIZE 12
#define MAX_TIFF_TAGS 128
Expand Down Expand Up @@ -165,7 +172,7 @@ int TIFF_openTIFFFile(TIFFIMAGE *pImage, const char *szFilename, TIFF_OPEN_CALLB
#endif

// Due to unaligned memory causing an exception, we have to do these macros the slow way
#define TIFFMOTOLONG(p) (((*p)<<24UL) + ((*(p+1))<<16UL) + ((*(p+2))<<8UL) + (*(p+3)))
#define TIFFMOTOLONG(p) (((uint32_t)(*p)<<24UL) + ((uint32_t)(*(p+1))<<16UL) + ((uint32_t)(*(p+2))<<8UL) + (uint32_t)(*(p+3)))
#define TOP_BIT 0x80000000
#define MAX_VALUE 0xffffffff
#define LONGWHITECODEMASK 0x2000000
Expand Down

0 comments on commit 4411720

Please sign in to comment.