1
0
Fork 0
Browse Source

Move some transform related enums

devel/inspect-api
Hans-Joerg Schurr 1 year ago
parent
commit
1820b7217b
  1. 33
      src/hvif-light.c
  2. 31
      src/hvif-light.h

33
src/hvif-light.c

@ -30,11 +30,6 @@ enum
STYLE_TYPE_SOLID_GRAY_NO_ALPHA = 5,
SHAPE_TYPE_PATH_SOURCE = 10,
TRANSFORMER_TYPE_AFFINE = 20,
TRANSFORMER_TYPE_CONTOUR = 21,
TRANSFORMER_TYPE_PERSPECTIVE = 22,
TRANSFORMER_TYPE_STROKE = 23,
};
enum
@ -69,24 +64,6 @@ enum
SHAPE_FLAG_TRANSLATION = 1 << 5,
};
typedef enum hvif_line_join
{
MITER_JOIN = 0,
MITER_JOIN_REVERT = 1,
ROUND_JOIN = 2,
BEVEL_JOIN = 3,
MITER_JOIN_ROUND = 4,
HVIF_LINE_JOIN_TYPE_MAX
} hvif_line_join;
typedef enum hvif_line_cap
{
BUTT_CAP,
SQUARE_CAP,
ROUND_CAP,
HVIF_LINE_CAP_TYPE_MAX
} hvif_line_cap;
#define MATRIX_ID \
(hvif_matrix) { 1.0, 0.0, 0.0, 1.0, 0.0, 0.0 }
#define MATRIX_TRANSLATION(P) \
@ -98,7 +75,7 @@ typedef enum hvif_line_cap
typedef struct hvif_transformer hvif_transformer;
struct hvif_transformer
{
signed transformer_type;
hvif_transformer_type transformer_type;
union
{
struct
@ -537,7 +514,7 @@ read_transformer(FILE* file, hvif_transformer* transformer)
if (fread(&byte, 1, 1, file) != 1) return ERROR_EOF;
switch (byte) {
case TRANSFORMER_TYPE_AFFINE:
case HVIF_TRANSFORMER_TYPE_AFFINE:
transformer->transformer_type = byte;
uint8_t buffer[18];
hvif_matrix matrix;
@ -545,7 +522,7 @@ read_transformer(FILE* file, hvif_transformer* transformer)
hvif_decode(matrix, buffer);
transformer->transformer.affine.matrix = matrix;
break;
case TRANSFORMER_TYPE_CONTOUR:
case HVIF_TRANSFORMER_TYPE_CONTOUR:
transformer->transformer_type = byte;
if (fread(&byte, 1, 1, file) != 1) return ERROR_EOF;
transformer->transformer.contour.width = byte - 128.0;
@ -557,12 +534,12 @@ read_transformer(FILE* file, hvif_transformer* transformer)
if (fread(&byte, 1, 1, file) != 1) return ERROR_EOF;
transformer->transformer.contour.miter_limit = byte;
break;
case TRANSFORMER_TYPE_PERSPECTIVE:
case HVIF_TRANSFORMER_TYPE_PERSPECTIVE:
transformer->transformer_type = byte;
/* This seems to not do anything right now */
return ERROR_SHAPE;
break;
case TRANSFORMER_TYPE_STROKE:
case HVIF_TRANSFORMER_TYPE_STROKE:
transformer->transformer_type = byte;
if (fread(&byte, 1, 1, file) != 1) return ERROR_EOF;
transformer->transformer.stroke.width = byte - 128.0;

31
src/hvif-light.h

@ -217,6 +217,37 @@ struct hvif_point
hvif_status hvif_path_points(
hvif_image* image, uint8_t path, hvif_point** points);
/** \typedef Line joins supported by HVIF. */
typedef enum hvif_line_join
{
MITER_JOIN = 0,
MITER_JOIN_REVERT = 1,
ROUND_JOIN = 2,
BEVEL_JOIN = 3,
MITER_JOIN_ROUND = 4,
HVIF_LINE_JOIN_TYPE_MAX
} hvif_line_join;
/** \typedef Line caps supported by HVIF. */
typedef enum hvif_line_cap
{
BUTT_CAP,
SQUARE_CAP,
ROUND_CAP,
HVIF_LINE_CAP_TYPE_MAX
} hvif_line_cap;
/** \typedef Transformers supported by HVIF. */
typedef enum hvif_transformer_type
{
HVIF_TRANSFORMER_TYPE_MIN = 19,
HVIF_TRANSFORMER_TYPE_AFFINE = 20,
HVIF_TRANSFORMER_TYPE_CONTOUR = 21,
HVIF_TRANSFORMER_TYPE_PERSPECTIVE = 22,
HVIF_TRANSFORMER_TYPE_STROKE = 23,
HVIF_TRANSFORMER_TYPE_MAX = 24
} hvif_transformer_type;
/**@}*/
#endif /* HVIF_LIGHT_H */

Loading…
Cancel
Save