Krita Source Code Documentation
Loading...
Searching...
No Matches
psd_saver.cpp File Reference
#include "psd_saver.h"
#include <KoColorSpace.h>
#include <KoColorModelStandardIds.h>
#include <KoColorProfile.h>
#include <KoCompositeOp.h>
#include <KoUnit.h>
#include <kis_annotation.h>
#include <kis_types.h>
#include <kis_paint_layer.h>
#include "kis_painter.h"
#include <KisDocument.h>
#include <kis_image.h>
#include <kis_group_layer.h>
#include <kis_paint_device.h>
#include <kis_transaction.h>
#include <kis_debug.h>
#include <kis_guides_config.h>
#include "psd.h"
#include "psd_header.h"
#include "psd_colormode_block.h"
#include "psd_utils.h"
#include "psd_resource_section.h"
#include "psd_layer_section.h"
#include "psd_resource_block.h"
#include "psd_image_data.h"

Go to the source code of this file.

Functions

QPair< psd_color_mode, quint16 > colormodelid_to_psd_colormode (const QString &colorSpaceId, const QString &colorDepthId)
 

Function Documentation

◆ colormodelid_to_psd_colormode()

QPair< psd_color_mode, quint16 > colormodelid_to_psd_colormode ( const QString & colorSpaceId,
const QString & colorDepthId )

Definition at line 40 of file psd_saver.cpp.

41{
43 if (colorSpaceId == RGBAColorModelID.id()) {
44 colorMode = RGB;
45 }
46 else if (colorSpaceId == CMYKAColorModelID.id()) {
47 colorMode = CMYK;
48 }
49 else if (colorSpaceId == GrayAColorModelID.id()) {
50 colorMode = Grayscale;
51 }
52 else if (colorSpaceId == LABAColorModelID.id()) {
53 colorMode = Lab;
54 }
55
56 quint16 depth = 0;
57
58 if (colorDepthId == Integer8BitsColorDepthID.id()) {
59 depth = 8;
60 }
61 else if (colorDepthId == Integer16BitsColorDepthID.id()) {
62 depth = 16;
63 }
64 else if (colorDepthId == Float16BitsColorDepthID.id()) {
65 depth = 32;
66 }
67 else if (colorDepthId == Float32BitsColorDepthID.id()) {
68 depth = 32;
69 }
70
71 return QPair<psd_color_mode, quint16>(colorMode, depth);
72}
const KoID Float32BitsColorDepthID("F32", ki18n("32-bit float/channel"))
const KoID GrayAColorModelID("GRAYA", ki18n("Grayscale/Alpha"))
const KoID Float16BitsColorDepthID("F16", ki18n("16-bit float/channel"))
const KoID Integer8BitsColorDepthID("U8", ki18n("8-bit integer/channel"))
const KoID Integer16BitsColorDepthID("U16", ki18n("16-bit integer/channel"))
const KoID CMYKAColorModelID("CMYKA", ki18n("CMYK/Alpha"))
const KoID LABAColorModelID("LABA", ki18n("L*a*b*/Alpha"))
const KoID RGBAColorModelID("RGBA", ki18n("RGB/Alpha"))
QString id() const
Definition KoID.cpp:63
int depth(typename Forest< T >::const_child_iterator beginIt, typename Forest< T >::const_child_iterator endIt)
Definition KisForest.h:1213
psd_color_mode
Definition psd.h:50
@ Lab
Definition psd.h:58
@ RGB
Definition psd.h:54
@ CMYK
Definition psd.h:55
@ COLORMODE_UNKNOWN
Definition psd.h:65
@ Grayscale
Definition psd.h:52

References CMYK, CMYKAColorModelID, COLORMODE_UNKNOWN, Float16BitsColorDepthID, Float32BitsColorDepthID, GrayAColorModelID, Grayscale, KoID::id(), Integer16BitsColorDepthID, Integer8BitsColorDepthID, Lab, LABAColorModelID, RGB, and RGBAColorModelID.