Commit 66c5196d for libheif
commit 66c5196d3ba3b1decb40e068eca34d39731c5c86
Author: Dirk Farin <dirk.farin@gmail.com>
Date: Fri May 15 13:53:26 2026 +0200
consistently use typedefs instead of enum types to fix Go compilation
diff --git a/go/heif/heif.go b/go/heif/heif.go
index 85fe854f..02db5846 100644
--- a/go/heif/heif.go
+++ b/go/heif/heif.go
@@ -49,7 +49,7 @@ func GetVersion() string {
return C.GoString(C.heif_get_version())
}
-type Compression C.enum_heif_compression_format
+type Compression C.heif_compression_format
const (
CompressionUndefined = C.heif_compression_undefined
@@ -65,7 +65,7 @@ const (
CompressionHTJ2K = C.heif_compression_HTJ2K
)
-type Chroma C.enum_heif_chroma
+type Chroma C.heif_chroma
const (
ChromaUndefined = C.heif_chroma_undefined
@@ -85,7 +85,7 @@ const (
ChromaInterleaved32Bit = C.heif_chroma_interleaved_32bit
)
-type ChromaDownsamplingAlgorithm C.enum_heif_chroma_downsampling_algorithm
+type ChromaDownsamplingAlgorithm C.heif_chroma_downsampling_algorithm
const (
ChromaDownsamplingAverage = C.heif_chroma_downsampling_average
@@ -93,14 +93,14 @@ const (
ChromaDownsamplingSharpYUV = C.heif_chroma_downsampling_sharp_yuv
)
-type ChromaUpsamplingAlgorithm C.enum_heif_chroma_upsampling_algorithm
+type ChromaUpsamplingAlgorithm C.heif_chroma_upsampling_algorithm
const (
ChromaUpsamplingNearestNeighbor = C.heif_chroma_upsampling_nearest_neighbor
ChromaUpsamplingBilinear = C.heif_chroma_upsampling_bilinear
)
-type Colorspace C.enum_heif_colorspace
+type Colorspace C.heif_colorspace
const (
ColorspaceUndefined = C.heif_colorspace_undefined
@@ -112,7 +112,7 @@ const (
ColorspaceNonvisual = C.heif_colorspace_nonvisual
)
-type Channel C.enum_heif_channel
+type Channel C.heif_channel
const (
ChannelY = C.heif_channel_Y
@@ -129,7 +129,7 @@ const (
ChannelUnknown = C.heif_channel_unknown
)
-type ProgressStep C.enum_heif_progress_step
+type ProgressStep C.heif_progress_step
const (
ProgressStepTotal = C.heif_progress_step_total
@@ -154,7 +154,7 @@ const (
// --- HeifError
-type ErrorCode C.enum_heif_error_code
+type ErrorCode C.heif_error_code
const (
ErrorOK = C.heif_error_Ok
@@ -196,7 +196,7 @@ const (
ErrorCanceled = C.heif_error_Canceled
)
-type ErrorSubcode C.enum_heif_suberror_code
+type ErrorSubcode C.heif_suberror_code
const (
// no further information available
@@ -517,7 +517,7 @@ func (c *Context) convertEncoderDescriptor(d *C.struct_heif_encoder_descriptor)
func (c *Context) NewEncoder(compression Compression) (*Encoder, error) {
const max = 1
descriptors := make([]*C.struct_heif_encoder_descriptor, max)
- num := int(C.heif_context_get_encoder_descriptors(c.context, uint32(compression), nil, &descriptors[0], C.int(max)))
+ num := int(C.heif_context_get_encoder_descriptors(c.context, C.heif_compression_format(compression), nil, &descriptors[0], C.int(max)))
runtime.KeepAlive(c)
if num == 0 {
return nil, fmt.Errorf("no encoder for compression %v", compression)
@@ -718,7 +718,7 @@ type Image struct {
func NewImage(width, height int, colorspace Colorspace, chroma Chroma) (*Image, error) {
var image Image
- err := C.heif_image_create(C.int(width), C.int(height), uint32(colorspace), uint32(chroma), &image.image)
+ err := C.heif_image_create(C.int(width), C.int(height), C.heif_colorspace(colorspace), C.heif_chroma(chroma), &image.image)
if err := convertHeifError(err); err != nil {
return nil, err
}
@@ -739,7 +739,7 @@ func (h *ImageHandle) DecodeImage(colorspace Colorspace, chroma Chroma, options
opt = options.options
}
- err := C.heif_decode_image(h.handle, &image.image, uint32(colorspace), uint32(chroma), opt)
+ err := C.heif_decode_image(h.handle, &image.image, C.heif_colorspace(colorspace), C.heif_chroma(chroma), opt)
runtime.KeepAlive(h)
if err := convertHeifError(err); err != nil {
return nil, err
@@ -762,25 +762,25 @@ func (img *Image) GetChromaFormat() Chroma {
}
func (img *Image) GetWidth(channel Channel) int {
- i := int(C.heif_image_get_width(img.image, C.enum_heif_channel(channel)))
+ i := int(C.heif_image_get_width(img.image, C.heif_channel(channel)))
runtime.KeepAlive(img)
return i
}
func (img *Image) GetHeight(channel Channel) int {
- i := int(C.heif_image_get_height(img.image, C.enum_heif_channel(channel)))
+ i := int(C.heif_image_get_height(img.image, C.heif_channel(channel)))
runtime.KeepAlive(img)
return i
}
func (img *Image) GetBitsPerPixel(channel Channel) int {
- i := int(C.heif_image_get_bits_per_pixel(img.image, C.enum_heif_channel(channel)))
+ i := int(C.heif_image_get_bits_per_pixel(img.image, C.heif_channel(channel)))
runtime.KeepAlive(img)
return i
}
func (img *Image) GetBitsPerPixelRange(channel Channel) int {
- i := int(C.heif_image_get_bits_per_pixel_range(img.image, C.enum_heif_channel(channel)))
+ i := int(C.heif_image_get_bits_per_pixel_range(img.image, C.heif_channel(channel)))
runtime.KeepAlive(img)
return i
}
@@ -1168,14 +1168,14 @@ func (i *ImageAccess) setData(data []byte, stride int) {
}
func (img *Image) GetPlane(channel Channel) (*ImageAccess, error) {
- height := C.heif_image_get_height(img.image, C.enum_heif_channel(channel))
+ height := C.heif_image_get_height(img.image, C.heif_channel(channel))
runtime.KeepAlive(img)
if height == -1 {
return nil, fmt.Errorf("No such channel %v", channel)
}
var stride C.int
- plane := C.heif_image_get_plane(img.image, C.enum_heif_channel(channel), &stride)
+ plane := C.heif_image_get_plane(img.image, C.heif_channel(channel), &stride)
runtime.KeepAlive(img)
if plane == nil {
return nil, fmt.Errorf("No such channel %v", channel)
@@ -1194,7 +1194,7 @@ func (img *Image) GetPlane(channel Channel) (*ImageAccess, error) {
}
func (img *Image) NewPlane(channel Channel, width, height, depth int) (*ImageAccess, error) {
- err := C.heif_image_add_plane(img.image, C.enum_heif_channel(channel), C.int(width), C.int(height), C.int(depth))
+ err := C.heif_image_add_plane(img.image, C.heif_channel(channel), C.int(width), C.int(height), C.int(depth))
runtime.KeepAlive(img)
if err := convertHeifError(err); err != nil {
return nil, err
diff --git a/libheif/api/libheif/heif_color.h b/libheif/api/libheif/heif_color.h
index c9dcfc8d..2c8953fe 100644
--- a/libheif/api/libheif/heif_color.h
+++ b/libheif/api/libheif/heif_color.h
@@ -55,8 +55,8 @@ typedef struct heif_color_conversion_options
// --- version 1 options
- enum heif_chroma_downsampling_algorithm preferred_chroma_downsampling_algorithm;
- enum heif_chroma_upsampling_algorithm preferred_chroma_upsampling_algorithm;
+ heif_chroma_downsampling_algorithm preferred_chroma_downsampling_algorithm;
+ heif_chroma_upsampling_algorithm preferred_chroma_upsampling_algorithm;
// When set to 'false' libheif may also use a different algorithm if the preferred one is not available
// or using a different algorithm is computationally less complex. Note that currently (v1.17.0) this
@@ -85,7 +85,7 @@ typedef struct heif_color_conversion_options_ext
// --- version 1 options
- enum heif_alpha_composition_mode alpha_composition_mode;
+ heif_alpha_composition_mode alpha_composition_mode;
// color values should be specified in the range [0, 65535]
uint16_t background_red, background_green, background_blue;
@@ -126,7 +126,7 @@ typedef enum heif_color_profile_type
// However, you can still use heif_image_handle_get_raw_color_profile() and
// heif_image_handle_get_nclx_color_profile() to access both profiles.
LIBHEIF_API
-enum heif_color_profile_type heif_image_handle_get_color_profile_type(const heif_image_handle* handle);
+heif_color_profile_type heif_image_handle_get_color_profile_type(const heif_image_handle* handle);
LIBHEIF_API
size_t heif_image_handle_get_raw_color_profile_size(const heif_image_handle* handle);
@@ -198,9 +198,9 @@ typedef struct heif_color_profile_nclx
uint8_t version;
- enum heif_color_primaries color_primaries;
- enum heif_transfer_characteristics transfer_characteristics;
- enum heif_matrix_coefficients matrix_coefficients;
+ heif_color_primaries color_primaries;
+ heif_transfer_characteristics transfer_characteristics;
+ heif_matrix_coefficients matrix_coefficients;
uint8_t full_range_flag;
// --- decoded values (not used when saving nclx)
@@ -240,7 +240,7 @@ void heif_nclx_color_profile_free(heif_color_profile_nclx* nclx_profile);
// This function will now return ICC if one is present and NCLX only if there is no ICC.
// You may better avoid this function and simply query for NCLX and ICC directly.
LIBHEIF_API
-enum heif_color_profile_type heif_image_get_color_profile_type(const heif_image* image);
+heif_color_profile_type heif_image_get_color_profile_type(const heif_image* image);
// Returns the size of the ICC profile if one is assigned to the image. Otherwise, it returns 0.
LIBHEIF_API
diff --git a/libheif/api/libheif/heif_cxx.h b/libheif/api/libheif/heif_cxx.h
index bdc22666..ed2420b9 100644
--- a/libheif/api/libheif/heif_cxx.h
+++ b/libheif/api/libheif/heif_cxx.h
@@ -323,8 +323,8 @@ namespace heif {
// throws Error
void create(int width, int height,
- enum heif_colorspace colorspace,
- enum heif_chroma chroma);
+ heif_colorspace colorspace,
+ heif_chroma chroma);
// throws Error
void add_plane(enum heif_channel channel,
@@ -391,14 +391,14 @@ namespace heif {
{
public:
static std::vector<EncoderDescriptor>
- get_encoder_descriptors(enum heif_compression_format format_filter,
+ get_encoder_descriptors(heif_compression_format format_filter,
const char* name_filter) noexcept;
std::string get_name() const noexcept;
std::string get_id_name() const noexcept;
- enum heif_compression_format get_compression_format() const noexcept;
+ heif_compression_format get_compression_format() const noexcept;
// DEPRECATED: typo in function name
bool supportes_lossy_compression() const noexcept;
@@ -453,7 +453,7 @@ namespace heif {
{
public:
// throws Error
- Encoder(enum heif_compression_format format);
+ Encoder(heif_compression_format format);
// throws Error
void set_lossy_quality(int quality);
@@ -859,8 +859,8 @@ namespace heif {
inline void Image::create(int width, int height,
- enum heif_colorspace colorspace,
- enum heif_chroma chroma)
+ heif_colorspace colorspace,
+ heif_chroma chroma)
{
heif_image* image;
Error err = Error(heif_image_create(width, height, colorspace, chroma, &image));
@@ -1023,7 +1023,7 @@ namespace heif {
inline std::vector<EncoderDescriptor>
- EncoderDescriptor::get_encoder_descriptors(enum heif_compression_format format_filter,
+ EncoderDescriptor::get_encoder_descriptors(heif_compression_format format_filter,
const char* name_filter) noexcept
{
int maxDescriptors = 10;
@@ -1066,7 +1066,7 @@ namespace heif {
return heif_encoder_descriptor_get_id_name(m_descriptor);
}
- inline enum heif_compression_format EncoderDescriptor::get_compression_format() const noexcept
+ inline heif_compression_format EncoderDescriptor::get_compression_format() const noexcept
{
return heif_encoder_descriptor_get_compression_format(m_descriptor);
}
@@ -1103,7 +1103,7 @@ namespace heif {
}
- inline Encoder::Encoder(enum heif_compression_format format)
+ inline Encoder::Encoder(heif_compression_format format)
{
heif_encoder* encoder;
Error err = Error(heif_context_get_encoder_for_format(nullptr, format, &encoder));
diff --git a/libheif/api/libheif/heif_decoding.h b/libheif/api/libheif/heif_decoding.h
index 3078327d..3f1e8902 100644
--- a/libheif/api/libheif/heif_decoding.h
+++ b/libheif/api/libheif/heif_decoding.h
@@ -50,7 +50,7 @@ int heif_context_get_max_decoding_threads(const heif_context* ctx);
// Note that the decoder still may not be able to decode all variants of that format.
// You will have to query that further (todo) or just try to decode and check the returned error.
LIBHEIF_API
-int heif_have_decoder_for_format(enum heif_compression_format format);
+int heif_have_decoder_for_format(heif_compression_format format);
typedef enum heif_progress_step
@@ -71,11 +71,11 @@ typedef struct heif_decoding_options
uint8_t ignore_transformations;
// Any of the progress functions may be called from background threads.
- void (* start_progress)(enum heif_progress_step step, int max_progress, void* progress_user_data);
+ void (* start_progress)(heif_progress_step step, int max_progress, void* progress_user_data);
- void (* on_progress)(enum heif_progress_step step, int progress, void* progress_user_data);
+ void (* on_progress)(heif_progress_step step, int progress, void* progress_user_data);
- void (* end_progress)(enum heif_progress_step step, void* progress_user_data);
+ void (* end_progress)(heif_progress_step step, void* progress_user_data);
void* progress_user_data;
@@ -143,7 +143,7 @@ typedef struct heif_decoder_descriptor heif_decoder_descriptor;
// The number of decoders is returned, which are not more than 'count' if (out_decoders != nullptr).
// By setting out_decoders==nullptr, you can query the number of decoders, 'count' is ignored.
LIBHEIF_API
-int heif_get_decoder_descriptors(enum heif_compression_format format_filter,
+int heif_get_decoder_descriptors(heif_compression_format format_filter,
const heif_decoder_descriptor** out_decoders,
int count);
@@ -168,8 +168,8 @@ const char* heif_decoder_descriptor_get_id_name(const heif_decoder_descriptor*);
LIBHEIF_API
heif_error heif_decode_image(const heif_image_handle* in_handle,
heif_image** out_img,
- enum heif_colorspace colorspace,
- enum heif_chroma chroma,
+ heif_colorspace colorspace,
+ heif_chroma chroma,
const heif_decoding_options* options);
#ifdef __cplusplus
diff --git a/libheif/api/libheif/heif_emscripten.h b/libheif/api/libheif/heif_emscripten.h
index 39266524..f65cacc5 100644
--- a/libheif/api/libheif/heif_emscripten.h
+++ b/libheif/api/libheif/heif_emscripten.h
@@ -222,7 +222,7 @@ static int round_odd(int v) {
}
static emscripten::val heif_js_decode_image(struct heif_image_handle* handle,
- enum heif_colorspace colorspace, enum heif_chroma chroma)
+ heif_colorspace colorspace, heif_chroma chroma)
{
emscripten::val result = emscripten::val::object();
if (!handle) {
@@ -323,7 +323,7 @@ static emscripten::val heif_js_decode_image(struct heif_image_handle* handle,
* This image has to be released after the image data has been read (copied) with heif_image_release().
*/
static emscripten::val heif_js_decode_image2(struct heif_image_handle* handle,
- enum heif_colorspace colorspace, enum heif_chroma chroma)
+ heif_colorspace colorspace, heif_chroma chroma)
{
emscripten::val result = emscripten::val::object();
if (!handle) {
diff --git a/libheif/api/libheif/heif_encoding.h b/libheif/api/libheif/heif_encoding.h
index f7f6e375..eba9f75a 100644
--- a/libheif/api/libheif/heif_encoding.h
+++ b/libheif/api/libheif/heif_encoding.h
@@ -56,7 +56,7 @@ typedef struct heif_encoder_parameter heif_encoder_parameter;
// Note that the encoder may be limited to a certain subset of features (e.g. only 8 bit, only lossy).
// You will have to query the specific capabilities further.
LIBHEIF_API
-int heif_have_encoder_for_format(enum heif_compression_format format);
+int heif_have_encoder_for_format(heif_compression_format format);
// Get a list of available encoders. You can filter the encoders by compression format and name.
// Use format_filter==heif_compression_undefined and name_filter==NULL as wildcards.
@@ -65,7 +65,7 @@ int heif_have_encoder_for_format(enum heif_compression_format format);
// By setting out_encoders==nullptr, you can query the number of encoders, 'count' is ignored.
// Note: to get the actual encoder from the descriptors returned here, use heif_context_get_encoder().
LIBHEIF_API
-int heif_get_encoder_descriptors(enum heif_compression_format format_filter,
+int heif_get_encoder_descriptors(heif_compression_format format_filter,
const char* name_filter,
const heif_encoder_descriptor** out_encoders,
int count);
@@ -80,7 +80,7 @@ LIBHEIF_API
const char* heif_encoder_descriptor_get_id_name(const heif_encoder_descriptor*);
LIBHEIF_API
-enum heif_compression_format
+heif_compression_format
heif_encoder_descriptor_get_compression_format(const heif_encoder_descriptor*);
LIBHEIF_API
@@ -100,7 +100,7 @@ heif_error heif_context_get_encoder(heif_context* context,
// for this format, the encoder with the highest plugin priority will be returned.
LIBHEIF_API
heif_error heif_context_get_encoder_for_format(heif_context* context,
- enum heif_compression_format format,
+ heif_compression_format format,
heif_encoder**);
/**
@@ -407,7 +407,7 @@ int heif_encoder_descriptor_supportes_lossless_compression(const heif_encoder_de
// Note: to get the actual encoder from the descriptors returned here, use heif_context_get_encoder().
LIBHEIF_API
int heif_context_get_encoder_descriptors(heif_context*, // TODO: why do we need this parameter?
- enum heif_compression_format format_filter,
+ heif_compression_format format_filter,
const char* name_filter,
const heif_encoder_descriptor** out_encoders,
int count);
diff --git a/libheif/api/libheif/heif_error.h b/libheif/api/libheif/heif_error.h
index a5097bcc..29dc48a4 100644
--- a/libheif/api/libheif/heif_error.h
+++ b/libheif/api/libheif/heif_error.h
@@ -284,10 +284,10 @@ typedef enum heif_suberror_code
typedef struct heif_error
{
// main error category
- enum heif_error_code code;
+ heif_error_code code;
// more detailed error code
- enum heif_suberror_code subcode;
+ heif_suberror_code subcode;
// textual error message (is always defined, you do not have to check for NULL)
const char* message;
diff --git a/libheif/api/libheif/heif_image.h b/libheif/api/libheif/heif_image.h
index 6b903d27..a4b13215 100644
--- a/libheif/api/libheif/heif_image.h
+++ b/libheif/api/libheif/heif_image.h
@@ -182,11 +182,11 @@ typedef struct heif_security_limits heif_security_limits;
// Get the colorspace format of the image.
LIBHEIF_API
-enum heif_colorspace heif_image_get_colorspace(const heif_image*);
+heif_colorspace heif_image_get_colorspace(const heif_image*);
// Get the chroma format of the image.
LIBHEIF_API
-enum heif_chroma heif_image_get_chroma_format(const heif_image*);
+heif_chroma heif_image_get_chroma_format(const heif_image*);
/**
* Get the width of a specified image channel.
@@ -249,7 +249,7 @@ heif_error heif_image_extract_area(const heif_image*,
// Especially for HDR images, this is probably not what you want. Have a look at
// heif_image_get_bits_per_pixel_range() instead.
LIBHEIF_API
-int heif_image_get_bits_per_pixel(const heif_image*, enum heif_channel channel);
+int heif_image_get_bits_per_pixel(const heif_image*, heif_channel channel);
// Get the number of bits per pixel in the given image channel. This function returns
// the number of bits used for representing the pixel value, which might be smaller
@@ -258,10 +258,10 @@ int heif_image_get_bits_per_pixel(const heif_image*, enum heif_channel channel);
// are reserved for storage. For interleaved RGBA with 12 bit, this function also returns
// '12', not '48' or '64' (heif_image_get_bits_per_pixel returns 64 in this case).
LIBHEIF_API
-int heif_image_get_bits_per_pixel_range(const heif_image*, enum heif_channel channel);
+int heif_image_get_bits_per_pixel_range(const heif_image*, heif_channel channel);
LIBHEIF_API
-int heif_image_has_channel(const heif_image*, enum heif_channel channel);
+int heif_image_has_channel(const heif_image*, heif_channel channel);
// Get a pointer to the actual pixel data.
// The 'out_stride' is returned as "bytes per line".
@@ -270,13 +270,13 @@ int heif_image_has_channel(const heif_image*, enum heif_channel channel);
// Deprecated, use the safer version heif_image_get_plane_readonly2() instead.
LIBHEIF_API
const uint8_t* heif_image_get_plane_readonly(const heif_image*,
- enum heif_channel channel,
+ heif_channel channel,
int* out_stride);
// Deprecated, use the safer version heif_image_get_plane2() instead.
LIBHEIF_API
uint8_t* heif_image_get_plane(heif_image*,
- enum heif_channel channel,
+ heif_channel channel,
int* out_stride);
// These are safer variants of the two functions above.
@@ -285,12 +285,12 @@ uint8_t* heif_image_get_plane(heif_image*,
// The changed 'stride' parameter type eliminates this common error.
LIBHEIF_API
const uint8_t* heif_image_get_plane_readonly2(const heif_image*,
- enum heif_channel channel,
+ heif_channel channel,
size_t* out_stride);
LIBHEIF_API
uint8_t* heif_image_get_plane2(heif_image*,
- enum heif_channel channel,
+ heif_channel channel,
size_t* out_stride);
@@ -364,8 +364,8 @@ void heif_image_set_omaf_image_projection(const heif_image*, heif_omaf_image_pro
*/
LIBHEIF_API
heif_error heif_image_create(int width, int height,
- enum heif_colorspace colorspace,
- enum heif_chroma chroma,
+ heif_colorspace colorspace,
+ heif_chroma chroma,
heif_image** out_image);
/**
@@ -398,7 +398,7 @@ heif_error heif_image_create(int width, int height,
*/
LIBHEIF_API
heif_error heif_image_add_plane(heif_image* image,
- enum heif_channel channel,
+ heif_channel channel,
int width, int height, int bit_depth);
/*
@@ -407,7 +407,7 @@ heif_error heif_image_add_plane(heif_image* image,
*/
LIBHEIF_API
heif_error heif_image_add_plane_safe(heif_image* image,
- enum heif_channel channel,
+ heif_channel channel,
int width, int height, int bit_depth,
const heif_security_limits* limits);
diff --git a/libheif/api/libheif/heif_image_handle.h b/libheif/api/libheif/heif_image_handle.h
index 5bd3f29a..d883bfcc 100644
--- a/libheif/api/libheif/heif_image_handle.h
+++ b/libheif/api/libheif/heif_image_handle.h
@@ -91,8 +91,8 @@ int heif_image_handle_get_chroma_bits_per_pixel(const heif_image_handle*);
// You can still request the output in your preferred colorspace, but this may involve an internal conversion.
LIBHEIF_API
heif_error heif_image_handle_get_preferred_decoding_colorspace(const heif_image_handle* image_handle,
- enum heif_colorspace* out_colorspace,
- enum heif_chroma* out_chroma);
+ heif_colorspace* out_colorspace,
+ heif_chroma* out_chroma);
// Get the image width from the 'ispe' box. This is the original image size without
// any transformations applied to it. Do not use this unless you know exactly what
diff --git a/libheif/api/libheif/heif_plugin.h b/libheif/api/libheif/heif_plugin.h
index ce7a9859..86074dea 100644
--- a/libheif/api/libheif/heif_plugin.h
+++ b/libheif/api/libheif/heif_plugin.h
@@ -61,14 +61,14 @@ extern "C" {
typedef struct heif_decoder_plugin_compressed_format_description
{
- enum heif_compression_format format;
+ heif_compression_format format;
} heif_decoder_plugin_compressed_format_description;
typedef struct heif_decoder_plugin_options
{
- enum heif_compression_format format;
+ heif_compression_format format;
int strict_decoding; // bool
int num_threads; // 0 - undefined, use decoder default
@@ -95,7 +95,7 @@ typedef struct heif_decoder_plugin
// Query whether the plugin supports decoding of the given format
// Result is a priority value. The plugin with the largest value wins.
// Default priority is 100. Returning 0 indicates that the plugin cannot decode this format.
- int (* does_support_format)(enum heif_compression_format format);
+ int (* does_support_format)(heif_compression_format format);
// Create a new decoder context for decoding an image
heif_error (* new_decoder)(void** decoder);
@@ -191,7 +191,7 @@ typedef struct heif_encoder_plugin
// --- version 1 functions ---
// The compression format generated by this plugin.
- enum heif_compression_format compression_format;
+ heif_compression_format compression_format;
// Short name of the encoder that can be used as command line parameter when selecting an encoder.
// Hence, it should stay stable and not contain any version numbers that will change.
@@ -250,8 +250,8 @@ typedef struct heif_encoder_plugin
// Replace the input colorspace/chroma with the one that is supported by the encoder and that
// comes as close to the input colorspace/chroma as possible.
- void (* query_input_colorspace)(enum heif_colorspace* inout_colorspace,
- enum heif_chroma* inout_chroma);
+ void (* query_input_colorspace)(heif_colorspace* inout_colorspace,
+ heif_chroma* inout_chroma);
// Encode an image.
// After pushing an image into the encoder, you should call get_compressed_data() to
@@ -268,8 +268,8 @@ typedef struct heif_encoder_plugin
// --- version 2 ---
void (* query_input_colorspace2)(void* encoder,
- enum heif_colorspace* inout_colorspace,
- enum heif_chroma* inout_chroma);
+ heif_colorspace* inout_colorspace,
+ heif_chroma* inout_chroma);
// --- version 3 ---
diff --git a/libheif/api/libheif/heif_sequences.cc b/libheif/api/libheif/heif_sequences.cc
index 5d087c86..f7c9a4cf 100644
--- a/libheif/api/libheif/heif_sequences.cc
+++ b/libheif/api/libheif/heif_sequences.cc
@@ -520,9 +520,9 @@ heif_error heif_track_encode_sequence_image(heif_track* track,
encoding_options->output_nclx_profile = &nclx;
nclx.version = 1;
- nclx.color_primaries = (enum heif_color_primaries) input_nclx.get_colour_primaries();
- nclx.transfer_characteristics = (enum heif_transfer_characteristics) input_nclx.get_transfer_characteristics();
- nclx.matrix_coefficients = (enum heif_matrix_coefficients) input_nclx.get_matrix_coefficients();
+ nclx.color_primaries = (heif_color_primaries) input_nclx.get_colour_primaries();
+ nclx.transfer_characteristics = (heif_transfer_characteristics) input_nclx.get_transfer_characteristics();
+ nclx.matrix_coefficients = (heif_matrix_coefficients) input_nclx.get_matrix_coefficients();
nclx.full_range_flag = input_nclx.get_full_range_flag();
}
}
diff --git a/libheif/api/libheif/heif_sequences.h b/libheif/api/libheif/heif_sequences.h
index 7ac5e128..4012f1ee 100644
--- a/libheif/api/libheif/heif_sequences.h
+++ b/libheif/api/libheif/heif_sequences.h
@@ -182,8 +182,8 @@ heif_error heif_track_get_image_resolution(const heif_track*, uint16_t* out_widt
LIBHEIF_API
heif_error heif_track_decode_next_image(heif_track* track,
heif_image** out_img,
- enum heif_colorspace colorspace,
- enum heif_chroma chroma,
+ heif_colorspace colorspace,
+ heif_chroma chroma,
const heif_decoding_options* options);
/**
diff --git a/libheif/api/libheif/heif_tiling.h b/libheif/api/libheif/heif_tiling.h
index bc3f038a..4de5a117 100644
--- a/libheif/api/libheif/heif_tiling.h
+++ b/libheif/api/libheif/heif_tiling.h
@@ -85,8 +85,8 @@ typedef struct heif_decoding_options heif_decoding_options;
LIBHEIF_API
heif_error heif_image_handle_decode_image_tile(const heif_image_handle* in_handle,
heif_image** out_img,
- enum heif_colorspace colorspace,
- enum heif_chroma chroma,
+ heif_colorspace colorspace,
+ heif_chroma chroma,
const heif_decoding_options* options,
uint32_t tile_x, uint32_t tile_y);