From 0b97f0a165d6998316039d678fd4a1d8b8e8f538 Mon Sep 17 00:00:00 2001 From: benoit128 Date: Mon, 8 Jul 2024 08:58:05 +0200 Subject: [PATCH] CPlot: enable jpg output for display360 --- Cassiopee/CPlot/CPlot/PyTree.py | 25 ++++++++++++------- .../Converter/Converter/IO/GenIO_binjpg.cpp | 2 +- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Cassiopee/CPlot/CPlot/PyTree.py b/Cassiopee/CPlot/CPlot/PyTree.py index 7ca6e83d1..c0af665e0 100644 --- a/Cassiopee/CPlot/CPlot/PyTree.py +++ b/Cassiopee/CPlot/CPlot/PyTree.py @@ -1205,21 +1205,28 @@ def display360(t, type360=0, **kwargs): C._addVars(a, ['r','g','b','a']) for v in ['r','g','b','a']: pr = Internal.getNodeFromName2(a, v)[1] - pr1 = Internal.getNodeFromName2(a1, v)[1] - pr2 = Internal.getNodeFromName2(a2, v)[1] - pr[0:ni,0:nj] = pr1[0:ni,0:nj] - pr[0:ni,nj:2*nj] = pr2[0:ni,0:nj] + pr1 = Internal.getNodeFromName2(a1, v) + pr2 = Internal.getNodeFromName2(a2, v) + if pr1 is not None and pr2 is not None: + pr1 = pr1[1]; pr2 = pr2[1] + pr[0:ni,0:nj] = pr1[0:ni,0:nj] + pr[0:ni,nj:2*nj] = pr2[0:ni,0:nj] + else: + pr[0:ni, 0:2*nj] = 1. else: # 180 ni = int(locRez[1]); nj = int(locRez[1]) a = G.cart((0,0,0), (1,1,1), (2*ni,nj,1)) C._addVars(a, ['r','g','b','a']) for v in ['r','g','b','a']: pr = Internal.getNodeFromName2(a, v)[1] - pr1 = Internal.getNodeFromName2(a1, v)[1] - pr2 = Internal.getNodeFromName2(a2, v)[1] - pr[0:ni,0:nj] = pr1[0:ni,0:nj] - pr[ni:2*ni,0:nj] = pr2[0:ni,0:nj] - + pr1 = Internal.getNodeFromName2(a1, v) + pr2 = Internal.getNodeFromName2(a2, v) + if pr1 is not None and pr2 is not None: + pr1 = pr1[1]; pr2 = pr2[1] + pr[0:ni,0:nj] = pr1[0:ni,0:nj] + pr[ni:2*ni,0:nj] = pr2[0:ni,0:nj] + else: + pr[0:2*ni,0:nj] = 1. C.convertPyTree2File(a, export) # finale Cmpi.barrier() # wait for completion return None diff --git a/Cassiopee/Converter/Converter/IO/GenIO_binjpg.cpp b/Cassiopee/Converter/Converter/IO/GenIO_binjpg.cpp index 08e647c63..5b2d06513 100644 --- a/Cassiopee/Converter/Converter/IO/GenIO_binjpg.cpp +++ b/Cassiopee/Converter/Converter/IO/GenIO_binjpg.cpp @@ -152,7 +152,7 @@ E_Int K_IO::GenIO::jpgread( E_Int nc = cinfo.output_components; E_Int nil = cinfo.output_width; E_Int njl = cinfo.output_height; - printf("size=" SF_D2_ ", components=" SF_D_ "\n", nil, njl, nc); + //printf("size=" SF_D2_ ", components=" SF_D_ "\n", nil, njl, nc); varString = new char [128];