Krita Source Code Documentation
Loading...
Searching...
No Matches
psd_layer_type_shape Struct Reference

#include <psd_additional_layer_info_block.h>

Public Member Functions

void setBottom (float val)
 
void setEngineData (QByteArray ba)
 
void setIndex (int val)
 
void setLeft (float val)
 
void setRight (float val)
 
void setTop (float val)
 
void setWritingMode (const QString val)
 
QDomDocument textDataASLXML ()
 
QDomDocument textWarpXML ()
 

Static Public Member Functions

static void setupCatcher (const QString path, KisAslCallbackObjectCatcher &catcher, psd_layer_type_shape *data)
 

Public Attributes

QRectF boundingBox
 
QRectF bounds
 
QVariantHash engineData
 
bool isHorizontal {true}
 
QString text
 
int textIndex
 
QTransform transform
 

Detailed Description

Definition at line 849 of file psd_additional_layer_info_block.h.

Member Function Documentation

◆ setBottom()

void psd_layer_type_shape::setBottom ( float val)
inline

Definition at line 875 of file psd_additional_layer_info_block.h.

875 {
876 bounds.setBottom(val);
877 }

References bounds.

◆ setEngineData()

void psd_layer_type_shape::setEngineData ( QByteArray ba)
inline

Definition at line 859 of file psd_additional_layer_info_block.h.

859 {
860 KisCosParser parser;
861 engineData = parser.parseCosToJson(&ba);
862 }
The KisCosParser class.
QVariantHash parseCosToJson(QByteArray *ba)

References KisCosParser::parseCosToJson().

◆ setIndex()

void psd_layer_type_shape::setIndex ( int val)
inline

Definition at line 863 of file psd_additional_layer_info_block.h.

◆ setLeft()

void psd_layer_type_shape::setLeft ( float val)
inline

Definition at line 869 of file psd_additional_layer_info_block.h.

869 {
870 bounds.setLeft(val);
871 }

References bounds.

◆ setRight()

void psd_layer_type_shape::setRight ( float val)
inline

Definition at line 872 of file psd_additional_layer_info_block.h.

872 {
873 bounds.setRight(val);
874 }

References bounds.

◆ setTop()

void psd_layer_type_shape::setTop ( float val)
inline

Definition at line 866 of file psd_additional_layer_info_block.h.

866 {
867 bounds.setTop(val);
868 }

References bounds.

◆ setupCatcher()

static void psd_layer_type_shape::setupCatcher ( const QString path,
KisAslCallbackObjectCatcher & catcher,
psd_layer_type_shape * data )
inlinestatic

Definition at line 886 of file psd_additional_layer_info_block.h.

886 {
887 catcher.subscribeInteger(path + "/TxLr/TextIndex", std::bind(&psd_layer_type_shape::setIndex, data, std::placeholders::_1));
888 catcher.subscribeRawData(path + "/TxLr/EngineData", std::bind(&psd_layer_type_shape::setEngineData, data, std::placeholders::_1));
889 catcher.subscribeEnum(path + "/TxLr/Ornt", "Ornt", std::bind(&psd_layer_type_shape::setWritingMode, data, std::placeholders::_1));
890
891 // Older psd use Pnt as the unit, even though its pixel.
892 catcher.subscribeUnitFloat(path + "/TxLr/bounds/Left", "#Pnt", std::bind(&psd_layer_type_shape::setLeft, data, std::placeholders::_1));
893 catcher.subscribeUnitFloat(path + "/TxLr/bounds/Top ", "#Pnt", std::bind(&psd_layer_type_shape::setTop, data, std::placeholders::_1));
894 catcher.subscribeUnitFloat(path + "/TxLr/bounds/Rght", "#Pnt", std::bind(&psd_layer_type_shape::setRight, data, std::placeholders::_1));
895 catcher.subscribeUnitFloat(path + "/TxLr/bounds/Btom", "#Pnt", std::bind(&psd_layer_type_shape::setBottom, data, std::placeholders::_1));
896
897 // Newer photoshop files use pxl as the unit, which is correct...
898 catcher.subscribeUnitFloat(path + "/TxLr/bounds/Left", "#Pxl", std::bind(&psd_layer_type_shape::setLeft, data, std::placeholders::_1));
899 catcher.subscribeUnitFloat(path + "/TxLr/bounds/Top ", "#Pxl", std::bind(&psd_layer_type_shape::setTop, data, std::placeholders::_1));
900 catcher.subscribeUnitFloat(path + "/TxLr/bounds/Rght", "#Pxl", std::bind(&psd_layer_type_shape::setRight, data, std::placeholders::_1));
901 catcher.subscribeUnitFloat(path + "/TxLr/bounds/Btom", "#Pxl", std::bind(&psd_layer_type_shape::setBottom, data, std::placeholders::_1));
902 }
void subscribeRawData(const QString &path, ASLCallbackRawData callback)
void subscribeEnum(const QString &path, const QString &typeId, ASLCallbackString callback)
void subscribeInteger(const QString &path, ASLCallbackInteger callback)
void subscribeUnitFloat(const QString &path, const QString &unit, ASLCallbackDouble callback)
void setWritingMode(const QString val)

References setBottom(), setEngineData(), setIndex(), setLeft(), setRight(), setTop(), setWritingMode(), KisAslCallbackObjectCatcher::subscribeEnum(), KisAslCallbackObjectCatcher::subscribeInteger(), KisAslCallbackObjectCatcher::subscribeRawData(), and KisAslCallbackObjectCatcher::subscribeUnitFloat().

◆ setWritingMode()

void psd_layer_type_shape::setWritingMode ( const QString val)
inline

Definition at line 878 of file psd_additional_layer_info_block.h.

878 {
879 if (val == "Hrzn") {
880 isHorizontal = true;
881 } else {
882 isHorizontal = false;
883 }
884 }

◆ textDataASLXML()

QDomDocument psd_layer_type_shape::textDataASLXML ( )
inline

Definition at line 904 of file psd_additional_layer_info_block.h.

904 {
906 w.enterDescriptor("", "", "TxLr");
907
908 w.writeText("Txt ", text);
909 w.writeEnum("textGridding", "textGridding", "none");
910 if (isHorizontal) {
911 w.writeEnum("Ornt", "Ornt", "Hrzn");
912 } else {
913 w.writeEnum("Ornt", "Ornt", "Vrtc");
914 }
915 w.writeEnum("AntA", "Annt", "AnCr");
916 if (!bounds.isEmpty()) {
917 w.enterDescriptor("bounds", "", "bounds");
918 w.writeUnitFloat("Left", "#Pnt", bounds.left());
919 w.writeUnitFloat("Top ", "#Pnt", bounds.top());
920 w.writeUnitFloat("Rght", "#Pnt", bounds.right());
921 w.writeUnitFloat("Btom", "#Pnt", bounds.bottom());
922 w.leaveDescriptor();
923 }
924 if (!boundingBox.isEmpty()) {
925 w.enterDescriptor("boundingBox", "", "boundingBox");
926 w.writeUnitFloat("Left", "#Pnt", boundingBox.left());
927 w.writeUnitFloat("Top ", "#Pnt", boundingBox.top());
928 w.writeUnitFloat("Rght", "#Pnt", boundingBox.right());
929 w.writeUnitFloat("Btom", "#Pnt", boundingBox.bottom());
930 w.leaveDescriptor();
931 }
932 w.writeInteger("TextIndex", textIndex);
934 w.writeRawData("EngineData", &ba);
935
936 w.leaveDescriptor();
937
938 return w.document();
939 }
static QByteArray writeCosFromVariantHash(const QVariantHash doc)

References bounds, and KisCosWriter::writeCosFromVariantHash().

◆ textWarpXML()

QDomDocument psd_layer_type_shape::textWarpXML ( )
inline

Definition at line 941 of file psd_additional_layer_info_block.h.

941 {
943 w.enterDescriptor("", "", "warp");
944
945 w.writeEnum("warpStyle", "warpStyle", "warpNone");
946 w.writeDouble("warpValue", 0);
947 w.writeDouble("warpPerspective", 0);
948 w.writeDouble("warpPerspectiveOther", 0);
949 w.writeEnum("warpRotate", "Ornt", "Hrzn");
950
951 w.leaveDescriptor();
952
953 return w.document();
954 }

Member Data Documentation

◆ boundingBox

QRectF psd_layer_type_shape::boundingBox

Definition at line 854 of file psd_additional_layer_info_block.h.

◆ bounds

QRectF psd_layer_type_shape::bounds

Definition at line 853 of file psd_additional_layer_info_block.h.

◆ engineData

QVariantHash psd_layer_type_shape::engineData

Definition at line 852 of file psd_additional_layer_info_block.h.

◆ isHorizontal

bool psd_layer_type_shape::isHorizontal {true}

Definition at line 857 of file psd_additional_layer_info_block.h.

857{true};

◆ text

QString psd_layer_type_shape::text

Definition at line 856 of file psd_additional_layer_info_block.h.

◆ textIndex

int psd_layer_type_shape::textIndex

Definition at line 855 of file psd_additional_layer_info_block.h.

◆ transform

QTransform psd_layer_type_shape::transform

Definition at line 850 of file psd_additional_layer_info_block.h.


The documentation for this struct was generated from the following file: