#pragma once #include #include #include #include // ピクセルの属性 // // 0-255 はパレット番号。 // 0 未満を特別な値として意味を持たせる。 enum PixelType { kRegularPixel = -2, // !edge (旧index3 == 1) kEdgePixel = -1, // edge (旧index3 == -1) // 0-255 は !edge }; template struct JYUSHIN_INDEX { T Y, U, V; int32_t INDEX; }; void JacobiSetupNotEquals(int SIZE, const int16_t *PIXTYPES, int16_t PIXTYPE, const double *YIN, const double *UIN, const double *VIN, const std::tuple &U_RGB, double A[3][3]); void JacobiSetupEquals(int SIZE, const int16_t *PIXTYPES, int16_t PIXTYPE, const double *YIN, const double *UIN, const double *VIN, const std::tuple &U_RGB, double A[3][3]); int Jacobi(int ct, double eps, double A[3][3], double A1[3][3], double A2[3][3], double X1[3][3], double X2[3][3]); void LuvtoRGB(double L, double u, double v, double *R, double *G, double *B); void RGBtoLuv(double R, double G, double B, double *L, double *u, double *v); void LABtoRGB(double L, double a, double b, double *R, double *G, double *B); void RGBtoLAB(double R, double G, double B, double *L, double *a, double *b); int ohtsu(int NUM, const int *X); int ohtsu2(int NUM, const double *X, const double *Y, const double *Z, int omh); int media(int NUM, const int *X); void modoshi(double V[3], double R, double G, double B, double *X, double *Y, double *Z); void kaiten(int IMAGE_SIZE, double V[3], const double *X, const double *Y, const double *Z, double *R, double *G, double *B); void kaitenEquals(int IMAGE_SIZE, double V[3], const double *X, const double *Y, const double *Z, const int16_t *INDEXED_COLOR, int16_t PALET_NO, double *R, double *G, double *B); void SobelFilterHorizontal(int hsize, int vsize, const int *IN, int *OUT); void SobelFilterVertical(int hsize, int vsize, const int *IN, int *OUT); void PrewitAbsoluteFilterVertical(int hsize, int vsize, int et, const int *IN, int *OUT, int *EDGE); void PrewitAbsoluteFilterHorizontal(int hsize, int vsize, int et, const int *IN, int *OUT, int *EDGE); int DetectEdge0(int SIZE, int et, const int *HHEDGER, const int *VVEDGER, const int *HHEDGEG, const int *VVEDGEG, const int *HHEDGEB, const int *VVEDGEB, int16_t *OUT); int DetectEdge1(int SIZE, int et, const int *HHEDGER, const int *VVEDGER, const int *HHEDGEG, const int *VVEDGEG, const int *HHEDGEB, const int *VVEDGEB, int16_t *OUT); int DetectEdge2(int SIZE, const int *EDGER, const int *VEDGER, const int *EDGEG, const int *VEDGEG, const int *EDGEB, const int *VEDGEB, int16_t *OUT); int DetectEdge3(int SIZE, int et, const int *HHEDGER, const int *VVEDGER, const int *HHEDGEG, const int *VVEDGEG, const int *HHEDGEB, const int *VVEDGEB, int16_t *OUT); int DetectEdge4(int SIZE, const int *HHEDGER, const int *VVEDGER, const int *HHEDGEG, const int *VVEDGEG, const int *HHEDGEB, const int *VVEDGEB, int16_t *OUT, double *EDGERASISAY); int DetectEdge5(int SIZE, int et, const int *HHEDGER, const int *VVEDGER, const int *HHEDGEG, const int *VVEDGEG, const int *HHEDGEB, const int *VVEDGEB, int16_t *OUT); int DetectEdge6(int SIZE, int et, const int *HHEDGER, const int *VVEDGER, const int *HHEDGEG, const int *VVEDGEG, const int *HHEDGEB, const int *VVEDGEB, int16_t *OUT); std::tuple SumEquals(int SIZE, const int16_t *PIXTYPES, int16_t PIXTYPE, const double *v1, const double *v2, const double *v3); std::tuple SumNotEquals(int SIZE, const int16_t *PIXTYPES, int16_t PIXTYPE, const double *v1, const double *v2, const double *v3); void Dithering(int IMAGE_SIZE, const double *YIN, const double *UIN, const double *VIN, int PALETTE_SIZE, const double *Y_JYUSHIN, const double *U_JYUSHIN, const double *V_JYUSHIN, int *OUT); void Dithering1(int hsize, int vsize, int dither, double per, const uint8_t *RIN, const uint8_t *GIN, const uint8_t *BIN, int PALETTE_SIZE, const uint8_t *REDUCE_R, const uint8_t *REDUCE_G, const uint8_t *REDUCE_B, int *OUT); // パレット番号に変換し OUT に出力する (edon == 2) void Dithering2(int hsize, int vsize, int dither, double per, const double *VIN, const double *YIN, const double *UIN, int PALETTE_SIZE, const JYUSHIN_INDEX *JYUSHIN_VYU, int *OUT);