1 /* 2 * Copyright (C) 2020 Rockchip Electronics Co., Ltd. 3 * Authors: 4 * PutinLee <putin.lee@rock-chips.com> 5 * Cerf Yu <cerf.yu@rock-chips.com> 6 * 7 * Licensed under the Apache License, Version 2.0 (the "License"); 8 * you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 */ 19 20 #ifndef ARGS_H 21 #define ARGS_H 22 23 #include "im2d.hpp" 24 25 typedef enum _mode_code { 26 MODE_QUERYSTRING = 0, 27 MODE_COPY, 28 MODE_RESIZE, 29 MODE_CROP, 30 MODE_ROTATE, 31 MODE_FLIP, 32 MODE_TRANSLATE, 33 MODE_BLEND, 34 MODE_CVTCOLOR, 35 MODE_FILL, 36 MODE_WHILE, 37 MODE_NONE, 38 MODE_MAX 39 } MODE_CODE; 40 41 #define MODE_QUERYSTRING_CHAR (char) (MODE_QUERYSTRING+'0') 42 #define MODE_COPY_CHAR (char) (MODE_COPY +'0') 43 #define MODE_RESIZE_CHAR (char) (MODE_RESIZE +'0') 44 #define MODE_CROP_CHAR (char) (MODE_CROP +'0') 45 #define MODE_ROTATE_CHAR (char) (MODE_ROTATE +'0') 46 #define MODE_FLIP_CHAR (char) (MODE_FLIP +'0') 47 #define MODE_TRANSLATE_CHAR (char) (MODE_TRANSLATE +'0') 48 #define MODE_BLEND_CHAR (char) (MODE_BLEND +'0') 49 #define MODE_CVTCOLOR_CHAR (char) (MODE_CVTCOLOR +'0') 50 #define MODE_FILL_CHAR (char) (MODE_FILL +'0') 51 #define MODE_NONE_CHAR (char) (MODE_NONE +'0') 52 53 #define BLUE_COLOR 0xffff0000 54 #define GREEN_COLOR 0xff00ff00 55 #define RED_COLOR 0xff0000ff 56 #define WHILE_FLAG (1 << 7) 57 58 int readArguments(int argc, char *argv[], int* parm); 59 IM_INFORMATION readInfo(char* targ); 60 int readParm(char* targ); 61 62 #endif 63 64