@@ -102,14 +102,9 @@ enum {
102
102
void DngFloatWriter::write (Array2D<float > && rawPixels, const RawParameters & p, const string & filename) {
103
103
params = &p;
104
104
rawData = std::move (rawPixels);
105
- width = rawData.getWidth ();
106
- height = rawData.getHeight ();
107
-
108
- // FIXME: This is temporal, until I fix RawTherapee
109
105
width = params->width ;
110
106
height = params->height ;
111
107
rawData.displace (-(int )params->leftMargin , -(int )params->topMargin );
112
- // FIXME: END
113
108
114
109
renderPreviews ();
115
110
@@ -235,38 +230,14 @@ void DngFloatWriter::createRawIFD() {
235
230
236
231
// Areas
237
232
uint32_t aa[4 ];
238
- aa[0 ] = params->topMargin ;
239
- aa[1 ] = params->leftMargin ;
240
- // FIXME: This is temporal, until I fix RawTherapee
241
233
aa[0 ] = aa[1 ] = 0 ;
242
- // FIXME: END
243
- aa[2 ] = aa[0 ] + params->height ;
244
- aa[3 ] = aa[1 ] + params->width ;
234
+ aa[2 ] = params->height ;
235
+ aa[3 ] = params->width ;
245
236
rawIFD.addEntry (ACTIVEAREA, IFD::LONG, 4 , aa);
246
- uint32_t ma[16 ];
247
- int nma = 0 ;
248
- if (aa[0 ] > 0 ) {
249
- ma[nma] = 0 ; ma[nma + 1 ] = 0 ; ma[nma + 2 ] = aa[0 ]; ma[nma + 3 ] = width; nma += 4 ;
250
- }
251
- if (aa[1 ] > 0 ) {
252
- ma[nma] = aa[0 ]; ma[nma + 1 ] = 0 ; ma[nma + 2 ] = aa[2 ]; ma[nma + 3 ] = aa[1 ]; nma += 4 ;
253
- }
254
- if (aa[2 ] < height) {
255
- ma[nma] = aa[2 ]; ma[nma + 1 ] = 0 ; ma[nma + 2 ] = height; ma[nma + 3 ] = width; nma += 4 ;
256
- }
257
- if (aa[3 ] < width) {
258
- ma[nma] = aa[0 ]; ma[nma + 1 ] = aa[3 ]; ma[nma + 2 ] = aa[2 ]; ma[nma + 3 ] = width; nma += 4 ;
259
- }
260
- if (nma > 0 ) {
261
- rawIFD.addEntry (MASKEDAREAS, IFD::LONG, nma, ma);
262
- } else {
263
- // If there are no masked areas, black levels must be encoded, but not both.
264
- uint16_t brep[2 ] = { 2 , 2 };
265
- rawIFD.addEntry (BLACKLEVELREP, IFD::SHORT, 2 , brep);
266
- uint16_t cblack[] = { params->blackAt (0 , 0 ), params->blackAt (1 , 0 ),
267
- params->blackAt (0 , 1 ), params->blackAt (1 , 1 ) };
268
- rawIFD.addEntry (BLACKLEVEL, IFD::SHORT, 4 , cblack);
269
- }
237
+ uint16_t brep[2 ] = { 2 , 2 };
238
+ rawIFD.addEntry (BLACKLEVELREP, IFD::SHORT, 2 , brep);
239
+ uint16_t cblack[] = { 0 , 0 , 0 , 0 };
240
+ rawIFD.addEntry (BLACKLEVEL, IFD::SHORT, 4 , cblack);
270
241
uint32_t crop[2 ];
271
242
crop[0 ] = 0 ;
272
243
crop[1 ] = 0 ;
0 commit comments