E_paper, E_ink, Screen size 1.54", resolution 200x200, 4 wire spi, Waveshare, Black and White, Kl25Z, 8 wire print connector, supply 3.3 Volt, IL0373 Controller, font size is 8, 12, 16 and 24.

Dependencies:   mbed

Committer:
GerritPathuis
Date:
Sat Mar 31 08:40:16 2018 +0000
Revision:
10:08e026240a5f
Parent:
5:3b7204bd6832
Minor text update

Who changed what in which revision?

UserRevisionLine numberNew contents of line
GerritPathuis 5:3b7204bd6832 1 /**
GerritPathuis 5:3b7204bd6832 2 * @filename : epdpaint.h
GerritPathuis 5:3b7204bd6832 3 * @brief : Header file for epdpaint.cpp
GerritPathuis 5:3b7204bd6832 4 * @author : Yehui from Waveshare
GerritPathuis 5:3b7204bd6832 5 *
GerritPathuis 5:3b7204bd6832 6 * Copyright (C) Waveshare July 28 2017
GerritPathuis 5:3b7204bd6832 7 *
GerritPathuis 5:3b7204bd6832 8 * Permission is hereby granted, free of charge, to any person obtaining a copy
GerritPathuis 5:3b7204bd6832 9 * of this software and associated documnetation files (the "Software"), to deal
GerritPathuis 5:3b7204bd6832 10 * in the Software without restriction, including without limitation the rights
GerritPathuis 5:3b7204bd6832 11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
GerritPathuis 5:3b7204bd6832 12 * copies of the Software, and to permit persons to whom the Software is
GerritPathuis 5:3b7204bd6832 13 * furished to do so, subject to the following conditions:
GerritPathuis 5:3b7204bd6832 14 *
GerritPathuis 5:3b7204bd6832 15 * The above copyright notice and this permission notice shall be included in
GerritPathuis 5:3b7204bd6832 16 * all copies or substantial portions of the Software.
GerritPathuis 5:3b7204bd6832 17 *
GerritPathuis 5:3b7204bd6832 18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
GerritPathuis 5:3b7204bd6832 19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
GerritPathuis 5:3b7204bd6832 20 * FITNESS OR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
GerritPathuis 5:3b7204bd6832 21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
GerritPathuis 5:3b7204bd6832 22 * LIABILITY WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
GerritPathuis 5:3b7204bd6832 23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
GerritPathuis 5:3b7204bd6832 24 * THE SOFTWARE.
GerritPathuis 5:3b7204bd6832 25 */
GerritPathuis 5:3b7204bd6832 26
GerritPathuis 5:3b7204bd6832 27 #ifndef EPDPAINT_H_
GerritPathuis 5:3b7204bd6832 28 #define EPDPAINT_H_
GerritPathuis 5:3b7204bd6832 29
GerritPathuis 5:3b7204bd6832 30 // Display orientation
GerritPathuis 5:3b7204bd6832 31 #define ROTATE_0 0
GerritPathuis 5:3b7204bd6832 32 #define ROTATE_90 1
GerritPathuis 5:3b7204bd6832 33 #define ROTATE_180 2
GerritPathuis 5:3b7204bd6832 34 #define ROTATE_270 3
GerritPathuis 5:3b7204bd6832 35
GerritPathuis 5:3b7204bd6832 36 // Color inverse. 1 or 0 = set or reset a bit if set a colored pixel
GerritPathuis 5:3b7204bd6832 37 #define IF_INVERT_COLOR 1
GerritPathuis 0:665e04c85d8d 38
GerritPathuis 5:3b7204bd6832 39 #include "fonts.h"
GerritPathuis 5:3b7204bd6832 40
GerritPathuis 5:3b7204bd6832 41 class Paint {
GerritPathuis 5:3b7204bd6832 42 public:
GerritPathuis 5:3b7204bd6832 43 Paint(unsigned char* image, int width, int height);
GerritPathuis 5:3b7204bd6832 44 ~Paint();
GerritPathuis 5:3b7204bd6832 45 void Clear(int colored);
GerritPathuis 5:3b7204bd6832 46 int GetWidth(void);
GerritPathuis 5:3b7204bd6832 47 void SetWidth(int width);
GerritPathuis 5:3b7204bd6832 48 int GetHeight(void);
GerritPathuis 5:3b7204bd6832 49 void SetHeight(int height);
GerritPathuis 5:3b7204bd6832 50 int GetRotate(void);
GerritPathuis 5:3b7204bd6832 51 void SetRotate(int rotate);
GerritPathuis 5:3b7204bd6832 52 unsigned char* GetImage(void);
GerritPathuis 5:3b7204bd6832 53 void DrawAbsolutePixel(int x, int y, int colored);
GerritPathuis 5:3b7204bd6832 54 void DrawPixel(int x, int y, int colored);
GerritPathuis 5:3b7204bd6832 55 void DrawCharAt(int x, int y, char ascii_char, sFONT* font, int colored);
GerritPathuis 5:3b7204bd6832 56 void DrawStringAt(int x, int y, const char* text, sFONT* font, int colored);
GerritPathuis 5:3b7204bd6832 57 void DrawLine(int x0, int y0, int x1, int y1, int colored);
GerritPathuis 5:3b7204bd6832 58 void DrawHorizontalLine(int x, int y, int width, int colored);
GerritPathuis 5:3b7204bd6832 59 void DrawVerticalLine(int x, int y, int height, int colored);
GerritPathuis 5:3b7204bd6832 60 void DrawRectangle(int x0, int y0, int x1, int y1, int colored);
GerritPathuis 5:3b7204bd6832 61 void DrawFilledRectangle(int x0, int y0, int x1, int y1, int colored);
GerritPathuis 5:3b7204bd6832 62 void DrawCircle(int x, int y, int radius, int colored);
GerritPathuis 5:3b7204bd6832 63 void DrawFilledCircle(int x, int y, int radius, int colored);
GerritPathuis 5:3b7204bd6832 64
GerritPathuis 5:3b7204bd6832 65 private:
GerritPathuis 5:3b7204bd6832 66 unsigned char* image;
GerritPathuis 5:3b7204bd6832 67 int width;
GerritPathuis 5:3b7204bd6832 68 int height;
GerritPathuis 5:3b7204bd6832 69 int rotate;
GerritPathuis 5:3b7204bd6832 70 };
GerritPathuis 5:3b7204bd6832 71
GerritPathuis 5:3b7204bd6832 72 #endif
GerritPathuis 5:3b7204bd6832 73
GerritPathuis 5:3b7204bd6832 74 /* END OF FILE */
GerritPathuis 5:3b7204bd6832 75
GerritPathuis 5:3b7204bd6832 76