| 309 | } |
| 310 | |
| 311 | IpcPacketCreateImage IpcPacket::interpretAsCreateImage() const { |
| 312 | IpcPacketCreateImage result; |
| 313 | IStream payload{mPayload}; |
| 314 | |
| 315 | EType type; |
| 316 | payload >> type; |
| 317 | if (type != EType::CreateImage) { |
| 318 | throw runtime_error{"Cannot interpret IPC packet as CreateImage."}; |
| 319 | } |
| 320 | |
| 321 | payload >> result.grabFocus; |
| 322 | payload >> result.imageName; |
| 323 | payload >> result.width >> result.height; |
| 324 | payload >> result.nChannels; |
| 325 | |
| 326 | result.channelNames.resize(result.nChannels); |
| 327 | payload >> result.channelNames; |
| 328 | |
| 329 | return result; |
| 330 | } |
| 331 | |
| 332 | IpcPacketVectorGraphics IpcPacket::interpretAsVectorGraphics() const { |
| 333 | IpcPacketVectorGraphics result; |
no test coverage detected