Skip to content

Commit

Permalink
Cherry Picks Part 3
Browse files Browse the repository at this point in the history
* Various cherry picks from upstream: library updates
  • Loading branch information
sdneon committed Apr 27, 2024
1 parent 7114c56 commit 03d155d
Show file tree
Hide file tree
Showing 136 changed files with 40,587 additions and 2,590 deletions.
4 changes: 2 additions & 2 deletions src/JPEGView/JXLWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ bool JxlReader::DecodeJpegXlOneShot(const uint8_t* jxl, size_t size, std::vector
size_t icc_size;
if (JXL_DEC_SUCCESS !=
JxlDecoderGetICCProfileSize(
cache.decoder.get(), &format, JXL_COLOR_PROFILE_TARGET_DATA, &icc_size)) {
cache.decoder.get(), JXL_COLOR_PROFILE_TARGET_DATA, &icc_size)) {
return false;
}
icc_profile->resize(icc_size);
if (JXL_DEC_SUCCESS != JxlDecoderGetColorAsICCProfile(
cache.decoder.get(), &format,
cache.decoder.get(),
JXL_COLOR_PROFILE_TARGET_DATA,
icc_profile->data(), icc_profile->size())) {
return false;
Expand Down
Binary file modified src/JPEGView/libheif/bin/heif.dll
Binary file not shown.
Binary file modified src/JPEGView/libheif/bin/libde265.dll
Binary file not shown.
Binary file modified src/JPEGView/libheif/bin64/heif.dll
Binary file not shown.
Binary file modified src/JPEGView/libheif/bin64/libde265.dll
Binary file not shown.
81 changes: 81 additions & 0 deletions src/JPEGView/libheif/include/libheif/api_structs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* HEIF codec.
* Copyright (c) 2017 struktur AG, Dirk Farin <[email protected]>
*
* This file is part of libheif.
*
* libheif is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* libheif is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with libheif. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef HEIF_API_STRUCTS_H
#define HEIF_API_STRUCTS_H

#include "pixelimage.h"
#include "context.h"

#include <memory>

struct heif_image_handle
{
std::shared_ptr<HeifContext::Image> image;

// store reference to keep the context alive while we are using the handle (issue #147)
std::shared_ptr<HeifContext> context;
};


struct heif_image
{
std::shared_ptr<HeifPixelImage> image;
};


struct heif_context
{
std::shared_ptr<HeifContext> context;
};


struct heif_encoder
{
heif_encoder(const struct heif_encoder_plugin* plugin);

~heif_encoder();

struct heif_error alloc();

void release();


const struct heif_encoder_plugin* plugin;
void* encoder = nullptr;
};


struct heif_region_item
{
std::shared_ptr<HeifContext> context;
std::shared_ptr<RegionItem> region_item;
};


struct heif_region
{
std::shared_ptr<HeifContext> context; // we need this to perform coordinate transformation
//heif_item_id parent_region_item_id; // we need this to perform coordinate transformation
std::shared_ptr<RegionItem> region_item;
std::shared_ptr<RegionGeometry> region;
};

#endif
40 changes: 40 additions & 0 deletions src/JPEGView/libheif/include/libheif/avif.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* HEIF codec.
* Copyright (c) 2017 struktur AG, Dirk Farin <[email protected]>
*
* This file is part of libheif.
*
* libheif is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* libheif is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with libheif. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef HEIF_AVIF_H
#define HEIF_AVIF_H

#include <cassert>
#include <cmath>
#include <memory>

#include "heif.h"
#include "box.h"
#include "error.h"


class HeifPixelImage;

Error fill_av1C_configuration(Box_av1C::configuration* inout_config, const std::shared_ptr<HeifPixelImage>& image);

bool fill_av1C_configuration_from_stream(Box_av1C::configuration* out_config, const uint8_t* data, int dataSize);


#endif
Loading

0 comments on commit 03d155d

Please sign in to comment.