-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
50 changed files
with
3,501 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
///////////////////////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Tencent is pleased to support the open source community by making libpag available. | ||
// | ||
// Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file | ||
// except in compliance with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// unless required by applicable law or agreed to in writing, software distributed under the | ||
// license is distributed on an "as is" basis, without warranties or conditions of any kind, | ||
// either express or implied. see the license for the specific language governing permissions | ||
// and limitations under the license. | ||
// | ||
///////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
#pragma once | ||
|
||
#include "pag_animator.h" | ||
#include "pag_backend_semaphore.h" | ||
#include "pag_backend_texture.h" | ||
#include "pag_byte_data.h" | ||
#include "pag_composition.h" | ||
#include "pag_decoder.h" | ||
#include "pag_disk_cache.h" | ||
#include "pag_file.h" | ||
#include "pag_font.h" | ||
#include "pag_image.h" | ||
#include "pag_image_layer.h" | ||
#include "pag_layer.h" | ||
#include "pag_player.h" | ||
#include "pag_solid_layer.h" | ||
#include "pag_surface.h" | ||
#include "pag_text_document.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
///////////////////////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Tencent is pleased to support the open source community by making libpag available. | ||
// | ||
// Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file | ||
// except in compliance with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// unless required by applicable law or agreed to in writing, software distributed under the | ||
// license is distributed on an "as is" basis, without warranties or conditions of any kind, | ||
// either express or implied. see the license for the specific language governing permissions | ||
// and limitations under the license. | ||
// | ||
///////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
#pragma once | ||
|
||
#include "pag_types.h" | ||
|
||
PAG_C_PLUS_PLUS_BEGIN_GUARD | ||
|
||
/** | ||
* Creates a new pag_animator with the specified listener. Release it by pag_release. | ||
*/ | ||
PAG_API pag_animator* pag_animator_create(pag_animator_listener* listener, void* user); | ||
|
||
PAG_API bool pag_animator_is_sync(pag_animator* animator); | ||
|
||
PAG_API void pag_animator_set_sync(pag_animator* animator, bool sync); | ||
|
||
PAG_API int64_t pag_animator_get_duration(pag_animator* animator); | ||
|
||
PAG_API void pag_animator_set_duration(pag_animator* animator, int64_t duration); | ||
|
||
PAG_API int pag_animator_get_repeat_count(pag_animator* animator); | ||
|
||
PAG_API void pag_animator_set_repeat_count(pag_animator* animator, int repeatCount); | ||
|
||
PAG_API double pag_animator_get_progress(pag_animator* animator); | ||
|
||
PAG_API void pag_animator_set_progress(pag_animator* animator, double progress); | ||
|
||
PAG_API bool pag_animator_is_running(pag_animator* animator); | ||
|
||
PAG_API void pag_animator_start(pag_animator* animator); | ||
|
||
PAG_API void pag_animator_cancel(pag_animator* animator); | ||
|
||
PAG_API void pag_animator_update(pag_animator* animator); | ||
|
||
PAG_C_PLUS_PLUS_END_GUARD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
///////////////////////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Tencent is pleased to support the open source community by making libpag available. | ||
// | ||
// Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file | ||
// except in compliance with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// unless required by applicable law or agreed to in writing, software distributed under the | ||
// license is distributed on an "as is" basis, without warranties or conditions of any kind, | ||
// either express or implied. see the license for the specific language governing permissions | ||
// and limitations under the license. | ||
// | ||
///////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
#pragma once | ||
|
||
#include "pag_types.h" | ||
|
||
PAG_C_PLUS_PLUS_BEGIN_GUARD | ||
|
||
/** | ||
* Creates a new pag_backend_semaphore. Release it by pag_release. | ||
*/ | ||
PAG_API pag_backend_semaphore* pag_backend_semaphore_create(); | ||
|
||
PAG_API bool pag_backend_semaphore_is_initialized(pag_backend_semaphore* semaphore); | ||
|
||
PAG_API void pag_backend_semaphore_init_gl(pag_backend_semaphore* semaphore, void* glSync); | ||
|
||
PAG_API void* pag_backend_semaphore_get_gl_sync(pag_backend_semaphore* semaphore); | ||
|
||
PAG_C_PLUS_PLUS_END_GUARD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
///////////////////////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Tencent is pleased to support the open source community by making libpag available. | ||
// | ||
// Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file | ||
// except in compliance with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// unless required by applicable law or agreed to in writing, software distributed under the | ||
// license is distributed on an "as is" basis, without warranties or conditions of any kind, | ||
// either express or implied. see the license for the specific language governing permissions | ||
// and limitations under the license. | ||
// | ||
///////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
#pragma once | ||
|
||
#include "pag_types.h" | ||
|
||
PAG_C_PLUS_PLUS_BEGIN_GUARD | ||
|
||
/** | ||
* Creates a new pag_backend_texture with texture info, width and height. | ||
* Release it by pag_release. | ||
*/ | ||
PAG_API pag_backend_texture* pag_backend_texture_create_from_gl_texture_info( | ||
pag_gl_texture_info textureInfo, int width, int height); | ||
|
||
PAG_API bool pag_backend_texture_get_gl_texture_info(pag_backend_texture* texture, | ||
pag_gl_texture_info* textureInfo); | ||
|
||
PAG_API bool pag_backend_texture_get_vk_image_info(pag_backend_texture* texture, | ||
pag_vk_image_info* imageInfo); | ||
|
||
PAG_API bool pag_backend_texture_get_mtl_texture_info(pag_backend_texture* texture, | ||
pag_mtl_texture_info* mtl_texture_info); | ||
|
||
PAG_C_PLUS_PLUS_END_GUARD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
///////////////////////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Tencent is pleased to support the open source community by making libpag available. | ||
// | ||
// Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file | ||
// except in compliance with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// unless required by applicable law or agreed to in writing, software distributed under the | ||
// license is distributed on an "as is" basis, without warranties or conditions of any kind, | ||
// either express or implied. see the license for the specific language governing permissions | ||
// and limitations under the license. | ||
// | ||
///////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
#pragma once | ||
|
||
#include "pag_types.h" | ||
|
||
PAG_C_PLUS_PLUS_BEGIN_GUARD | ||
|
||
/** | ||
* Creates a new pag_byte_data and copy the bytes and length. Release it by pag_release. | ||
*/ | ||
PAG_API pag_byte_data* pag_byte_data_copy(const void* bytes, size_t length); | ||
|
||
PAG_C_PLUS_PLUS_END_GUARD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
///////////////////////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Tencent is pleased to support the open source community by making libpag available. | ||
// | ||
// Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file | ||
// except in compliance with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// unless required by applicable law or agreed to in writing, software distributed under the | ||
// license is distributed on an "as is" basis, without warranties or conditions of any kind, | ||
// either express or implied. see the license for the specific language governing permissions | ||
// and limitations under the license. | ||
// | ||
///////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
#pragma once | ||
|
||
#include "pag_types.h" | ||
|
||
PAG_C_PLUS_PLUS_BEGIN_GUARD | ||
|
||
PAG_API int pag_composition_get_width(pag_composition* composition); | ||
|
||
PAG_API int pag_composition_get_height(pag_composition* composition); | ||
|
||
/** | ||
* Returns an array of layers that match the specified layer name. Release it by pag_release. | ||
*/ | ||
PAG_API pag_layer** pag_composition_get_layers_by_name(pag_composition* composition, | ||
const char* layerName, size_t* count); | ||
|
||
/** | ||
* Returns an array of layers that match the specified layer type. Release it by pag_release. | ||
*/ | ||
PAG_API pag_layer** pag_composition_get_layers_by_type(pag_composition* composition, | ||
pag_layer_type layerType, size_t* count); | ||
|
||
PAG_C_PLUS_PLUS_END_GUARD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
///////////////////////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Tencent is pleased to support the open source community by making libpag available. | ||
// | ||
// Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file | ||
// except in compliance with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// unless required by applicable law or agreed to in writing, software distributed under the | ||
// license is distributed on an "as is" basis, without warranties or conditions of any kind, | ||
// either express or implied. see the license for the specific language governing permissions | ||
// and limitations under the license. | ||
// | ||
///////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
#pragma once | ||
|
||
#include "pag_types.h" | ||
|
||
PAG_C_PLUS_PLUS_BEGIN_GUARD | ||
|
||
/** | ||
* Creates a new pag_decoder with a pag_composition, a frame rate limit, and a scale factor for the | ||
* decoded image size. Release it by pag_release. | ||
*/ | ||
PAG_API pag_decoder* pag_decoder_create(pag_composition* composition, float maxFrameRate, | ||
float scale); | ||
|
||
PAG_API int pag_decoder_get_width(pag_decoder* decoder); | ||
|
||
PAG_API int pag_decoder_get_height(pag_decoder* decoder); | ||
|
||
PAG_API int pag_decoder_get_num_frames(pag_decoder* decoder); | ||
|
||
PAG_API float pag_decoder_get_frame_rate(pag_decoder* decoder); | ||
|
||
PAG_API bool pag_decoder_check_frame_changed(pag_decoder* decoder, int index); | ||
|
||
PAG_API bool pag_decoder_read_frame(pag_decoder* decoder, int index, void* pixels, size_t rowBytes, | ||
pag_color_type colorType, pag_alpha_type alphaType); | ||
|
||
PAG_API bool pag_decoder_read_frame_to_hardware_buffer(pag_decoder* decoder, int index, | ||
void* buffer); | ||
|
||
PAG_C_PLUS_PLUS_END_GUARD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
///////////////////////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Tencent is pleased to support the open source community by making libpag available. | ||
// | ||
// Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file | ||
// except in compliance with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// unless required by applicable law or agreed to in writing, software distributed under the | ||
// license is distributed on an "as is" basis, without warranties or conditions of any kind, | ||
// either express or implied. see the license for the specific language governing permissions | ||
// and limitations under the license. | ||
// | ||
///////////////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
#pragma once | ||
|
||
#include "pag_types.h" | ||
|
||
PAG_C_PLUS_PLUS_BEGIN_GUARD | ||
|
||
PAG_API size_t pag_disk_cache_get_max_disk_size(); | ||
|
||
PAG_API void pag_disk_cache_set_max_disk_size(size_t maxDiskSize); | ||
|
||
PAG_API void pag_disk_cache_remove_all(); | ||
|
||
PAG_C_PLUS_PLUS_END_GUARD |
Oops, something went wrong.