ThresholdMask QML Type
소스 항목을 다른 항목으로 마스킹하고 임계값을 적용합니다. 더 보기...
Import Statement: | import Qt5Compat.GraphicalEffects |
Since: | QtGraphicalEffects 1.0 |
Inherits: |
속성
- cached : bool
- maskSource : variant
- source : variant
- spread : real
- threshold : real
자세한 설명
마스크 픽셀의 threshold 값으로 마스킹 동작을 제어할 수 있습니다.
Source | 마스크 소스 | 적용된 효과 |
---|---|---|
예제
다음 예시는 효과를 적용하는 방법을 보여줍니다.
import QtQuick import Qt5Compat.GraphicalEffects Item { width: 300 height: 300 Image { id: background anchors.fill: parent source: "images/checker.png" smooth: true fillMode: Image.Tile } Image { id: bug source: "images/bug.jpg" sourceSize: Qt.size(parent.width, parent.height) smooth: true visible: false } Image { id: mask source: "images/fog.png" sourceSize: Qt.size(parent.width, parent.height) smooth: true visible: false } ThresholdMask { anchors.fill: bug source: bug maskSource: mask threshold: 0.4 spread: 0.2 } }
속성 문서
cached : bool |
이 속성을 사용하면 렌더링 성능을 향상시키기 위해 효과 출력 픽셀을 캐시할 수 있습니다.
소스 또는 효과 속성이 변경될 때마다 캐시에 있는 픽셀을 업데이트해야 합니다. 효과 출력을 저장하는 데 추가 메모리 버퍼가 필요하므로 메모리 사용량이 증가합니다.
소스 또는 효과 속성에 애니메이션이 적용될 때는 캐시를 비활성화하는 것이 좋습니다.
기본적으로 이 속성은 false
로 설정되어 있습니다.
maskSource : variant |
이 속성은 마스크로 사용할 항목을 정의합니다. 마스크 항목은 중간 픽셀 버퍼로 렌더링되고 결과의 알파 값은 디스플레이에서 소스 항목의 픽셀 가시성을 결정하는 데 사용됩니다.
원본 | 마스크 | 효과 적용 |
---|---|---|
참고: 마스크 소스를 효과의 부모로 설정하는 등 효과 자체를 포함하도록 하는 것은 지원되지 않습니다.
source : variant |
이 속성은 마스킹할 소스 항목을 정의합니다.
참고: 소스를 효과의 부모로 설정하는 등 효과에 효과 자체가 포함되도록 하는 것은 지원되지 않습니다.
spread : real |
이 속성은 threshold 알파 값 근처의 마스크 가장자리의 부드러움을 정의합니다. 스프레드를 0.0으로 설정하면 지정된 임계값으로 마스크를 정상적으로 사용합니다. 스프레드 값을 높게 설정하면 투명 마스크 픽셀과 불투명 마스크 픽셀 사이에 보간 값을 추가하여 투명 마스크 픽셀에서 불투명 마스크 픽셀로의 전환이 부드러워집니다.
값의 범위는 0.0(선명한 마스크 가장자리)에서 1.0(부드러운 마스크 가장자리)까지입니다. 기본적으로 이 속성은 0.0
로 설정되어 있습니다.
threshold : real |
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.