1 /*$ 2 Copyright (C) 2016-2020 Azel. 3 4 This file is part of AzPainterB. 5 6 AzPainterB is free software: you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation, either version 3 of the License, or 9 (at your option) any later version. 10 11 AzPainterB is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with this program. If not, see <http://www.gnu.org/licenses/>. 18 $*/ 19 20 /*************************************** 21 * キャンバスのパラメータ情報 22 ***************************************/ 23 24 #ifndef DEF_CANVASINFO_H 25 #define DEF_CANVASINFO_H 26 27 /** 倍率、回転の計算時のパラメータ */ 28 29 typedef struct _CanvasViewParam 30 { 31 double scale,scalediv, //倍率 32 rd, //角度 33 cos,sin, //cos,sin 値 34 cosrev,sinrev; //cos,sin 逆回転値 35 }CanvasViewParam; 36 37 /** キャンバス描画用のパラメータ */ 38 39 typedef struct _CanvasDrawInfo 40 { 41 mBox boxdst; //描画先範囲 42 double originx,originy; //イメージの原点位置 43 int scrollx,scrolly, //スクロール 44 mirror, //0 以外で左右反転表示 45 imgw,imgh; 46 uint32_t bkgndcol; //イメージ範囲外の色 47 CanvasViewParam *param; //計算用パラメータ 48 }CanvasDrawInfo; 49 50 51 void CanvasDrawInfo_imageToarea(CanvasDrawInfo *p,double x,double y,double *px,double *py); 52 void CanvasDrawInfo_imageToarea_pt(CanvasDrawInfo *p,double x,double y,mPoint *pt); 53 void CanvasDrawInfo_getImageIncParam(CanvasDrawInfo *p,double *dst); 54 55 #endif 56