ERIS CORE

◆ Surface() [1/5]

Surface::Surface ( Surface SubSurfaceFrom,
SdFs *  pSD,
const char *  path,
const char *  fileName 
)
inline

Definition at line 44 of file ILI9341_t3_ERIS.h.

44  {
45  char str[16]; //char buffer
46  char *c; //char pointer
47  FsFile file;
48  guid = hash(path) * hash(fileName);
49  w = 0;//init these in case of a bad path or file.
50  c = 0;
51  h = 0;
52  alloc_size = 0;
53  pSB = NULL;
54  //open image, get size info, attempt to allocate a buffer then copy
55  //and capture the dimensions
56  if (!pSD->chdir(path)){ //change file path
57  Serial.print(F("M ILI9341_t3_ERIS::bltSD Path not found: "));
58  Serial.println(path);
59  return;
60  }
61  file.open(fileName, O_READ);//open image to read
62  if (file.available() == 0){ //file not found
63  Serial.print(F("M ILI9341_t3_ERIS::bltSD File Not Found: "));
64  Serial.println(fileName);
65  //pSD->ls();
66  return;
67  }
68  file.fgets(str,sizeof(str)); //read the header data
69  file.fgets(str,sizeof(str)); //to get the image dimensions
70  file.close();
71  strtok(str," "); //convert dimension text to numbers
72  w = atol(str);
73  c = strtok(NULL, " ");
74  h = atol(c);
75  alloc_size = w*h;
76  if (alloc_size < SURFACE_MIN_ALLOC_SIZE) alloc_size = SURFACE_MIN_ALLOC_SIZE;
77  pSB = SubSurfaceFrom->requestSubSurfaceBufferP(alloc_size);
78  }
uint32_t alloc_size
uint16_t * pSB
uint16_t w
uint32_t hash(const char *s)
uint16_t * requestSubSurfaceBufferP(uint32_t size)
uint16_t h
uint32_t guid

References alloc_size, guid, h, hash(), pSB, requestSubSurfaceBufferP(), and w.

Referenced by Surface().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: